W
W
webymax2019-11-15 13:39:59
Yandex maps
webymax, 2019-11-15 13:39:59

How to keep the Yandex map center offset during a smooth transition to new coordinates?

I deliberately shift the center of the Yandex map to the left by 150px: Then I make a smooth movement to the new geographical coordinates on the map using:
map.setGlobalPixelCenter([x - 150, y]);

map.panTo(coords).than(function() {
    map.setZoom(16, {duration: 1000});
};

How to take into account the old pixel offset of the map center in new geographical coordinates, taking into account the new zoom?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question