I have the a layer with
on click handler:
countriesLayer = L.geoJson(ct,
{
style: myStyle,
onEachFeature: onEachFeature
}
)
function onEachFeature(feature, layer) {
var center = setLabelCenter(layer);
feature.center = [center.lng, center.lat];
layer.on({
click: onFeatureClick,
mouseover: showMapTip,
});
Also I have a popup for mouse over:
function showMapTip(e) {
var layer = e.target;
var content = getInfoContent(layer.feature.properties);
layerPopup = L.popup( {
autoPan : false
})
.setLatLng(e.latlng)
.setContent(content)
.openOn(mymap)
}
The problem is that onClick event is not always fired. More exactly, it is fired in about 10% cases. If I cancel popup the it works.
Is it possible to solve the problem?