0
我在pointerMove工作和突出顯示功能上工作特徵選擇交互。
我想獲得的另一件事是在選定的功能上顯示功能屬性。
我想獲得在地圖上的特定功能,沒有制定出例如新的HTML元素或彈出
上在http://openlayers.org/en/latest/examples/select-features.html
任何幫助或想法更多的歡迎:)
OpenLayers在選擇交互的地圖上顯示功能屬性
roomsLayerEventMouserOver(layer) {
if(this.select){
this.map.removeInteraction(this.select);
}
this.select = new ol.interaction.Select({
condition: ol.events.condition.pointerMove,
layers: [
layer
],
style: this.getStyle('pink', 'red'),
});
this.map.addInteraction(this.select);
this.select.on('select', (e) => {
let features = e.target.getFeatures();
features.forEach((feature) => {
console.log(feature.getProperties().name);
// THIS IS PROBABLY THE PLACE I NEED SOMETHING
});
});
}