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
Unfortunately google maps cannot be exported to PDF.
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.
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;
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With