E
E
Emil Rakhmatullin2019-05-24 10:43:04
JavaScript
Emil Rakhmatullin, 2019-05-24 10:43:04

Why is the balloon not showing up?

Map API connection:

<script src="https://api-maps.yandex.ru/2.1/?apikey=fb48e6dc-853a-4e2e-a2cb-9ad45c578df5
  &lang=ru_RU&load=Map,Placemark,map.addon.balloon"></script>

Card code:
ymaps.ready(init);
function init(){ 
  // Создание карты.    
  var myMap = new ymaps.Map("yandex_map", {
      center: [55.670194, 37.254446],
      controls: [],
      zoom: 16
  });

  // Создание метки карты
  var myPlacemark = new ymaps.Placemark([55.670194, 37.254446], {}, {
    iconLayout: 'default#image',
    iconImageHref: '/img/map-marker.png',
    balloonContentHeader: 'Кабинет',
    balloonContentBody: 
      'строка 1</br>' +
      'строка 2,</br>' +
      'строка 3,</br>' +
      'строка 4;',
    iconCaption: 'Кэп',
    iconImageSize: [62, 62],
    iconImageOffset: [-30, -72]
  });

  // Размещение геообъекта на карте.
  myMap.geoObjects.add(myPlacemark);
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2019-05-24
@Emchik

Because the balloon settings are properties, not options - read the documentation .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question