Anyone Give me solution on how to put the $location variable to jscript to get the location on Google Map. And what should be the value of location (location name or postal code ) . Here is the code :
<?php
$location=$_GET["clocation"]; //fetched clocation from database in previous page
?>
<div id="map" style="width:100%;height:500px"></div>
<script>
function myMap() {
var myCenter = new google.maps.LatLng(23.6943,90.3444); //Here i want to put my location value to get location on google map
var mapCanvas = document.getElementById("map");
var mapOptions = {center: myCenter, zoom: 7, panControl: true,
zoomControl: true,
mapTypeControl: true,
scaleControl: true,
streetViewControl: true,
overviewMapControl: true,
rotateControl: true };
var map = new google.maps.Map(mapCanvas, mapOptions);
var marker = new google.maps.Marker({position:myCenter});
marker.setMap(map);
}
</script>
<script src="https://maps.googleapis.com/maps/api/js?key=<hidden>&callback=myMap"></script>