createPDF/wkhtmltopdf & Google Maps - not displaying markers

Re: [rjbathgate] createPDF/wkhtmltopdf & Google Maps - not displaying markers

By Jason - March 12, 2012

Hi,

You're right. The createPDF plugin has trouble with the markers, probably because they're being create on the client side via javascript. The work around here is to use the google static map api, where you send them the coordinates of a marker, they put it on a map and send you back the image.

For example, you could do something like this:

<img src = "http://maps.googleapis.com/maps/api/staticmap?size=300x300&markers=<?php echo $record['latitude'];?>,<?php echo $record['longitude'];?>&sensor=false" />

This will show up on a PDF. Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] createPDF/wkhtmltopdf & Google Maps - not displaying markers

Cool, thanks, works a treat (although the Google API has a limit to the output img dimensions), but we can live with that :)

Thanks