[Proposal] Expose GeoLocation to Service Workers


FYI, I’ve banned @Richard_Maher from our discourse for repeated code of conduct violations.

If he returns under a different alias (which he tends to do), please let me know.

Please refrain from engaging with him on Discourse or standards discussions.


I’ve also deleted @Richard_Maher posts, as they are just noise.

Apologies to participants in this thread for not taking action sooner. This individual has been trolling our community for a long time, and, despite numerous pledges from him to behave - or claims that he will go away, he keeps coming back.


I’m not sure if i should add this here or in a new post, but i also feel the need to use some of the functionality requested here, in particular the access to the geofencing api. The main goal is to use the device location services in a practical and battery-efficient way.

Here are some scenarios that i can think of:

  • an airline app can define a geofence around an airport when a flight reservation is near boarding time. When the device crosses the geofence, the app can send a notification that takes users to an activity that allows them to get their boarding pass. (taken from google geofencing api)

  • Travel guide assistance - Could define multiple interesting areas around a city, accordingly to the user interests, and warn users when they are entering or leaving that area of interest.

There exists such functionality in native apps, for example in andoid and in ios.


The other use case can be in sport area. Like paragliding where the participants should be tracked and scored. The location should be tracked every 3 second and send to the server when network is available and it is better to be send LIFO (last in first out) so the server knows the last location as soon as possible to show it to the spectators on the web site. Also the server must care about, the rules (where to go and where not to go), the safety (where was the pilot lately if she/he is missing) and at the end of competition to collect them from about 60 km wide playing field with designated vehicles, the server must track the vehicles as well. One more thing, the altitude is also important, not only lat/long.

The spec might be like to register to get the location every 3 seconds / every 10 meter, and the user get a permission box to allow or not. And the service worker get a location changed event every 3 seconds / every 10 meter.


Two use cases that are perhaps a little left of field but I think are important.

  • Museum content based on geofences that represent different exhibitions. Research in the area of museums and other cultural orgs has shown that their apps tend to go un-used whilst their websites are visited regularly. As the web is challenged by native apps there is an opportunity in the cultural space to maintain dominance. In cultural spaces you tend to react to where the user is or what they are seeing to cue different experiences and content. Being able to access GeoLocation via SW would give developers in this space one less reason to have to build a native app.

  • Festival content based on geofences that represent different festival stages/performances areas. Useful via SW because you could send notifications as people pass locations - especially useful for events that span entire cities.

  • Art installations/web art. As the world of digital art continues to explore having more APIs available to web artists and creative coders will unlock artworks that cannot be created by other means. Artworks need to capture an audience quickly and instantly - asking a user to download an app before viewing an artwork doesn’t lead to much usage for the same reasons museums have issues (see link above).

It is anecdotal, but all 3 of the above instances have lead me (or the companies I’ve worked for) to have to pursue native apps just for geofencing capabilities (even though for many other reasons a PWA would have been better).


I was under the impression that SW could use geolocation?

OTOH, these use cases are great reasons that browsers should be not only aware of the device location but also the location of other geographic features, so that it can do reasonable things, possibly including geofencing.

This is one of the things we’re trying to accomplish with Map Markup Language. https://discourse.wicg.io/t/map-markup-language/1267/4


:frowning: There is some stuff that could have been editied out because it is inappropriate noise, but as far as possible it is helpful to have the other stuff available.


This space has very low tolerance to abusive behaviour, as we believe that inclusivity towards abusers results in excluding others. It is not the chairs’ role to edit out the poison while trying the guess whatever substantial contribution was intertwined in it. If someone has something valuable to say, they can say it without demeaning others.