简体   繁体   中英

How to change layout of icon-image on hover in Mapbox?

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM