How to embed Google Maps to Power Pages
Posted on November 10, 2024 (Last modified on November 28, 2024) • 3 min read • 430 wordsAccording to Google there are over 5 million active apps and websites are using Google Maps as it’s a great way to direct end-users to a location. Google maps can be used for showing the office of a company or directions to a place for an event. So let’s look at a couple of ways of embedding Google Maps to Power Pages.
I apologise in advance to Bing Maps enthusiasts 💔
Note
We’re going to keep it more straightforward by not using the Google Maps API however if you need more advanced features including heatmaps, calculating distances, and more use these libraries.
One good point with this option is that you don’t have to consider adding code to make the map responsive as it seems to cope pretty well with different types of devices (phones or tablets).
<div class="responsive-iframe-container">
<iframe
src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d403237.7352856478!2d-119.88076498839624!3d37.85339187540183!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x8096f09df58aecc5%3A0x2d249c2ced8003fe!2sYosemite%20National%20Park!5e0!3m2!1sen!2suk!4v1716237613653!5m2!1sen!2suk"
style="border:0;"
allowfullscreen=""
loading="lazy"
referrerpolicy="no-referrer-when-downgrade"
>
</iframe>
</div>
Add the below CSS to your stylesheet to help to make it responsive.
.responsive-iframe-container {
position: relative;
width: 100%;
height: 0;
padding-bottom: 56.25%; /* 16:9 aspect ratio */
overflow: hidden;
}
.responsive-iframe-container iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: 0;
}
VOILA! we have embedded a Google Map to the footer of a website using code.
😁Thanks for reading, embedding Google Maps Power Pages sites is a great way to improve user experience by providing clear and accessible directions. Whether you choose the straightforward iframe method or a more advanced approach, these techniques will ensure your maps work with Power Pages.
Have a great day!