Google Blogoscoped

Forum

Google Static Maps API  (View post)

Pamela Fox [PersonRank 2]

Friday, February 22, 2008
16 years ago19,345 views

We've clarified in the forum that the query limit is per viewer IP.

Here's an example of loading in multiple markers from a static map with multiple markers (deferred loading of the Maps API until click)
http://gmaps-samples.googlecode.com/svn/trunk/staticmaps/multiplemarkers.html

Enjoy!

callum [PersonRank 2]

16 years ago #

Is there a limit of the number of markers? I can see the potential for some abuse there :) Length of a URL your browser accepts perhaps.?

Haochi [PersonRank 10]

16 years ago #

That's like super late mate, I created something similar (though non-official and possibly against the TOS) like over a year ago.
http://googlified.com.googlepages.com/gmaps.html

Pamela Fox [PersonRank 2]

16 years ago #

Hi Haochi- Yes, other people noticed that service as well and used it, but doing so is against the TOS. Perhaps you'd like to switch your wizard over to using the new API? It's got a much cleaner URL scheme so I think you'll find it easier to use.

Pamela Fox [PersonRank 2]

16 years ago #

Callum – The max number of markers is 50. We would prefer if you did *not* abuse the API, as that could lead to _dire_ consequences. :)

FYI – Make feature requests here:
http://code.google.com/p/gmaps-api-issues/

callum [PersonRank 2]

16 years ago #

Pamela: You mean one can't use it to render additional image layers over a map using one marker per pixel :)

In all seriousness, it might be nice to be able to render a route on a static map via parameters passed in via the URL – I'll check out the groups link you sent and submit a request.

Actually, what would be *really* useful would be able to render a Street View at a lat/long/zoom plus yaw/pitch to a static image via a URL in the same fashion.

Nicolai [PersonRank 1]

16 years ago #

GIF is still more widely supported than PNG, especially on older or smaller devices. If I had to pick one format for a simple image, I would pick GIF.

Roger Browne [PersonRank 10]

16 years ago #

What's the point of requiring an API key when it's in the HTML? What's to stop the API key being copied by everyone else?

Nikolai [PersonRank 1]

16 years ago #

I think, the api-key in googlemaps api is binded on the url where you include the googlemaps. So you can copy it, but you can't use it.

Pamela Fox [PersonRank 2]

16 years ago #

Nikolai is correct -

The API key works the same for the Static Maps API as it is does for the Javascript Maps API. It's checked against the window.location.host of the page that embeds the map/image.

Roger Browne [PersonRank 10]

16 years ago #

I still don't get it. It's a static URL, so you don't need to embed it in another page. And it works without JavaScript, so there's no "window.location.host" to check.

It seems to me that once I publish a map with my API key, then anyone else can use that same API key for their maps.

Pamela Fox [PersonRank 2]

16 years ago #

Sorry for the confusion. In the case of the static maps API, the key check would be performed against the referer URL (if one exists).

Roger Browne [PersonRank 10]

16 years ago #

OK, thanks for the confirmation. I'd figured out by experimentation that it used the referer. Although that doesn't always exist, it's sent often enough that this would prevent anyone usefully abusing my key.

Brent Housen [PersonRank 0]

16 years ago #

For anyone interested, I wrote a wrapper class in PHP so you can use this API easily.

You can find it here: http://code.google.com/p/phpgmapsstaticmap/

Forum home

Advertisement

 
Blog  |  Forum     more >> Archive | Feed | Google's blogs | About
Advertisement

 

This site unofficially covers Google™ and more with some rights reserved. Join our forum!