I have added a layer group (UTM Projection) and OSM.
Map View projection set to 4326. Trying to get features at clicking position but, not getting the features at map.onclick event. Shall I need to assign projection for evt.pixel?
view: new ol.View({
projection: "EPSG:4326",
zoom: 13,
maxZoom: 22
}),
map.on('singleclick', function(evt) {
const features = map.getFeaturesAtPixel(evt.pixel);
console.log (features.length);
});
New contributor
J Subramanyam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.