Answer the question
In order to leave comments, you need to log in
How to display several labels from an array through Yandex Maps API?
This code should display 2 labels in Moscow. Why does it display 1 marker on the coast of Africa???
<script src="https://api-maps.yandex.ru/2.1/?lang=ru_RU" type="text/javascript"></script>
ymaps.ready(function(){
if ($('div').is('#map')) {
var i;
var pl;
var coords = ['55.765326, 37.627735','55.637366, 37.719745'];
var myMap = new ymaps.Map("map", {
center: [55.765326, 37.627735],
zoom: 2,
controls: ['zoomControl']
});
for (i = 0; i < coords.length; ++i) {
pl = new ymaps.Placemark(coords[i]);
myMap.geoObjects.add(pl);
console.log(coords[i]);
}
};
});
Answer the question
In order to leave comments, you need to log in
Here is the answer to your question - https://www.pandoge.com/stati_i_sovety/kak-postavi...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question