let marker = L.marker(new L.LatLng(lat, lon), { icon: markerIcon });
map.addLayer(marker);
Just like the normal marker, how can we use enablePermanentHighlight()
on features of FeatureLayer
. Any alternative?
This is how I use this on marker,
marker.enablePermanentHighlight();
or
marker.options.highlight = "permanent";
I have used the same method on feature layer, but that layer was not highlighting/blinking.
foundFeatureLayer.eachActiveFeature((layer) => {
if (layer.feature || layer instanceof L.Marker) {
layer.enablePermanentHighlight();
}
});
you need to wait for your
featureLayer
to load before you can loop through individual features.http://jsbin.com/nuxawek/edit?html,output