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.
您可以使用setLayoutProperty
更改任何布局属性,包括icon-image
:
map.setLayoutProperty('points', 'icon-image', 'icon-2');
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.