How to use google map in iframe in php?

Google Map



<iframe width="300" height="300" frameborder="0" scrolling="no"
marginheight="0" marginwidth="0"
src="http://maps.google.co.in/maps?hl=en&amp;q= chandigarh+map&amp;ie=UTF8&amp;hq=&amp;hnear=Park+centra+&amp;t=m&amp;z=14&amp;ll= 30.7333? N, 76.7794? E &amp;output=embed"></iframe>



</div>

Output :-


google map using Google Maps Embed API

<?php
$address = "Okhala phase 2 new delhi";
$address = str_replace(" ","+", $address);
?>
<iframe
width="100%"
height="400"
frameborder="0" style="border:0"
src="https://www.google.com/maps/embed/v1/place?key=YOUR_API_KEY
&q=<?= $address ?>">
</iframe>

google map using Google Maps Embed API street view.

<?php
$lat = 46.414382;
$lng = 10.013988;
?>
<iframe
width="100%"
height="400"
frameborder="0" style="border:0"
src="https://www.google.com/maps/embed/v1/streetview
?key=YOUR_API_KEY
&location=<?= $lat ?>,<?= $lng ?>">
</iframe>

How to create your Api key.

First generate API Key from Here

Click on Getkey button. and type your project name . then generate api key . copy and paste above code here.






Previous Next


Trending Tutorials




Review & Rating

0.0 / 5

0 Review

5
(0)

4
(0)

3
(0)

2
(0)

1
(0)

Write Review Here