Understanding the fitBounds Method on Google Maps

I just want to clarify if my way of understanding is the right one. In the Google Maps app, Iā€™d like to show my users markers from specific continents.

Question . Is it correct that the binding in the Google Maps API is an area consisting of NOT MORE AND NOT LESS than two points (markers)?

From math lessons, I just need two points to draw a 2D area. Correctly? Therefore, to show my users all the markers from Europe, I just need to find two coordinates: one from Iceland (top, left), and the second - to let southeast Turkey? (For the United States, I would choose Seattle and Miami).

enter image description here

, JS . : , , , ? ?

var bounds = new google.maps.LatLngBounds();

bounds.extend(new google.maps.LatLng('66.057878', '-22.579047')); // Iceland
bounds.extend(new google.maps.LatLng('37.961952', '43.878878')); // Turkey

this.map.fitBounds(bounds);
+4
2

" " " ", - - ( , ), , / bounds.

documentation getNorthEast getSouthWest.

LatLng, . , LatLng.

, "". , , , "", ...

+1

Source: https://habr.com/ru/post/1612548/


All Articles