M
M
Maxim2013-06-24 23:01:26
Yandex
Maxim, 2013-06-24 23:01:26

How to open an existing balloon in Yandex maps?

Hello everyone
, I create a map with balloons in this way:

<script type="text/javascript">
var myMap;

ymaps.ready(init);

function init () {
    myMap = new ymaps.Map('map', {
        center:[68.963254,33.077918],
        zoom:10
    });
    myMap.controls.add('zoomControl');

  var myPlacemark = new ymaps.Placemark([{catalog_map}{latitude},{longitude}{/catalog_map}], {
    balloonContent: 'some content'
  });
  myMap.geoObjects.add(myPlacemark);

  var myPlacemark = new ymaps.Placemark([{catalog_map}{latitude},{longitude}{/catalog_map}], {
    balloonContent: 'some content'
  });
  myMap.geoObjects.add(myPlacemark);

  var myPlacemark = new ymaps.Placemark([{catalog_map}{latitude},{longitude}{/catalog_map}], {
    balloonContent: 'some content'
  });
  myMap.geoObjects.add(myPlacemark);

}
</script>
<div id="map" style="width:100%;height:1095px"></div>

How can I open the balloon I need from the outside?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nazar Mokrinsky, 2013-06-25
@websecret_by

In fact, the balloon can be opened like this:

myPlacemark.balloon.open();

At the expense of the outside - come up with yourself. For example something like this:
function init () {
    var placemarks = [];
    ..
    placemarks[id] = myPlacemark;
    window.open_balloon(id) {
        placemarks[id].balloon.open();
    }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question