Problem retrieving data from cross domain html into iframe via PHP CURL

I have created a map using My Maps from Google and currently embedding it on my site using an IFRAME.

I would like to style certain elements on the google map, which is fine, I have found a way to do that but this is where the problem comes in.

The map is “re-built” in an external php file using a CURL request and then loaded into the IFRAME. It loads fine, but I get the following error:

This page was unable to display a Google Maps element. This URL is not authorized to use the provided Google Maps Client ID. Error Code: UnauthorizedURLForClientIdMapError

Does this mean I need to somehow autorise the IFRAME?

Any help and tips would be appreciated.

When you setup the Maps API, you are asked which domains will be serving the map. Is the URL the map is being served from (the domain of the PHP file) different than the one you originally specified during setup?

Hello, and thank you for your reply!

Perhaps I am following the wrong route here:

  • I logged into my Google account
  • Went to Maps
  • Selected “My Maps” from the menu on the left
  • Then created a new map from there

I was not asked to set up any API.