Search code examples
geolocationopenlayers-3

geolocation.bindTo() is not defined


I was following this guide. It executes normally when you visit the site but when I try to run it from my localhost it gives me the geolocation.bindTo() an error undefined. I read about it being the geolocation object is not yet created or the method executes asynchronously as far as i read here.

Here is the link: https://openlayersbook.github.io/ch10-openlayers-goes-mobile/example-02.html

this is basically tracking the location of the user using openlayers 3 with openstreetmaps.


Solution

  • bindTo is depracted with ol.dom.Input. Use "propertychange" and other listeners.