F
F
freeman02042016-07-06 11:12:36
HTML
freeman0204, 2016-07-06 11:12:36

How to insert 2 Yandex cards on the site so that they are different?

I inserted 2 cards with different addresses, but the same addresses are displayed on the site. Why? How to make 2 different addresses?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Aleksandr, 2016-07-06
@freeman0204

ymaps.ready(init);

function init() {
    var kalug = [55.888786, 37.632664]; // координаты точки 1
    var altuf = [55.659074, 37.522773]; // координаты точки 2
    var myMap1 = new ymaps.Map('contact__map1', {
        center: kalug,
        zoom: 14
    });
    var myMap2 = new ymaps.Map('contact__map2', {
        center: altuf,
        zoom: 14
    });
    var myPlacemark1 = new ymaps.Placemark(kalug, {
        
    }, {
        preset: 'twirl#redIcon'
    });
    var myPlacemark2 = new ymaps.Placemark(altuf, {
        
    }, {
        preset: 'twirl#redIcon'
    });
    myMap1.geoObjects.add(myPlacemark1);
    myMap2.geoObjects.add(myPlacemark2);
}

<div id="contact__map1"></div>
<div id="contact__map2"></div>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question