tags:

views:

650

answers:

2

I need to generate PDF documents server-side that include a map, with markers and the like, but to my knowledge this isn't possible with Google Maps because of JavaScript reliance.

Is there some way to use the Google Maps API for this, or is there some other free (or cheap) alternative with this capability and comparable functionality?

+8  A: 

what you can do is to use google maps static api to generate an image: http://code.google.com/apis/maps/documentation/staticmaps/

and then import that image into pdf.

dusoft
Perfect. I had no idea that API existed. Thanks!
Trevor Bramble
yeah, lots of people don't know about it. it is more or less hidden...
dusoft
+2  A: 

Extension to dusoft's answer. You can load the image with Imagick and

$im = new Imagick("image.jpg");
$im->setImageFormat("pdf");
$im->writeImage("image.pdf");
Ólafur Waage
I'm embedding the image in with other text and graphics. Useful at other times, though (and I do love ImageMagick!)
Trevor Bramble