The problem is not as straightforward as you might like...in the northern and southern extremes, the map is extremely stretched horizontally. At any given *point* on the map, you could calculate this value, but at any given zoom level, there will be a whole range of valid pixel-to-meter sizes. You could calculate the average of the range from over the south-north extent of the map, but this may give odd results at times.
For instance, just offset from the north pole (granted, google's imagery doesn't extend this far) 1 meter would be the entire width of the map. At the north pole itself (i.e. 90 N) a pixel has a width of 0 meters (yes, zero.) That number would be the same for ALL zoom levels. So if you are zoomed all the way out, such that you can see the entire world, which is correct? The meter-width of a pixel at the equator, the meter-width of a pixel at the pole, or some arbitrary value in between? :) -G On Aug 13, 2009, at 11:47 AM, Patrice wrote: > > Hi everybody ! > > I'm French so sorry for my English mistakes. > > I can't find the solution to my problem anywhere ! You all know that > we can set the width of a polyline thanks to the option "weight". But > the value has to be in pixels. > > I would like to know how I can do to set the width of my polyline to x > meters (x=20 for instance). In other words, how do you convert meters > to pixels, according to the zoom level ? > > Thank you for your help ! > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
