views:

690

answers:

6
+5  Q: 

Google Maps image?

Hi all,

Is there any way to capture the image of a Google Map? I can't use the static map because I have my own polylines in the map and I want them in the "screenshot".

Basically I want a user to navigate the map, add some polylines, and when he clicks Save I'm saving the lines, coordinates, zoom, but I would also like to have an image to present as a thumbnail in lists.

Tks in advance.

A: 

osgearth is getting google-maps, displaying them..

maybe you can get inspired from osgearth..

ufukgun
+1  A: 

Google doesn't provide this functionality with its API. However, there are a few scripts for scraping this information from the page. The following site has a PHP script that does it:

http://groups.google.co.uk/group/Google-Maps-API/browse_frm/thread/e9696444518ac079?hl=en

See the posts toward the end.

j0rd4n
+1  A: 

You may use ThinkGeo Map Suite. They support rendering images from Google, Yahoo or MS Map services, while you may draw your poly lines, etc on that map...

Working with their Map Suite V3 is a piece of cake

Achilles
Gonna look at it. Tks for the tip.
Dante
A: 

Can't do it with the maps API, as mentioned above, but Yahoo offers one and it is pretty painless to use.

Yahoo: Map Image API

Jason
+4  A: 

Masashi Katsumata has come up with a Snapshot Control that takes a snapshot of a Google Maps with a path on it and creates an image from it.

Matthew Lock
I think this is the "official" solution to the problem.
Kensai
+2  A: 

Using Google Maps Content outside of the Service is a violation of the Google Maps API Terms of Use, so although techniques exist for creating the snapshots, Google doesn't give you permission to do so.

To achieve your intended functionality legally, you either need to use static maps (possibly with reduced content, particularly if the user is using MSIE where the max URL length is quite small) or small real Google Maps.

I don't seem to have privilege yet to add or edit comments to the question, so I'll mention here that the URL limit in at least some Maps compatible versions of MSIE is 2083 characters, not 8k like it is in most other browsers.

Mike Williams
Tks for the alert ;)
Dante