I used ol.interaction.snap but i want to get feature which point was snaped?
snapInteraction = new ol.interaction.Snap({
source: Source.stationSource
});
because of no event i can not get which point is snaped
I used ol.interaction.snap but i want to get feature which point was snaped?
snapInteraction = new ol.interaction.Snap({
source: Source.stationSource
});
because of no event i can not get which point is snaped
For draw interaction snapping, one way is getFeaturesAtPixel, where pixel is evt.target.downPx_
draw.on('drawstart', (evt) => {
const featuresAtPixel = map.getFeaturesAtPixel(evt.target.downPx_)
console.log('drawstart', evt, featuresAtPixel);
})
© 2022 - 2024 — McMap. All rights reserved.