Answer the question
In order to leave comments, you need to log in
Yandex maps: how to correctly display a balloon with information?
Hi
I want to display a large number of objects on Yandex.map.
I coped with the withdrawal of pins. I don’t understand how to make the balloon expand when clicking on a pin with information about an object?
The question consists of two parts:
1. How to transfer information with coordinates and information to the balloon?
At the moment it looks like [[x, y], [x1,y1,],[x2,y2]...]
2. How to upgrade the code for this task? At the moment, according to the documentation, the js code looks like this:
ymaps.ready(init);
var myMap;
function init(){
myMap = new ymaps.Map ("map", {
center: [59.931554, 30.316818],
zoom: 10
});
myCollection = new ymaps.GeoObjectCollection({}, {
preset: 'twirl#redIcon', //все метки красные
draggable: true // и их можно перемещать
});
for (var i = 0; i < coords.length; i++) {
myCollection.add(new ymaps.Placemark(coords[i]));
}
myMap.geoObjects.add(myCollection);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question