IconLayer obscured by buildings
firstly
I refer to the example iconlayer in my project. and I achieve effect like this
the icon show correctly.
the building show 3D effect, so , there is a problem in the web page, in larger scale.
Icons blend with buildings .
so ,can icons suspended in the air or buildings ?
You may either:
- Add an altitude (
[long, lat, z]) to the position of each icon - Disable depth testing by passing
parameters: {depthTest: false}to the IconLayer
You may either:
- Add an altitude (
[long, lat, z]) to the position of each icon- Disable depth testing by passing
parameters: {depthTest: false}to the IconLayer
thank you for your reply .
I add altitude when I handle the coordinate. , I set altitude 80,and it works,
icons like ballon suspend above the buildings .but there is another question
the buildings PolygonLayer still overlaps with the IconClusterLayer。Because buildings datas and icon coordinate datas are independent of each other。so ,Is it possible to set up active avoidance buildings?
If you mean making the icons automatically avoid the buildings... that would be very difficult. You can try setting a larger z value, then draw a vertical line from the bottom of each icon to the ground to provide some visual reference:

If you are using the IconClusterLayer from our example, you can do this by modifying the renderLayers method:
return [
// the same IconLayer
new IconLayer(...),
// new
new LineLayer(
this.getSubLayerProps({
id: 'line',
data,
getSourcePosition: getPosition,
getTargetPosition: d => {
const p = getPosition(d);
return [p[0], p[1], 0];
},
getColor: [255, 255, 255],
getStrokeWidth: d => d.zoomLevels[z] ? 1: 0,
updateTriggers: {
getStrokeWidth: {version, z}
}
})
);
];
@Pessimistress Thank you for you reply. and you can understand what I said