this.map.on('pointermove', e => {
//鼠标经过箭头变手势,,可以在if的条件中加入指定的图层layerId即可
let pixel = this.map.getEventPixel(e.originalEvent);
let hit = this.map.hasFeatureAtPixel(pixel, {
layerFilter: layer => {
let layerId = layer.get('layerId');
if (
layerId =='alertlayer' ||
layerId =='lightlayer' ||
layerId.indexOf("line_") > -1
) {
return true;
}
},
});
this.map.getTargetElement().style.cursor = hit ? 'pointer' : '';
});
openlayers鼠标经过指定图层箭头变成手势
最新推荐文章于 2023-08-21 14:27:21 发布