views:

45

answers:

2

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
and what about Zoom? is (1 meter = 39 370.0787 mils) same for zoom?
Rajesh Rolen- DotNet Developer
What you mean? map.getZoom() function return current zoom level.
Tadas
yes map.getZoom() function returns zoom level
Rajesh Rolen- DotNet Developer
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
+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