javascript - Pass coordinates of current Google Maps marker -


maybe simple question couldn't find easy answer it. have eventhandler on marker makes infowindow pop ng-click inside of it:

google.maps.event.addlistener(mymarker, 'click', function() {       var contentstring = "<div>somerandomstring<br/>" +                          "<a ng-click='send()'>send google maps</a></div>";       var compiled = $compile(contentstring)($scope);      infowindow.setcontent(compiled[0]);       infowindow.open($scope.map, mymarker); }); 

is there way can pass coordinates of mymarker function send()? send(this.position) ?

you should able following using mymarker.getposition()

google.maps.event.addlistener(mymarker, 'click', function() {      var location = mymarker.getposition().tostring();      var contentstring = "<div>somerandomstring<br/>" +                          "<a ng-click='send(" + location + ")'>send google maps</a></div>";       var compiled = $compile(contentstring)($scope);      infowindow.setcontent(compiled[0]);       infowindow.open($scope.map, mymarker); }); 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -