Skip to Content

Image with address from google maps api isn't visible

Hi guys!

I developed an application in SAPUI5 in Eclipse and run it via a Tomcat Server. I have the problem that one image is visible and the others are not - there's only a placeholder where the maps picture should be and if I click on it with the right mouse button and select "Copy address of picture" (don't use Firefox, just Opera or Chrome) from the context menu and paste it into the address bar of the browser the correct web address and data is shown, e.g. https://maps.googleapis.com/maps/api/staticmap?zoom=15&size=640x400&markers=23751%20N.%2023rd%20Ave.%2c%2085085%20Phoeni…:

1) The SupplierInfo.fragment.xml which is embed into Object.view.xml implements a panel with the image:

<Panel class="sapUiResponsiveMargin sapUiHideOnPhone" width="auto" headerText="{i18n>mapTitle}"> <Image src="{ parts: [ 'ToSupplier/Address/Street', 'ToSupplier/Address/PostalCode', 'ToSupplier/Address/City', 'ToSupplier/Address/Country' ], formatter: '.formatter.formatMapUrl'}" />

</Panel>

2) The formatter.js calculates the valid web address (Google Maps API):

formatMapUrl: function(sStreet, sZIP, sCity, sCountry) {
return "https://maps.googleapis.com/maps/api/staticmap?zoom=15&size=640x400&markers=" + jQuery.sap.encodeURL(sStreet + ", " + sZIP + " " + sCity + ", " + sCountry);

}

What is wrong with my source code? If I duplicate, adapt and execute the application via SAP Web IDE everything's fine so I don't really believe in limitiations by Google.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Jul 25, 2016 at 04:45 PM

    If you are not using your own API key (ie. using "public" URL without key), then it might be throttling you (ie. too many "pings" from one source...you....too quick) so it is not showing the image.

    What are the Chrome dev tools showing you as well?

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.