Ok! Is there a way to calculate the "choosen" zoom? What I need is
simple : I have some coordinates and I want to get a map by GoogleMap
Static API to draw some tracks on it. You explain me that it's
impossible to get "exactly" a map with center and span parameters
because of the fact that the zoom level is a integer. So, a way to
resolve it is to get back the coordinates of corners of the map I get
back. Probably if I can calculate the zoom choosen by GoogleMap I will
be able to determine the corner coordinates of the map.

Have you any idea about this?

On 23 juin, 11:31, Mike Williams <[email protected]> wrote:
> That'll be because the zoom level can only be an integer. An increase of
> one zoom level doubles the scale. Using "span" gets you the zoom level
> at which the span is contained within the viewport.
>
> What you'd have to do is determine the pixel coordinates of the two
> corners and subtract one from the other. In your static map request, ask
> for an image size that matches that size. If necessary you can scale the
> image with width and height attributes back to the image size you want,
> but if might look a little bit pixellated.
>
> Determining the pixel coordinates can be done with the Maps API, using
>   map.fromLatLngToContainerPixel(latlng)
> or
>   maptype.fromLatLngToPixel(latlng,zoom)
>
> Or you could performs the calculations in your server. Conversion code
> has been posted in this group for a few server side languages.
>
> --
> Mike Williamshttp://econym.org.uk/gmap
--~--~---------~--~----~------------~-------~--~----~
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=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to