I
I
Ingvar Von Bjork2018-11-13 01:04:53
JavaScript
Ingvar Von Bjork, 2018-11-13 01:04:53

How to add several circles to Yandex.Map?

There is an array of coordinates of the form:



I want to add circles to the map at these coordinates. I use this solution:

coordArray.forEach(function(item) {
    mapCircle.geometry.setCoordinates(item);
    yMap.geoObjects.add(mapCircle);
});

But only 1 circle is added - the last one from the array. What's wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2018-11-13
@DeboshiR

You add the same circle several times. And it is necessary to create a separate one for each set of coordinates.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question