IconLayer icon disappear
before some days I update deck.gl version to v7
"@deck.gl/core": "^7.1.7",
"@deck.gl/geo-layers": "^7.1.7",
"@deck.gl/layers": "^7.1.7",
when I load IconLayer, it succeeded。
after I dragged the map,Icon disppear
no matter change the zoom level or move the map position
Icons sometimes appear and sometimes disappear
Have you checked the icon example?
If you still have troubles with seeing the icon while dragging, you can share your code snippet here.
@xintongxia thank you for your reply. I checked the documention iconlayer example. this is my code
const exhibitoncityIncons = require('../../../../public/resources/images/cityIcon.png');
const exhibitionMappings = require('../../../../public/resources/data/exhibition_icon_mapping.json');
new IconLayer({
id:'city-layer',
data:this.props.map.cityIcons,
pickable: true,
iconAtlas:exhibitoncityIncons,
iconMapping:exhibitionMappings,
sizeScale: 150,
getPosition: d => d.coordinates,
getIcon: d => d.icon,
onClick: info => this.iconClick(info),
}),
I did a simple IconLayer example, you can play around with your own icon parametres.
https://codesandbox.io/embed/peaceful-joliot-xvufo
I'll update the doc.
@xintongxia ok, thank you fory your share. I have another question. Whether there is a attribute to set Icon hiding or display. for example , when zoom level >8 and zoom level <14 ,Icon display .ohterwise ,hiding Icon layer? thank you
there is a onViewStateChange callback you can listen to, which has the zoom level info and you can decide whether to render IconLayer from there
Also I updated the coodesandbox
@xintongxia thank you. you are the kindest person in the world.