I use objects on the map, such as circles (Circle) and I need their size to remain constant as the map is zoomed in. Is there a way to achieve this result?
Below is the code where objects of the "Circle" type are created, with a radius of 1000 m:
const { data } = this;
const ymaps = window.ymaps;
ymaps.ready(init);
function init() {
var myMap = new ymaps.Map('map', {
center: [43.00, 40.97],
zoom: 9
});
let circle;
for (let x = 0; x < data.length; x++) {
circle = new ymaps.Circle([[data[x].coordx, data[x].coordy], 1000], {}, {
fillColor: '#DB709377',
strokeColor: '#990066',
strokeOpacity: 0.8,
strokeWidth: 1,
});
myMap.geoObjects.add(circle);
}
}
But is it possible for them to have a fixed radius in pixels, or relative to the window, but not relative to the map? Thank you for attention
You can try this