The URLs specified by the Static Maps API generally turn out to be too large for mobile devices to handle.
On average, a mobile device browser can handle 255 character long URLs. For Static Maps, the base minimum required fields are: The preamble: "http://maps.google.com/maps/api/staticmap" (41 characters) The API key: "&key=API_KEY" (86 chars long key, total 91 characters) The center: "¢er=xx.xxxxxx,xx.xxxxxx" (27 chars) The size: "&size=XXXxXXX" (12 chars) The sensor: "&sensor=true" (12 chars) That means, from the get go we use 183 characters, which leaves just 72 characters to play around with. If one adds "format", "zoom", "maptype" and (since we are on mobile devices) "mobile" parameters, the usable amount is just enough to add a single marker, if that. Is there any way that any of these parameters be shortened? Some humble suggestions of mine are: * Most parameters have unique first letters and for the ones that share the same letter ("size" and "sensor", for example) can be differentiated on the second letter ("size" -> "s", "sensor" -> "se"). * Most parameter values can be differentiated similarly, eg. "maptype" values can be "r", "h", "s", "t" giving four-fold compression. * The API key is in an opaque format that I am not privy to the contents of, but I assume some kind of compression/compactification can be applied to that to get back some characters Using the suggestions listed above, even without the API key optimization, I achieve 44 character saving on a typical URL with a single marker. I think this is huge given the limit is 255. Given the use of mobile browsers is on the increase, could some thought be given to implementing such features (even in an optional way)? Sincerely, Ufuk Kayserilioglu
-- 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.
