Element launches E2EE Location Sharing

February 16, 2022
Element app

Location sharing can be seen in both a positive and negative light.

Great in the sense that it provides an extra layer of safety and convenience to users. Ever tried finding your friends at a festival without location sharing? Impossible. A lone worker who wants the comfort of those back at base knowing where they are? Yes please.

But, of course, it can also be a massive invasion of privacy and yet another opportunity for data mining and more ******* adverts.

By now you hopefully know that Element is all about putting you in control. So it should come as no surprise that our new location sharing feature is - absolutely optional!

Being able to share your location in a chat on Element has been a popular request for a while. We’ve been working on it, and are now very happy to launch the ability to share your current device location on iOS, Android and Web. The Element desktop app can receive locations but is not currently able to send them.

How does it work?

To share your location, click the new location pin icon that you can find in your composer. This will bring up a map displaying your location. You will also need to give permissions for the application to access your device location. Once you’ve confirmed the location is accurate, click ‘share’ and this location will be shared in the timeline of the room or DM. It’s a single static point that won’t change as you move - and you can always delete it if you no longer want people to be able to see it.

When someone shares a location in a chat room, you’ll see it displayed in the timeline. You can  click on the map image to open a larger overlay where you can pan, scroll and zoom to see more detail of the user's location.

Tileservers and privacy

If you share your location in an end-to-end encrypted room, the location data will also be end-to-end encrypted. However, displaying visible maps relies on a tileserver, which provides the map imagery to your device. To request the right tiles from the tileserver, your client has to send them the relevant location.

For users on matrix.org (and those hosted by Element Matrix Services for that matter), we’ve defaulted to using MapTiler’s cloud-based tileserver. We deliberately decided to use a third party for two reasons. Firstly, to ensure that neither Element nor Matrix have access to enough data to link location requests to individual usage patterns and, secondly, because we’re very confident in MapTiler’s privacy policy.

However, we’ve made it easy for you to change this, and specify your own choice of tileserver if you prefer.

If you are self-hosting Element Web, you can add this to the top level of its config.json file:

  1. {
  2. ... other config ...
  3. "map_style_url": "",
  4. ... other config ...
  5. }

If you run a home server, you can specify a tile server in the .well-known area. You should serve up a file from your server root called /.well-known/matrix/client containing information like this:

  1. {
  2. ... other info ...
  3. "m.tile_server": {
  4. "map_style_url": "http://mytileserver.example.com/style.json"
  5. }
  6. ... other info ...
  7. }

Once you have one of those settings in place, your Element client will use your chosen tile server every time it displays a map!

Andy, the lead web developer on this feature, has even written a very comprehensive blog post on how you can self-host your own tiles, and set up your client or homeserver to use them!

What’s next?

There are loads more features we still want to add to our Location Sharing function! Here’s some extra’s to look forward to:

⏳ Live location sharing, so you can share your location for a set period of time, and users in the room will see your pin moving in real-time

📍 Pin-drop, so you can pick a location on a map to send, even if it’s not where your device is

🔎 Address search, so you can search for a location by address or even by grid reference, and send it in a room

As always, please feedback on what you think of the feature and anything you’d like us to add. You can reach out to us in one of the public rooms, or log a GitHub issue.

Related Posts

By the same author

Thanks for reading our blog— if you got this far, you should head toelement.ioto learn more!