H
H
Hazrat Hajikerimov2014-12-13 21:26:59
JavaScript
Hazrat Hajikerimov, 2014-12-13 21:26:59

Centralization of Yandex.maps on a marker when clicking on it?

download?id=9WkLUBBEi6NDdCkblwTBYTmsttkL
There are several markers on the map, each in a different corner, and for the convenience of displaying, it is necessary to centralize the Yandex map on the selected marker, how can this be done?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Rikcon, 2014-12-13
@Rikcon

https://tech.yandex.ru/maps/doc/jsapi/2.0/ref/refe...
You need the SetCenter method, you can pass the coordinates of the clicked label (in the onclick of the label) to it, and in addition, you can even zoom.

S
Sergey Novikov, 2014-12-13
@BOOMER_74

Just center the map by clicking on the marker by its position:

placemark.events.add("click", function () {
    map.setCenter(_lat_, _lng_)], _zoom_);
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question