P
P
Peter2014-03-31 13:47:18
Yandex maps
Peter, 2014-03-31 13:47:18

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);         
    }

For the first time I work with Yandex.maps, I will be extremely grateful for your help!
Thank you.

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
E
enchikiben, 2014-03-31
@Alcospb

api.yandex.ru/maps/jsbox/balloon_and_hint

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question