I am trying to use the getIcon method and provide an external icon as a URL. It seems to be not rendering any marker on the map. In the following code ICON Mapping implementation with IconAtlas works without any issues but when I am trying to use getIcon method instead of IconAtlas and it seems to be not working for me.
/** ICON MAPPING WORKS */
const ICON_MAPPING = {
airplane : {
x:0,
y:0,
width: 512,
height: 512
}
}
/** ICON MAPPING WORKED END */
new IconLayer({
id: `path-layer-${fd.slice_id}`,
data,
getColor: d => sc,
getPosition: d => { return d.spatial;},
/** ICON MAPPING WORKS */
// sizeScale: 50,
// iconAtlas : 'https://raw.githubusercontent.com/Swizec/webgl-airplanes-map/master/src/airplane-icon.jpg',
// iconMapping: ICON_MAPPING,
// getIcon:d=>"airplane",
// getSize: d => 1,
/** ICON MAPPING WORKED */
/** Get ICON Implementation */
getIcon: d => ({
url:"https://raw.githubusercontent.com/Swizec/webgl-airplanes-map/master/src/airplane-icon.jpg",
height:512,
width: 512,
mask:false,
}),
sizeScale: 50,
getSize: d => 1,
/** Get ICON Implementation END*/
opacity: 1,
sizeMinPixels : 30,
pickable: true,
visible: true,
});
@xintongxia Do you see any issues in the above code?
I tried with your icon params on my end and it is working. I don't know what is the data you are using, so I use our test data instead.
Closing due to inactivity and unable to reproduce any issue. Please reopen if you feel there is still an issue here.