ng-map:如何将原点设置为当前位置以获取方向?
ng-map: how to set origin to current location for directions?
我正在使用 AngularJS 和 ng-map。
如何将路线原点设置为我的当前位置?
我试过:
<directions
destination="..."
origin="current-location">
</directions>
但这会导致地图不呈现任何内容。
感谢您帮助我将当前位置设置为原点。
卡尔
目前不受支持,但正在积压中。
Allen 使用 API 调用提供了以下响应以获取当前位置:
https://github.com/allenhwkim/angularjs-google-maps/blob/master/services/navigator_geolocation.js
NavigatorGeolocation.getCurrentPosition().then(函数(位置){
...
});
我正在使用 AngularJS 和 ng-map。
如何将路线原点设置为我的当前位置?
我试过:
<directions
destination="..."
origin="current-location">
</directions>
但这会导致地图不呈现任何内容。
感谢您帮助我将当前位置设置为原点。
卡尔
目前不受支持,但正在积压中。
Allen 使用 API 调用提供了以下响应以获取当前位置:
https://github.com/allenhwkim/angularjs-google-maps/blob/master/services/navigator_geolocation.js
NavigatorGeolocation.getCurrentPosition().then(函数(位置){ ... });