popups on shapes...

5 posts / 0 new
Last post
mapservice.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();
    });

 

 


MQBrianCoakley
Try adding the shapes to a
Try adding the shapes to a FeatureGroup. This has always worked great for me.

mapservice.1
I changed the layerGroups to

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.  


MQBrianCoakley
Nice catch on the traffic
Nice catch on the traffic layer. I see the same thing now. I'm sending this over to the development team. Thanks for the notice!

ancyss
hello

hello