3

I'm using ng-map for Angularjs, I'm using the following code to get marker position after drag event

<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());
}

But its not working. Any suggestions?

user2985035
  • 569
  • 3
  • 8
  • 18

1 Answers1

3

Just get it from the event of on-dragend:

$scope.getCurrentlocation = function(e) {
    $scope.address.lat = e.latLng.lat();
    $scope.address.lng = e.latLng.lng();
};

At least this works for me.

dekztah
  • 373
  • 7
  • 17