Z
Z
zlodiak2019-01-20 14:13:24
JavaScript
zlodiak, 2019-01-20 14:13:24

In what order should the coordinates be specified in setBounds?

I am using yandex maps api 2.1. There are several markers on the map, I would like two markers to be in the user's field of view after initialization. to do this, I take the coordinates of these two markers and pass them to setBounds().
JSFIDDLE
Everything is ok, as expected, two markers appear in the user's field of view.
The problem is that when I change the order of the arguments in setBounds to this:

myMap.setBounds([
        	[55.833436, 37.715175],
        	[55.826479, 37.487208]
        ]);

, then the entire world becomes the viewport. It is not clear to me on what principle it is necessary to build the order of coordinates before feeding them to setBounds ()

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