OverlappingMarkerSpiderfier icon indicating copy to clipboard operation
OverlappingMarkerSpiderfier copied to clipboard

Spiderfy custom overlays

Open ericjames opened this issue 9 years ago • 4 comments

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);
    };

ericjames avatar Aug 09 '16 18:08 ericjames

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.

ericjames avatar Aug 09 '16 19:08 ericjames

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

ericjames avatar Aug 10 '16 21:08 ericjames

I'd love to see support for spiderfying OverlayViews as well.

rognstad avatar May 17 '17 20:05 rognstad

is there any way to integrate OverlayView with this library?

haider-ali avatar Jun 13 '19 12:06 haider-ali