Dark and light host pages
The map on a dark section and on a light one.
Live map
colorScheme=dark on a dark sectionOpen this map on its owncolorScheme=light on a light sectionOpen this map on its ownCode
<section class="dark-section">
<div class="map-wrap">
<iframe
src="https://maps.siemens-cdn.com/maps/embed/v1/place?q=48.14428,11.57501&zoom=15&colorScheme=dark"
title="Munich headquarters on a dark section"
width="600"
height="450"
style="border:0"
loading="lazy"
allowfullscreen
referrerpolicy="no-referrer-when-downgrade"></iframe>
</div>
</section>
.dark-section {
background: #000028;
color: #fff;
padding: 2rem;
}
.map-wrap {
border-radius: 8px;
overflow: hidden; /* clips the iframe to the radius */
box-shadow: 0 0 0 1px rgb(255 255 255 / 20%);
}
.map-wrap iframe {
display: block;
width: 100%;
height: 360px;
border: 0;
}
Every map follows the visitor’s light or dark setting by default (colorScheme=auto). On these pages it follows the docs theme switch too.
Parameters
| Name | Required | Values | Notes |
|---|---|---|---|
colorScheme | no | auto, light, dark | Not in Google’s embed. auto (default) follows the visitor’s light or dark setting and switches live; light and dark fix it, for example to match your section. |
Every parameter: embed URL reference.
Migrating from Google
Only the src line changes: the host becomes https://maps.siemens-cdn.com and key goes. Every other attribute and parameter stays identical. Then swap www.google.com for https://maps.siemens-cdn.com in your page’s frame-src, in the enforced and in the report-only policy. Full migration guide.
<iframeRemoved: - src="https://www.google.com/maps/embed/v1/place?key=API_KEY&q=48.14428,11.57501&zoom=15"Added: + src="https://maps.siemens-cdn.com/maps/embed/v1/place?q=48.14428,11.57501&zoom=15&colorScheme=dark" title="Munich headquarters on a dark section" width="600" height="450" style="border:0" loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade"></iframe>
<iframeRemoved: - src="https://www.google.com/maps/embed/v1/place?key=API_KEY&q=48.14428,11.57501&zoom=15"Added: + src="https://maps.siemens-cdn.com/maps/embed/v1/place?q=48.14428,11.57501&zoom=15&colorScheme=light" title="Munich headquarters on a light section" width="600" height="450" style="border:0" loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade"></iframe>
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
Notes
- By default the map follows the visitor’s light or dark setting. A section that is always dark or always light can fix the scheme with
colorScheme=darkorcolorScheme=light, so map and section match. See Map styles for all styles. - A rounded corner needs
overflow: hiddenon a wrapper, because an iframe’s content is not clipped by its own radius in every browser.