Closed mukgupta closed 10 years ago
I had a similar issue, I can upload the solution I used tomorrow or the next day
@wpalahnuk : can you please share.
Here's my quick solution,
https://github.com/wpalahnuk/angular-gm
I've added in a getMarker(mapId)
function to the container which returns the markers for the provided mapId. It's not fully tested yet because I've got a bunch of other changes I'm going to make, but it should work for now.
@wpalahnuk is there any gist/plunkr to show how to use your fork with MapClusterer?
@JohnPhoto all you have to do is call the markerclusterer constructor after the markers have been updated by the angular-gm controller.
var markers = angulargmContainer.getMarkers(mapId)
var map = angulargmContainer.getMap(mapId);
var markerCluster = new MarkerClusterer(map, markers);
It's a pretty crappy way to do it but it works for now. dylanfprice is currently making some changes to angular-gm but once he's done I'm going to put out a directive that allows you to use markercluster with angular-gm. Probably one for Overlapping Marker Spiderfier as well
Thank you for the update, will follow this like a hawk since this is something I really need for my project.
I don't have time to look into this but it should be possible to create a directive that does this by taking advantage of the angulargmMapController#forEachElementInScope function. I can imagine something along the lines of:
<gm-map ...>
<gm-markers ... gm-markerclusterer></gm-markers>
</gm-map>
I'm going to go ahead and close this but if you do end up making the directive I'd love to get a PR for it!
Would love a directive with Overlapping Marker Spiderfier! :+1:
@JohnPhoto Would love to have a Cluster sample too! Have you find out something?
No sorry I have not found out how to do this. It was not really prioritized in my project after all.
That would help me as well... I've tried a few approaches but none worked yet.
I want to use Google Mapsclusterer for the markers. For that i need to get the marker and map instance. I can get the map instance from the getPromise but i cannot get marker instance.