如何在openlayers中优先显示图片图标?
How to give priority to image icon in openlayers?
早上好,有什么方法可以在打开层中设置图像图标的优先级吗?因为我想把一些我留在别人下面的图标并想移动它们,所以我必须放大很多,以便它们与其他图标隔离开来。
问题是这些图标是 NOMINATIM 使用地址的起点和终点,并根据这些图标绘制了一条带有公交车站的线路。
代码如下:
image: new i({
//scale: .7,
anchor: [0.5, 46],
anchorXUnits: 'fraction',
anchorYUnits: 'pixels',
opacity: 0.95,
src: g
})
设置父样式的zIndex:
new ol.style.Style({
image: new ol.style.Icon({
...
...
}),
zIndex: ...
})
或更改已设置样式的功能
feature.getStyle().setZIndex(...);
早上好,有什么方法可以在打开层中设置图像图标的优先级吗?因为我想把一些我留在别人下面的图标并想移动它们,所以我必须放大很多,以便它们与其他图标隔离开来。
问题是这些图标是 NOMINATIM 使用地址的起点和终点,并根据这些图标绘制了一条带有公交车站的线路。
代码如下:
image: new i({
//scale: .7,
anchor: [0.5, 46],
anchorXUnits: 'fraction',
anchorYUnits: 'pixels',
opacity: 0.95,
src: g
})
设置父样式的zIndex:
new ol.style.Style({
image: new ol.style.Icon({
...
...
}),
zIndex: ...
})
或更改已设置样式的功能
feature.getStyle().setZIndex(...);