Migrate from the Google Maps Embed API

Two changes: the iframe src (host swapped, key removed) and the frame-src of your page CSP. Mode, parameters and every other attribute stay identical. Each block below is the exact code before and after; “Copy new” copies the complete new version.

1. The iframe

https://www.google.com/maps/embed/v1/<mode>?key=API_KEY&… becomes https://maps.siemens-cdn.com/maps/embed/v1/<mode>?….

place by coordinates

place mode, before and after
  <iframeRemoved: -   src="https://www.google.com/maps/embed/v1/place?key=API_KEY&q=28.50968,77.08316&zoom=15"Added: +   src="https://maps.siemens-cdn.com/maps/embed/v1/place?q=28.50968,77.08316&zoom=15"    title="Partner location map"    width="600"    height="450"    style="border:0"    loading="lazy"    allowfullscreen    referrerpolicy="no-referrer-when-downgrade"></iframe>

place by address

place mode, before and after
  <iframeRemoved: -   src="https://www.google.com/maps/embed/v1/place?key=API_KEY&q=Reesbergstr.%201,%2036039%20Fulda,%20Germany"Added: +   src="https://maps.siemens-cdn.com/maps/embed/v1/place?q=Reesbergstr.%201,%2036039%20Fulda,%20Germany"    title="Partner location map"    width="600"    height="450"    style="border:0"    loading="lazy"    allowfullscreen    referrerpolicy="no-referrer-when-downgrade"></iframe>

view

view mode, before and after
  <iframeRemoved: -   src="https://www.google.com/maps/embed/v1/view?key=API_KEY&center=48.14428,11.57501&zoom=13&maptype=roadmap"Added: +   src="https://maps.siemens-cdn.com/maps/embed/v1/view?center=48.14428,11.57501&zoom=13&maptype=roadmap"    title="Map of central Munich"    width="600"    height="450"    style="border:0"    loading="lazy"    allowfullscreen    referrerpolicy="no-referrer-when-downgrade"></iframe>

search

search mode, before and after
  <iframeRemoved: -   src="https://www.google.com/maps/embed/v1/search?key=API_KEY&q=Siemens%20Campus%20Erlangen&language=de"Added: +   src="https://maps.siemens-cdn.com/maps/embed/v1/search?q=Siemens%20Campus%20Erlangen&language=de"    title="Siemens Campus Erlangen"    width="600"    height="450"    style="border:0"    loading="lazy"    allowfullscreen    referrerpolicy="no-referrer-when-downgrade"></iframe>

The key: there is no API key. A leftover key is accepted and ignored, so a page you have not updated yet keeps working, but remove it from code and config. Restrict or delete the Google key in the Google Cloud console once no page uses it.

2. Your page’s Content-Security-Policy

Swap the host in frame-src, in the enforced Content-Security-Policy and, if your site sends one, in Content-Security-Policy-Report-Only too. A report-only policy without our host does not block the map today, but it reports every load (“[Report Only] Refused to load https://maps.siemens-cdn.com/… because it does not appear in the frame-src directive”) and blocks it the day it is enforced. Remove www.google.com from both once no page uses the Google map. Nothing else changes: tiles, fonts and the geocoder load inside the iframe, from the map’s own host.

Response headers
Removed: - Content-Security-Policy: default-src 'self'; frame-src 'self' https://www.google.comRemoved: - Content-Security-Policy-Report-Only: default-src 'self'; frame-src 'self' https://www.google.comAdded: + Content-Security-Policy: default-src 'self'; frame-src 'self' https://maps.siemens-cdn.comAdded: + Content-Security-Policy-Report-Only: default-src 'self'; frame-src 'self' https://maps.siemens-cdn.com

Siemens teams: see the internal documentation.

3. Components that build the URL

A component that builds the Google URL in code keeps its query logic: coordinates when a record has them, the address otherwise. Only the base URL changes and the key goes. The JSX of the iframe does not change. Live example.

Partner component
  mapQuery = ({ address, latitude, longitude }) =>    latitude != null && longitude != null ? `${latitude},${longitude}` : address || null;  mapSrc = (partner) => {    const q = mapQuery(partner);Removed: -   return q ? `https://www.google.com/maps/embed/v1/place?key=${GOOGLE_MAPS_API_KEY}&q=${encodeURIComponent(q)}` : null;Added: +   return q ? `https://maps.siemens-cdn.com/maps/embed/v1/place?q=${encodeURIComponent(q)}` : null;  };
  • What can go: the map sends no visitor data to Google or any other map vendor; page, tiles, fonts and the geocoder are served from Siemens infrastructure, and only a partner’s address text is ever sent to Amazon Location, once. A consent gate or click-to-load placeholder that exists only because of Google Maps is not needed for this iframe. Once no page uses Google Maps, remove it from your consent manager’s service list and your privacy notice, in agreement with your data privacy contact.
  • Links that leave Siemens: the place card’s “Route” menu (Apple Maps, Google Maps, OpenStreetMap) and “Open map” are plain links. The provider sees the visitor only after a click, like any external link.
  • What must stay: the map data is OpenStreetMap under the ODbL, which requires the visible credit “© OpenStreetMap contributors”. The map shows it in its bottom-right corner, together with Protomaps. Do not cover, crop or hide it: no overlay on that corner, no iframe smaller than about 250 px in height, no CSS that clips the frame. See licenses and attribution.

5. Where the map can be embedded

The map answers with a frame-ancestors policy: browsers show it only inside pages on siemens.com and *.siemens.com, in Siemens apps on *.siemens.zone, and on localhost for development. On any other site the frame stays blank. Siemens teams: see the internal documentation.

Test locally: run your site on http://localhost:<port> or http://127.0.0.1:<port> (https works too, any port) with the new frame-src in its CSP and open the page. A file opened from disk (file://), [::1], a LAN IP or a tunnel host is not allowed: the frame stays empty and the browser console names the frame-ancestors directive. To look at a map on its own, open its URL directly in the browser: a top-level page is not affected by frame-ancestors.

6. Check what you use

Look up every parameter in the compatibility table. Street View is not available; directions are partial.

7. Try it on a live page first

Before any code changes, preview the map on your live page: a console snippet or bookmarklet swaps the page’s Google map for ours in place, in your browser only.