OverlappingMarkerSpiderfier icon indicating copy to clipboard operation
OverlappingMarkerSpiderfier copied to clipboard

Hover doesn't work unless I roll mouse off the map

Open nino90 opened this issue 10 years ago • 0 comments

I'm doing a pretty simple add of map markers into oms. It looks like this:

// Add to the markers data array
                markers_data.push({
                    lat: latitude,
                    lng: longitude,
                    title: value.label,
                    icon: 'img/markers/marker'+value.result_number+'.png'
                });

... more code...

for (var i = 0, marker; marker=markers_data[i]; i++) {
    this.addMarker(marker);
    oms.addMarker(marker);
  }

When I got to the map, the markers all appear and the spiderfier works. However, when I hover over the markers for the title, only the first one shows up. I then have to mouse out of the map window and then back in for the hover to pick up another title from another marker. Your demo doesn't seem to have that problem.

Only thing that comes to mind is that I'm adding a more "complex" listener to my click event, but can't imagine how that could affect it... especially since the hover for title works fine once I "reset it" by mousing off the map.

Here's the click listener:

oms.addListener('click', function(marker, event) {
      var r = /\d+/;
      var result_id = marker.icon.match(r)[0];
      if ($('#'+result_id).length == 0) {
          openPagesAndAnchor(getPageResultIsOn(result_id));
      }
      setTimeout(function(){
        window.location.hash = '#'+result_id;
      }, 500);
    });

Please let me know if you have any ideas as to why this isn't working. This is a cool tool and I just want to get it to work right! Thanks!

Nino

nino90 avatar Jun 02 '15 06:06 nino90