You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I used the RasterMap one, I got 5 points on the map, i find the center by calculating the average LatLng thought it is rightly centered but the zoom is not optimal. thanks.
To get the zoom level, you'll need to know the pixel dimensions of your map. You'll also need to do your math in spherical mercator coordinates.
Convert latitude, longitude to spherical mercator x, y.
Get distance between your two points in spherical mercator.
The equator is about 40m meters long projected and tiles are 256 pixels wide, so the pixel length of that map at a given zoom level is about 256 * distance/40000000 * 2^zoom. Try zoom=0, zoom=1, zoom=2 until the distance is too long for the pixel dimensions of your map.
How do I find what should I set as the center and as the zoom level so that all the points show up.
The text was updated successfully, but these errors were encountered: