Geographic Information Systems Asked by daudihus on January 3, 2021
I’m trying to build a popup that only shows feature info from certain layers. How do I get layer name?
I’ve tried this:
const features = this.map.getFeaturesAtPixel(evt.pixel, {
layerFilter: ((layerCandidate: layer.Layer) => {
if (layerCandidate.get('name') === 'my layer') {
return true;
}
return false;
}
)});`
var feature = Map.olMap.forEachFeatureAtPixel(pixel, function (feature, layer) {
options.layer = layer;
options.features = feature;
options.modify = self.currentInteraction;
options.sender = self;
callback(options);
});
In these codes, you can get all layer properties with this command
options.layer.getProperties()
title
, opacity
, visible
and other details about layer.
Answered by Ömür Bilgili on January 3, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP