Thu, 12/31/2015 - 09:57
#1
popups on shapes...
If I bind a popup to a circleMarker, I seem to lose the popup after I zoom in on the map. In a loop I create a number of circleMarkers and assign them to an array. And place the array in a layerGroup.
shape = L.circleMarker(adjustedLatLng, { radius: 5, color: color, opacity: 1, fillOpacity: 1 });
shape.bindPopup(modelPoint.HoverText);
shape.on('mouseover', function (e) {
this.openPopup();
});
shape.on('mouseout', function (e) {
var shapeCoord = this.getLatLng();
if (shapeCoord.distanceTo(e.latlng) > 50)
this.closePopup();
});
I changed the layerGroups to featureGroups, the problem persists. The problem ultimately is with the traffic layer. The traffic layer is re-drawn and goes over the featureGroup and I'm not able to click on the shape. Even if I cal the bringToFront on the shape layer. The problem goes away if I don't load in the traffic layer at all. I'll keep playing around with the layers and post the solution I come up with.
hello