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:

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


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

Looks like bindTo was removed. Refer to this post:

Need Your Help

Javascript Reading JSON result from AJAX response

javascript php jquery ajax json

I have a javascript file that makes an AJAX call to a php file on the server which returns JSON encoded data. The PHP file can return either a success or a failure depending with about a dozen diff...