【问题标题】:ngMap/Google Maps Api v3: call function when shape editedngMap/Google Maps Api v3:形状编辑时调用函数
【发布时间】:2016-06-05 20:57:28
【问题描述】:

我对 ngMap 和形状有疑问。

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

editable 在圆的中间添加一个点来拖动它。并在外侧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”指令(这是一个指令吗?)。 但我不知道我可以使用什么指令与 editable="true"。

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

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

谢谢!

【问题讨论】:

    标签: google-maps google-maps-api-3 ng-map


    【解决方案1】:

    使用“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>
    

    【讨论】:

    • @choz 如果您提供更多信息,我可能会为您提供帮助,因为它对我来说很好。
    • 我已经在github 上提出了这个问题。而且我还在那里提供了plunker..你可以检查一下..
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-05-09
    • 2013-04-05
    • 1970-01-01
    • 2013-12-27
    相关资源
    最近更新 更多