New answers tagged

0

One simple thing that's wrong can be found in code above. Popup that is attached to layer can be opened only with .openPopup() or .openPopup(latLng) calls (see https://leafletjs.com/reference-1.6.0.html#popup). Both calls open existing popup content , so e.layer.openPopup("test") call does not work. To change content of the layer popup on the fly when popup ...


0

This is a good question. Typically you'd use feature-state for this like in https://docs.mapbox.com/mapbox-gl-js/example/hover-styles/, however feature-state doesn't support the icon-image layout property yet. You can use setLayoutProperty but you'll need a unique id in the source so that you can use this when evaluating the icon-image, eg. using a match ...


Top 50 recent answers are included