G
G
gromanev2016-03-31 17:33:51
Angular
gromanev, 2016-03-31 17:33:51

How to get the coordinates of an element when it is moved using the ng-map library?

When I change the coordinates through the input, the element takes the desired position, but if I drag it manually, it does not update its coordinates.
How can I get its coordinates when dragging manually.
view:

<div ng-controller="geoCtrl as geo">
    <ng-map zoom="11" center="[{{geo.geoMapConfig.position.latitude}}, {{geo.geoMapConfig.position.longitude}}]">
        <shape id="circle" name="circle" centered="true"
               stroke-color='{{geo.geoMapConfig.strokeColor}}'
               stroke-opacity="{{geo.geoMapConfig.strokeOpacity}}"
               stroke-weight="{{geo.geoMapConfig.strokeWeight}}"
               center="[{{geo.geoMapConfig.position.latitude}}, {{geo.geoMapConfig.position.longitude}}]"
               radius="{{geo.geoMapConfig.radius}}" editable="true"></shape>
    </ng-map>
    {{geo.geoMapConfig.position}}
</div>

Controller:
function geoCtrl() {
        var self = this;
        self.geoMapConfig = {
            strokeColor: '#009688',
            strokeOpacity: 0.8,
            strokeWeight: 4,
            radius: 4000,
            position: {
                latitude: 55.7702012,
                longitude: 37.60247520000007
            },
            options: {
                draggable: true
            }
        };
    }

ng-map documentation: https://ngmap.github.io/

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question