G
G
garyk52016-11-14 15:12:22
HTML
garyk5, 2016-11-14 15:12:22

How to correctly insert a label into a Yandex map?

Hello. Something can not be inserted in any way: 1) Placemark (label) and 2) Zoom-control on the map. The label does not want to be displayed. Point me in the right direction please
Here is the code snippet:

// Include yandex map
   var myMap;
    if ($('#YMapsID').length) {
        ymaps.ready(function () {
            myMap = new ymaps.Map("YMapsID", {
                center: [55.724079, 37.62828],
                zoom: 16
                
            });
        });
    }

Last try:
// Include yandex map
   var myMap;
    if ($('#YMapsID').length) {
        ymaps.ready(function () {
            myMap = new ymaps.Map("YMapsID", {
                center: [55.724079, 37.62828],
                zoom: 16
             });
           myPlacemark = new ymaps.Placemark([55.72276687, 37.62750033], {
           content: 'Москва!', 
          balloonContent: 'ул. ХХХХХ д.ХХ к. ХХ' 
          });
    myMap.geoObjects.add(myPlacemark);
        });
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WQP, 2016-11-14
@WQP

https://tech.yandex.ru/maps/jsbox/2.1/placemark

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question