Answer the question
In order to leave comments, you need to log in
How to properly center and zoom the coordinate area on Yandex.Map?
There are several coordinates (the number varies). They need to be displayed on Yandex.Map in such a way that the zoom is maximum, and at the same time all the coordinates lie on the visible part of the map.
What I do: I go over all the coordinates, collect the minima and maxima of both longitude and latitude. It turns out a certain rectangle, all the coordinates of our points will certainly be inside or on the borders of this rectangle. Then I take its center - this will be the center of our map. It's logical and not difficult.
The snag is that setting Zoom manually is not an option. The points may remain in the center and there will be a lot of empty space, or some point will be outside the visibility of our map window.
How to do it right? I can’t find in the docks how and what to pull, but I know that somewhere it is.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question