Google Map in the website Php

 

<script src='https://maps.googleapis.com/maps/api/js?v=3.exp&key=AIzaSyARsicwTqMqTIWvMlIOKISAqvT1jPAZHY0'></script>

<div style='overflow:hidden;height:400px;width:520px;'>
    <div id='gmap_canvas' style='height:400px;width:520px;'></div>    
    <style>#gmap_canvas img{max-width:none!important;background:none!important}</style>
</div> 


</script>

<script type='text/javascript'>
function init_map(){
    var myOptions = { 
        zoom:12,
        center:new google.maps.LatLng(22.5892,88.31029999999998),
        mapTypeId: google.maps.MapTypeId.ROADMAP
    };
    map = new google.maps.Map(document.getElementById('gmap_canvas'), myOptions);
    marker = new google.maps.Marker({
        map: map,
        position: new google.maps.LatLng(22.5892,88.31029999999998)
    });
    infowindow = new google.maps.InfoWindow({
        content:'<strong></strong><br><br> Howrah<br>'
    });
    google.maps.event.addListener(marker, 'click', function() 
    {
        infowindow.open(map,marker);
    });
   infowindow.open(map,marker);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         }

google.maps.event.addDomListener(window, 'load', init_map);

</script>

Google map using api call

## GOOGLE MAPS <div id=”googleMap” style=”width:100%;height:400px;”></div> <script> function myMap() { var mapProp= { center:new google.maps.LatLng(), zoom:5, }; console.log(mapProp); var map=new google.maps.Map(document.getElementById(“googleMap”),mapProp); } </script> <script src=”https://maps.googleapis.com/maps/api/js?key=AIzaSyC7wZjgMOL3iVAScAzoMhRHzdju7T8wceQ&callback=myMap“></script>

How to show location in Google maps

$location = “kolkata”; <div style=”width: 100%”> <iframe width=”100%” height=”480″ frameborder=”0″ scrolling=”no” marginheight=”0″ marginwidth=”0″ src=”https://maps.google.it/maps?q=<?php echo $location;?>&output=embed”></iframe> </div>