how can i pass the value of $lat and $long
in the while loop going to the script for googlemap..
kindly see the code below;
while($row = mysqli_fetch_array($query)){
$station = $row['STATION'];
$pei = $row['PEIS'];
$pga= $row['PGA'];
$pgv= $row['PGV'];
$lat = $row['LAT'];
$lon = $row['LON'];
}
<script>
function initMap() {
var myLatLng = {lat: latitude_here, lng: longitude_here};
var map = new google.maps.Map(document.getElementById('map'),
{
zoom: 4,
center: myLatLng
});
var marker = new google.maps.Marker({
position: myLatLng,
map: map,
title: 'Hello World!'
});
}
</script>