I have a pop-up and a highlightFeature on my web map. When I access my map using desktop my highlightFeature works with the mouseover and the click on action works for my pop-up. When using mobile my highlightFeature does not work when clicked on but the pop-up does.
How do I write it to include a hover or blur? Do I keep the mouseover function along with the hover or blur?
function highlightFeature(e) {
var layer = e.target;
layer
layer.setStyle({
weight: 10,
opacity: .4,
color: '#FF0099',
dashArray: '',
fillOpacity: 0.7
});
if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) {
layer.bringToFront();
}
}
function resetHighlight(e) {
geojson.resetStyle(e.target);
layer.setStyle({
weight: 5,
color: '#0000ff',
dashArray: '',
fillOpacity: 0.7
});
}
//end highlight line feature
//layer on with mouseout and mouseover
layer.on({
mouseout: function (e) {
for (i in e.target._eventParents) {
e.target._eventParents[i].resetStyle(e.target);
}
if (typeof layer.closePopup == 'function') {
layer.closePopup();
} else {
layer.eachLayer(function (feature) {
feature.closePopup()
});
}
},
mouseover: highlightFeature,
});