Reputation: 41
I use GeoJson Mapbox, and I want to change "icon-image" on hover.
map.addLayer({
"id": "points",
"type": "symbol",
"source": {
"type": "geojson",
"data": "geo.json"
},
"layout": {
"icon-image": "icon-1"
});
Any ideas on how to approach this? Thank you.
Upvotes: 2
Views: 1074
Reputation: 126045
You can change any layout property, including icon-image
, with setLayoutProperty
:
map.setLayoutProperty('points', 'icon-image', 'icon-2');
Upvotes: 1