Hello,

Briefly:
I need a way to find out a zoom level of a map without actually
loading the map.
(Given: Lat/Lng bounds and map size in pixels, need zoom level).

Thoroughly (why am I in such situation):
User enters a location name which is geocoded and static google map is
shown. Parameters - lat/lng and LatLonBox (eg. a viewport) from
geocoding service:
http://maps.google.com/maps/geo?q=Zverynas,Vilnius,Lithuania&hl=en
If user sees confirms the place and viewport, he pushes OK, the place
(lat/lon/viewport) is saved. However when I want to open the map with
same location and zoom but other size in pixels, I need to know the
zoom level which was initially shown when user saw the static map.

I see three possible ways to solve it:
# calculate coefficient (function: lat difference, map size -> zoom)
and try to rely on it.
# when I want to show the map, I create a full-blown map with given
initial size, and then resize it to my desired level (zoom remains
constant). However, this is hacky approach and does not work if I want
to show a static but bigger map.
# force user to create a full-blown map instead of static and get the
zoom level, although the real interactive map is not nescesarry at all
(upon event creation, remember?). For now I have chosen this way.

Any suggestions/guidelines how to fix it? Thank you very much.

--

You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-api?hl=.


Reply via email to