allenhwkim / angularjs-google-maps

The Simplest AngularJS Google Maps V3 Directive
http://ngmap.github.io
MIT License
1.52k stars 517 forks source link

marker addListener weird behavior #812

Closed flc closed 7 years ago

flc commented 7 years ago

check out this plnkr: https://plnkr.co/edit/qkrcSe1urtn2XAF3bMGA?p=preview no matter which marker you click, it thinks it is the last one.

The effect is the same if markerclusterer is not used.

I suspect the problem is that the click listener is added "manually" to the marker instead of specifying "on-click" on a marker directive but how to use markerclusterer in that case. Even if if try to use a marker directive it's way to slow for thousands of markers.

flc commented 7 years ago

never mind, this has to be used instead of marker inside the listener function