This tutorial provides the steps to embed responsive maps in Oxygen using Google’s Maps Embed API.

Step 1

Visit the Google maps embed API quickstart page.

Follow the steps listed there to obtain an API key.

Step 2

Enter your desired address or the search term or any other option available under “I want to…” and generate the iframe code.

Paste your API key and press Done to get the iframe code similar to:

<iframe width="600" height="450" style="border:0" loading="lazy" allowfullscreen src=""></iframe>

Step 3

Add a Code Block component in Oxygen builder.

Set its width to 100%.

If you do not want the map to take up the full width of the container, set the max-width to something like 500px.

Paste the iframe code in the PHP & HTML section but without the

width="600" height="450" style="border:0"


Also, wrap the code between

<div class="iframe-container">




<div class="iframe-container"><iframe loading="lazy" allowfullscreen src=""></iframe></div>

Step 4

At Manage > Stylesheets, add the following CSS:

/* Responsive iframes */

:root {
	--aspect-ratio: 16/9;

.iframe-container {
	position: relative;
	width: 100%;
	margin-bottom: 40px;

.iframe-container::before {
	content: "";
	display: block;
	padding-bottom: calc(100% / (var(--aspect-ratio)));

.iframe-container iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 0;


Need help implementing a tutorial in your site or want to hire me for custom work?


Find the article helpful and wish to donate?



You need to be logged in to view and post comments.
Not a member yet? Join here.
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram
%d bloggers like this: