SAP Knowledge Base Article - Public

2768436 - Custom API Keys for Google Maps

Symptom

User activates the Google Maps mashup with a Custom API key, however the maps view still doesn’t show.

Environment

SAP Hybris Cloud for Customer

Reproducing the Issue

  1. Log on to the system.
  2. Navigate to WoC Customer > Accounts > All.
  3. Click 'Enable Map View.

Result: Google Map doesn't show

Error: "Oops! Something went wrong. This page didn't load Google Maps correctly. See the JavaScript console for technical details"

Cause

When enabling map view, Google Maps is throwing a Google Maps JavaScript API error: UnauthorizedURLForClientIdMapError.

The issue here is that the tenant is not authorized to use the custom API key.

Customers can purchase custom APIs as part of a 'Google Maps APIs Premium Plan license'. This API can only be used by a list of restricted URLs that have been specifically authorized. This authorization prevents  a third party from using your client ID on their own website.

Resolution

Tenant / System URL must be authorized by customer.

To see the URLs you have already authorized or to authorize additional URLs:

  1. Log in to your Google Cloud Support Portal.
  2. In the left-hand menu, click Maps: Manage Client ID.
  3. Navigate to section "Registering authorized URLs".

Go through the details provided in the link below to authorize your application to use Google Maps with your Custom API key.

https://developers.google.com/maps/documentation/javascript/get-api-key#registering-authorized-urls

Keywords

custom, API key, Google Maps, authorization , KBA , AP-RC-GEN-MSH , Mashups , Problem

Product

SAP Cloud for Customer add-ins all versions