Spiderfy custom overlays
I'm having a heck of a time trying to implement this in Ngmap. There seems to be a disconnect between the custom-marker directive and the actual marker itself. Have you any ideas on integration with this library?
https://ngmap.github.io/#/!custom-marker-custom-style.html
After I've loaded all my markers:
$scope.informSpiderfy = function() {
/* Instantiate overlapping marker helper */
var oms = new OverlappingMarkerSpiderfier($scope.map, {
keepSpiderfied: true,
nearbyDistance: 1000,
});
var infoWindow = $scope.map.infoWindows.infoWindow;
oms.addListener('click', function(marker, event) {
console.log("YES?");
infoWindow.setContent("OMG");
infoWindow.open(map, marker);
});
var markers = $scope.markers;
for (var k in markers) {
var marker = markers[k];
oms.addMarker(marker);
}
console.log(oms);
};
Update: Ok it works for the regular marker directive but not the custom-marker. Typically the dom element is tied with the marker so it should "move" but perhaps the ngMap author is rendering it differently.
Update: I see, it's using google's Overlay process instead of the standard marker. The thing is, all I need is Spiderfier's functionality of the re-positioning, I'll just attach that to the overlay coordinates. Is it possible there is a hook like addOverlay()? https://developers.google.com/maps/documentation/javascript/customoverlays
I'd love to see support for spiderfying OverlayViews as well.
is there any way to integrate OverlayView with this library?