GeolocateControl Spins forever on Chrome for iOS
It looks like the geolocateControl is not working on Chrome for iOS. I have confirmed:
- Chrome has permission to use location services "while using the app"
- Location is available in other websites after granting permission (Use browerleaks.com/geo
- The mapbox-gl-js site(s) in question have been granted permission to use location the first time they were loaded
mapbox-gl-js version: 2.11.0
browser: Chrome 109.0.5414.83 on iOS 16.1.1
Steps to Trigger Behavior
- Open chrome, load a mapbox gl js map with geolocate control (e.g. https://docs.mapbox.com/mapbox-gl-js/example/locate-user/)
- Tap the geolocate control
- The control shows a spinning icon, but never gets the location.
Expected Behavior
The geolocate control gets a location and mapbox gl js shows the blue puck on the map
Actual Behavior
The geolocate control spins forever
I can confirm this issue. It might be related to Chrome on iOS — I can't get a location with Chrome 109.0.5414.112 on iOS 16.2 in https://browserleaks.com/geo even after I confirm the permission request prompt.
Likely related to Chrome, as it works on Firefox for iOS version 109 on iOS 15.6.1.
I have the problem on Firefox version 109 except with iOS version 16.0. Upgraded to 16.3 and same thing
Seems to be experiencing the same issue on two different iOS phones
Hi @lukedupin, on which iOS versions does it reproduces for you?
I can also confirm that geolocateControl doesn't work on Chrome or Safari for iOS 16.5 but it works for Chrome and Safari for iOS 15.7.6
Commenting for support - iOS 16.2 running Chrome 113.0.5672.121. Geo locate control spins forever. Hope someone can investigate this
This is a weird one. I am happy to tell you that the issue is gone with the just released iOS 16.5
I'm running into this same issue 😔
Unfortunate that it's 2 years later and this is still an issue. @stepankuzmin any thoughts on how we can get this fixed. I just spent the weekend migrating our Leaflet integration to using Mapbox and I can't use this if Chrome does not work correctly.
Any thoughts on this? Really concerned now that migrating might have been a bad choice if this is causing an issue.
Everything works for chrome desktop, but on Chrome for Ios, I get the never-ending geolocation spinner that never resolves.
Let me know if there's anything I can do to help resolve this bug.
Ok @stepankuzmin, I got this resolved... Kind of. What I had to do was to Go into the Chrome Settings -> Location and then toggle the Location Access and Precise Location toggle.
After doing that, it seemed to work. I'm not sure what the issue was before, but it would be nice if Mapbox had a timeout when the user clicks the UserLocation button. You could even say after 30 seconds of that control spinning, you alert a message to the user and say, please toggle your location access or make sure that you've allowed Location Access in your browser settings.
Hope this can help someone else out down the road. I had a mini panic-attack when I thought that all the work I had done this weekend was pointless 🤪
Really loving Mapbox though and I appreciate y'alls hard work on this awesome library.