Closed beshad closed 6 years ago
I don't think this
is the correct one.
yes this
inside the getPosition() method is not the MainController this
hence i can't manipulate the main controller when marker is dragged. i am missing something simple here i know but can't figure out what!
Take look at this. https://plnkr.co/edit/ehYlVInH2h0h1QreoG3C?p=preview
brilliant mate thank you so much. that solved my problem. a quick question, am i able to get elevation/altitude through this library too? cheers
Hi guys,
I am having an issue with scoping it seems. i can not update the coordinates in my view when marker is dragged. i call a function in my controller when marker dragged and can console log the movement however the scope inside this function is not the controller scope so unable to pass on this changes to controller scope and update the view. need to do something exactly like this fiddle which works fine but the same code fails in my project (http://jsfiddle.net/3J25M/1068/).
here is my code:
HTML:
when i console.log(this) inside this function it logs the marker directive scope and there is no way for me update the controller. i need the lat and lng to autofill a form when user drag the marker. i am using AngularJS fullStack.
any help would be appreciated,
thanks