By rjbathgate - March 9, 2012

Hi,

We have createPDF plugin (1.02) running perfectly fine, apart from when there is a Google Map on the page to be created as a PDF.

The PDF rendered displays the map fine, but any marker on the map (i.e. a red arrow position marker) is not displayed on the outputted PDF.

Before the createPDF function, I use:
$GLOBALS['CREATEPDF_CUSTOM_SWITCHES'] = '--redirect-delay 5000';

which allows time for the map to load fully (without it, the map may only be half loaded/displayed). Increasing this load time doesn't help.

Has anyone else come across this problem? Or, has anyone else got the createPDF plugin working with Map Pointers/Markers?

Thanks

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/