K
K
KArtem2014-03-05 14:24:52
Google
KArtem, 2014-03-05 14:24:52

How to mark a lot of addresses on one map?

I have 51 thousand addresses (country, city, street, house number), and they all need to be marked on one map (Google or Yandex).
What is the best way to do this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ilya, 2014-03-05
@Gorily

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());
    };

You can use geocoding directly, but Yandex itself does not recommend doing this - for a long time. Well and a clustering at will to include.

T
top13, 2014-03-06
@top13

Entertaining web cartography...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question