Friday, March 2, 2018

How to get coordinates from address through google services

Here is the code

<!DOCTYPE html>
<html>
<body>
<div id="googleMap" style="width:100%;height:800px;"></div>

<script>
function myMap() {
var mapProp= {
    center:new google.maps.LatLng(51.508742,-0.120850),
    zoom:5,
};
var map=new google.maps.Map(document.getElementById("googleMap"),mapProp);

google.maps.event.addListener(map, 'click', function(event) {
alert(event.latLng.lat() + ", " + event.latLng.lng());
});

}
</script>

<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyADIXqFBFbbBy3fs-IRL-LH1ozRN4QhgJM&callback=myMap"></script>
</body>
</html>

No comments:

Post a Comment

Please Comment Here!

How to backup and download Database using PHP

< ?php $mysqlUserName = 'databaseusername' ; $mysqlPassword = 'databasepassword' ; $mysqlHostNa...