geolocation.bindTo() 未定义

geolocation.bindTo() is not defined

我正在按照本指南进行操作。它在您访问该站点时正常执行,但是当我尝试从我的本地主机 运行 它时,它给我 geolocation.bindTo() 一个未定义的错误。我读到它是尚未创建地理定位对象或据我在此处阅读的方法异步执行。

这是 link: https://openlayersbook.github.io/ch10-openlayers-goes-mobile/example-02.html

这基本上是使用带有 openstreetmaps 的 openlayers 3 跟踪用户的位置。

bindTo 似乎已被删除。参考这个post:https://github.com/openlayers/ol3/pull/3472

绑定到 ol.dom.Input 已弃用。使用 "propertychange" 和其他监听器。