NoHide no pointer event label

I need to add custom city names using circleMarkerru of my map. But I want to click on the label, because there is a polygon under it. There is my JS code, which addscircleMarker

var ville_label = new L.CircleMarker(
    [lat, lng], 
    { clickable: false, radius: (1/zoom)*12 }
).bindLabel(lib, { noHide: true, className: "leaflet-ville-label" })
.addTo(ville_layer);

In CSS, I disabled the pointer event

.leaflet-ville-label {
    pointer-events: none;
}

But IE is not supprot pointer-events, and Label is a div element, not an SVG.

Does anyone have a solution to disable pointer events on a static shortcut?

+4
source share
3 answers

I found a solution, but not the way I think at first.

I am using the boxbox lib leaflet-pip call

Detail procedure:

:

$(".leaflet-ville-label").off("click").on("click", function(e) {
    if ($(this).hasClass("noclick")) {
        $(".leaflet-ville-label").removeClass("noclick");
        return;
    }
    for (layer_id in kml_layer._layers) {
        var under_layer = leafletPip.pointInLayer(france.mouseEventToLatLng(e), kml_layer._layers[layer_id]);
        if (under_layer.length > 0) {
            under_layer[0].fire("click");
        }
    }
});
0

. - - ie. :

+3

, .

DIV , IE 9 10 , . IE 11

.leaflet-ville-label {
    pointer-events:none;
}

. http://jsfiddle.net/LHL82/7/

+1
source

All Articles