• Markers with same address/latlong display on top of each other and users aren’t able to click between them. I have seen the other thread where you suggest to offset them so there is distance, but depends on the zoom levels, they may still be on top of each other.

    Would you consider officially adding OverlappingMarkerSpiderfier (demo)? It separates (spiderfies) the markers that are overlapping. I modified WPSL 2.2.235 like below to get it working:

    1. Add OverlappingMarkerSpiderfier as a dependency of wpsl-gmap.js
    2. Modify wpsl-gmap.js like below:

    After line 129 ( map = new google.maps.Map(); ), add:

    oms = new OverlappingMarkerSpiderfier(map, {
        markersWontMove: true,
        markersWontHide: true,
        basicFormatEvents: true,
        keepSpiderfied: true,
        ignoreMapClick: true
    });

    Add oms as a parameter to all location markers. For example, line 141 becomes:

    addMarker( latLng, mapData[index].id, mapData[index], false, infoWindow, oms );

    Since we’re only adding oms to location markers and the starter marker also uses it, we make oms optional on line 1831 like so:

    function addMarker( latLng, storeId, infoWindowData, draggable, infoWindow, oms = null ) {

    Change the click listener of the marker on Line 1869 like so:

    google.maps.event.addListener( marker, "spider_click",( function( currentMap ) {

    And after that chunk of listener above, add:

    if(oms){
        oms.addMarker(marker);  // adds the marker to the spiderfier _and_ the map
    }

    Let me know your thoughts. Thank you!

Viewing 1 replies (of 1 total)
  • Hi there!

    Wow, this does indeed sound interesting, I am going to forward this to the dev team to see what they think of it, and we’ll get back to you ??

    Regards,

Viewing 1 replies (of 1 total)
  • The topic ‘Spiderfying locations with same address’ is closed to new replies.