Announcement

Collapse
No announcement yet.

PDF helper googleMapsImage not working 6.1.4

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • PDF helper googleMapsImage not working 6.1.4

    Hi,

    I am trying to use the pdf helper googleMapsImage to print a map in my pdf. No map is embedded in the PDF.


    I have google integration setup and it is working elsewhere in my app.

    I have the following API's enabled for my API key:
    Directions API
    Geocoding API
    Maps JavaScript API
    Maps Static API
    Places API

    My PDF template based on account has the following to test this:
    PHP Code:
    Shipping:<br>
    {{
    googleMapsImage field='shippingAddress'}}
    Billing: <br>
    {{
    googleMapsImage field='billingAddress'}}
    Fix loc: <br>
    {{
    googleMapsImage city='New York' country='United States'}} 
    PDF Output:
    PHP Code:
    Shipping:
    Billing:
    Fix loc
    Logs do not contain anything helpful (API key changed for security):
    PHP Code:
    [2021-09-10 04:39:26DEBUGTemplate helper _googleMapsImageURLhttps://maps.googleapis.com/maps/api/staticmap?center=453+Kent+St%2C+Sydney%2C+NSW%2C+A ustraliaformat=jpg;&size=400x400&key=AIzaSyBpV_3m7 z6y1x256fBJS2Etr0000000000&libraries=places&langua ge=en_US. [] []
    [2021-09-10 04:39:27DEBUGTemplate helper _googleMapsImageURLhttps://maps.googleapis.com/maps/api/staticmap?center=64+Castlereagh+St%2C+Sydney%2C+NS W%2C+Australiaformat=jpg;&size=400x400&key=AIzaSyB pV_3m7z6y1x256fBJS2Etr0000000000&libraries=places& language=en_US. [] []
    [2021-09-10 04:39:27DEBUGTemplate helper _googleMapsImageURLhttps://maps.googleapis.com/maps/api/staticmap?center=New+York%2C+United+Statesformat=j pg;&size=400x400&key=AIzaSyBpV_3m7z6y1x256fBJS2Etr 0000000000&libraries=places&language=en_US. [] [] 

    Any help would be appreciated.
    Last edited by Kyle; 09-10-2021, 05:29 AM.

  • #2
    JFI, Google Maps in Espo has nothing to do with Google Integration. It's available out-of-the-box.

    Comment


    • #3
      I remember it was working on 6.1. Make sure google maps are working on UI first.

      Comment


      • #4
        Hi Yuri,
        It is working from the UI. I get the View on Map link below the address and when I click it the modal shows the map correctly.
        Without putting in an API key i get developer mode overprint on the google map.

        Comment


        • #5
          I have just made the same test in the espo demo and it also does not work. There is no google integration setup in the demo but based on the comment above this should not be needed?

          Comment


          • #6
            I have tested this and seems not working on the latest version of espo, the generated URL is correct, I think the problem is in reference to the local stored copy of the image.

            I have not tested older versions.
            CEO of Eblasoft
            EspoCRM Expert since 2014
            Full Stack Web Developer since 2008
            Creator of Numerous Successful Extensions & Projects​

            Comment


            • #7
              Any help with fix will be appreciated.

              Comment


              • #8
                It seems that a temp file is being removed before TCPDF attempts to read it. Using a base64 image in the src attribute does not work either. Might be TCPDF uses a temp file technique too.

                Weird that it used to work a while before.

                Comment


                • #9
                  The fix: https://github.com/espocrm/espocrm/c...fe1e120ac70cd6

                  Comment


                  • #10
                    Thanks Yuri,
                    I have just applied this to 6.1.4 and it works.

                    Comment

                    Working...
                    X