Google Maps Static Image into PDF Template

Hi,

I’m traying to show a google maps images in a PDF Template.

In Edit mode of the template is showing the picture of the map, but when Generate the PDF show only one small red box.

I add the image with this source: https://maps.googleapis.com/maps/api/staticmap?center=40.714728,-73.998672&zoom=12&size=400x400&maptype=roadmap&key=AIzaSyBu-916DdpKAjTmJNIgngS6HL_kDIKU0aU

but, I need to pass Latitude and Longitude from my module. I tried passing like paremeters, but not work.

https://maps.googleapis.com/maps/api/staticmap?center=$my_module_latitude,$my_module_longitude&zoom=12&size=400x400&maptype=roadmap&key=AIzaSyBu-916DdpKAjTmJNIgngS6HL_kDIKU0aU

Can you help me please?

I’m not sure this is possible, but meanwhile…

If you add a simple image (jpg, png, etc) to the PDF Template, does it also appear as a red cross?

I tried with an image from my suitecrm\Upload and is showing the picture correctly in the PDF.

I tried with an external image from internet and only show the red box. Maybe will be internet conexion on my server?( I’m working in a virtual machine with ubuntu 14)

Can you compare the URL of the two cases, the one that works and the one that doesn’t?

Hi, I found the problem with the maps, my virtual machine don’t create the image because not had access to the internet. After that, the map is loading correctly in the PDF.

this is correct code:

<img style="display: block; margin-left: auto; margin-right: auto;" src="https://maps.googleapis.com/maps/api/staticmap?center=$fs134_relevamiento_latitud,$fs134_relevamiento_longitud&amp;zoom=18&amp;size=700x400&amp;markers=color:red%7Clabel:C%7C$fs134_relevamiento_latitud,$fs134_relevamiento_longitud&amp;key=AIzaSyBu-916DdpKAjTmJNIgngS6HL_kDIKU0aU" alt="" />
1 Like