Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google maps and pdf

Programaticly, I need to include a google Maps map to automaticly generated pdf files. For this, I need to convert the map into some image format (jpg, png etc). How can it be done ?

I am using Python and Django if build in google maps library is not sufficient.

Thanks

like image 978
Hellnar Avatar asked Apr 15 '10 18:04

Hellnar


People also ask

Can I export Google map as PDF?

Unfortunately google maps cannot be exported to PDF.

How do I create a PDF map?

A map can not only be exported as an image, but also as a PDF file. Use the Save as PDF button. Enter a name and a location and click Save as PDF. The map is now saved as a PDF file.


2 Answers

I think the only way is to import images into the PDF, the images coming from the Google Maps static API.

However, it's going to collide with their T & C:

License Restrictions. Except as expressly permitted under the Terms, or unless you have received prior written authorization from Google (or, as applicable, from the provider of particular Content), Google's licenses above are subject to your adherence to all of the restrictions below. Except as explicitly permitted in Section 7 or the Maps APIs Documentation, you must not (nor may you permit anyone else to):

(yada yada)

10.2 copy, translate, modify, create a derivative work of, or publicly display any Content or any part thereof (for example, the following are prohibited: (a) creating server-side modification of map tiles; and (b) stitching multiple static map images together to display a map that is larger than permitted in the Maps APIs Documentation);

10.8 use the Static Maps API other than in an implementation in a web browser;

like image 98
Pekka Avatar answered Oct 14 '22 22:10

Pekka


You can use the Google Maps Static API to return an image of the map. It's a very easy, REST-like API that doesn't even require a key. Example:

http://maps.google.com/maps/api/staticmap?center=51.477222,0&zoom=14&size=400x400&sensor=false

like image 37
Dan Diplo Avatar answered Oct 14 '22 22:10

Dan Diplo