Mapsgoogle.com/maps
Can you embed Google Maps in an iframe?
Yes. Use the Copy HTML code from Share or embed map. You can also use the Maps Embed API, which needs an API key.
Checked Test again
Live check
What the main page sends
Maps pageEmbeddable
www.google.com/maps- X-Frame-Options
- Not sent
- CSP frame-ancestors
- Not sent
- Response
- 429 Too Many Requests · 424 ms · HTTPS
Embed URLNot checked
www.google.com/maps/embed/v1/place?key={api-key}&q={place}Not checked: needs your own link. Google Maps has no public sample we can load.
Test your linkSteps
How to embed Google Maps
- On your computer, open Google Maps.
- Go to the part of the map that you want to show.
- At the top left, clickMenuthenShare or embed map
- Click Embed a map. Then click Copy HTML.
- Paste the HTML into your page.
Embed code
Paste this into your page
HTML
<iframe
src="https://www.google.com/maps/embed/v1/place?key={api-key}&q={place}"
width="600"
height="450"
style="border: 0"
loading="lazy"
allowfullscreen
referrerpolicy="strict-origin-when-cross-origin"
title="{map title}">
</iframe>This is the Maps Embed API code. It needs an API key. Copy HTML from Share or embed map gives a different embed code.
URL patterns
Swap the link you have for the embed URL
- You havePlace markerUse in the iframe/maps/embed/v1/place?key={api-key}&q={place}
- You haveMap with no markerUse in the iframe/maps/embed/v1/view?key={api-key}¢er={lat},{lng}
- You haveDirectionsUse in the iframe/maps/embed/v1/directions?key={api-key}&origin={a}&destination={b}
- You haveStreet ViewUse in the iframe/maps/embed/v1/streetview?key={api-key}&location={lat},{lng}
- You haveSearch resultsUse in the iframe/maps/embed/v1/search?key={api-key}&q={search}
The Maps Embed API needs an API key from a Google Cloud project. Restrict the key to your site.
Good to know
- You cannot share a map with your saved places or a distance measurement.
- All Maps Embed API requests are free, with no usage limit.
- Embedded maps are not supported below 200 px in width or height.
- The Maps Embed API can show ads on the map.
Sources
- Google Maps Help · Share or embed a mapsupport.google.com/maps/answer/144361
- Maps Embed API · Get starteddevelopers.google.com/maps/documentation/embed/get-started
- Maps Embed API · Embed a mapdevelopers.google.com/maps/documentation/embed/embedding-map
- MDN · X-Frame-Optionsdeveloper.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-Frame-Options
- iframecheck live check · main page
Profile updated