i have got center of map using map.getCenter(); and i got current zoom of google map using getZoom(); please tell me how can i calculate/get current show mils area in google map. i am using asp.net and javascript.
+1
A:
With GMap2.getBounds()
you can get the visible rectangular region of the map view.
Then using these coordinates you can construct a GPolygon
object and calculate the area in square meters using GPolygon.getArea()
function. Then convert given area to mils (1 meter = 39 370.0787 mils).
Tadas
2010-02-08 12:58:03
and what about Zoom? is (1 meter = 39 370.0787 mils) same for zoom?
Rajesh Rolen- DotNet Developer
2010-02-08 13:28:28
What you mean? map.getZoom() function return current zoom level.
Tadas
2010-02-08 14:34:18
yes map.getZoom() function returns zoom level
Rajesh Rolen- DotNet Developer
2010-02-09 05:11:09
please tell how to do it.. i am not able to implement it... either give me some sample code or refer me to any site
Rajesh Rolen- DotNet Developer
2010-02-11 06:10:22
+1
A:
the GLatLng
object has a distanceFrom
function that takes another GLatLng
. The map has getBounds
from which you'll be able to get the corners of interest, and check the distance between them.
David Hedlund
2010-02-08 13:02:04