ThinkGeo.com    |     Documentation    |     Premium Support

Get Current Location

I’m trying to implement a locator similar to your code sample “Getting Started.” The locate button works fine on my PC in IE and Firefox, but not in Chrome. Also the code does not work for iPhone - Safari. The div “Failed to locate your position” shows up. Wondering why this is. You can try it on the ThinkGeo sample below.

http://wiki.thinkgeo.com/wiki/map_suite_webapi_getting_started

Thank you.

Also, I’ve enabled location services and allowed browser to access my location, and still it does not work.

Hi Chad,

We support locate via OpenLayers.

For Chrome, it looks only https support locate for now. You can get more detail information here: https://developers.google.com/web/updates/2016/04/geolocation-on-secure-contexts-only

And for Safari, it looks it’s not supported, you can view the sample here: https://openlayersbook.github.io/ch10-openlayers-goes-mobile/example-04.html

Regards,

Don