0

我对 ngMap 和形状有疑问。

一个形状可以有两个不同的属性,可拖动或可编辑。

可编辑在圆的中间添加一个点来拖动它。并在外侧4个点改变半径的大小。可以在这里看到: EDITABLE https://ngmap.github.io/#/!shape_circle_with_current_position.html

可以在这里看到可拖动的:DRAGABLE https://rawgit.com/allenhwkim/angularjs-google-maps/master/testapp/events.html

<ng-map zoom="11" center="current-position">
    <shape draggable="true" on-dragend="someFunction()"></shape>
</ng-map>

使用可拖动的,当我拖动它时,我可以使用“on-dragend”指令(这是一个指令吗?)。但我不知道我可以使用什么指令来编辑可编辑=“真”。

<ng-map zoom="11" center="current-position">
        <shape ??on-edit??="someFunction()" editable="true"></shape>
</ng-map>

我想在编辑形状后调用一个函数,以便我可以更新我的“雷达”和“纬度”、“经度”值。像 on-edit , on-change 之类的东西?我已经尝试过蛮力一点:D

谢谢!

4

1 回答 1

0

使用“on-center_changed”作为圆的位置,使用“on-radius_changed”作为半径。

记录在这里: https ://developers.google.com/maps/documentation/javascript/reference?hl=de#InfoWindow

<ng-map zoom="11" center="current-position">
        <shape on-radius_changed="vm.radiusChanged()" on-center_changed="vm.centerChanged()" editable="true"></shape>
</ng-map>
于 2016-06-05T12:57:28.847 回答