i know there is the same question like mine but i still don't understand...
i want to make a google map with value in my database there are 3 value in my database: name, lat, and lon.
and i want to get this value and add this into my javascript.
here is my google map script (stil fresh from w3school) :
<script>
var myCenter=new google.maps.LatLng(51,508743,-0,12085);
function initialize()
{
var mapProp = {
center:myCenter,
zoom:5,
mapTypeId:google.maps.MapTypeId.ROADMAP
};
var map=new google.maps.Map(document.getElementById("googleMap"),mapProp);
var marker=new google.maps.Marker({
position:myCenter,
});
marker.setMap(map);
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
i have read this question :Getting database values in Javascript variable dynamically .
but still dont understand how it works, what do i need to add and what do i need to change. please help