【发布时间】:2016-02-14 17:08:26
【问题描述】:
我正在为 Angularjs 使用 ng-map,我正在使用以下代码在拖动事件后获取标记位置
<div class="mapWrap" data-tap-disabled="true">
<map center="43.07493,-89.381388" zoom="4">
<marker draggable=true position="{{pos.lat}},{{pos.lng}}"
on-dragend="getCurrentLocation()"></marker>
</map>
$scope.getCurrentLocation = function(){
$scope.pos = this.getPosition();
concole.log($scope.pos.lat() +' '+ $scope.pos.lng());
}
但它不起作用。有什么建议吗?
【问题讨论】:
-
on-dragend是否代表 ng-map 的有效事件?如果是的话,还有什么选择? -
文档不会告诉你吗?
-
从另一个问题而不是从文档中得到它?这是链接link
标签: javascript angularjs google-maps-api-3 ng-map