naderio / nativescript-google-maps-utils

NativeScript Google Maps SDK utility library to support features such as marker clustering, heatmap, ...
The Unlicense
33 stars 15 forks source link

Info Windows & Map Events #6

Closed MichaelSolati closed 7 years ago

MichaelSolati commented 7 years ago

So before I implemented clusters I had my Markers open infowindows and on marker click triggered events with the markerSelect and markerInfoWindowTapped directives of the MapView. (I'm using NativeScript with Angular 2.x)

Anyway, after clustering, neither the info windows nor the MapView directives work/trigger when I click on a marker. For "shits & giggles" I modified the index.android.td adding the following line mapView.notifyMarkerEvent("markerSelect", clusterManager); in the function setupMarkerCluster().

With that the markerSelect directive will trigger, but with no marker to be found... 😩

Any thoughts or insight would be helpful here, thank you!

naderio commented 7 years ago

@MichaelSolati well .. this one wont be simple to handle. the android google sdk recreates the markers dynamically thus the reference link in JS becomes obsolete. will see...

xyz765 commented 7 years ago

I think i got the same issue, I'm using Angular too and a marker added with mapView.addMarker(marker); the funcion: (markerSelect)="onMarkerSelect($event)" works fine. but when you click on a marker added by setupMarkerCluster() the function "onMarkerSelect" is triggered but the value of "marker" is undefined.

naderio commented 7 years ago

yes, I've attempted to reimplement the marker click listener but that didn't work .. will see

randy-johnson commented 7 years ago

I am experiencing the same thing with the demo folder in the repo. I can click on the Tunis marker with no problem but when I click the other ones that are created I receive an error.

naderio commented 7 years ago

@MichaelSolati @xyz765 @randy-johnson check latest version, should be fixed

MichaelSolati commented 7 years ago

You're the real MVP @naderio !!!! I'll have to update my projects over the weekend.