Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
1. First, convert addresses to coordinates with a script:
api.yandex.ru/maps/doc/geocoder/desc/examples/geoc...
2. Display with a simple code:
var myMap;
ymaps.ready(init);
function init () {
myMap = new ymaps.Map('map', {
center:[55.76, 37.64],
zoom:10
});
// Эта строка запрещает передвигать карту
myMap.behaviors.disable(['drag', 'rightMouseButtonMagnifier']);
var coords = [
[55.76, 37.64], // Москва
[56.31, 43.98], // Нижний Новгород
[54.28, 48.24], // Ульяновск
[52.30, 104.28], // Иркутск
[62.02, 129.73], // Якутск
[64.72, 177.49], // Анадырь
],
myCollection = new ymaps.GeoObjectCollection({}, {
iconImageHref: 'http://ваша_иконка',
iconImageSize: [16, 16],
iconImageOffset: [-8, -8]
});
for (var i = 0; i < coords.length; i++) {
myCollection.add(new ymaps.Placemark(coords[i]));
}
myMap.geoObjects.add(myCollection);
myMap.setBounds(myMap.geoObjects.getBounds());
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question