How to include google map in web application


What is the purpose?

Google Maps provides a route planner under "Get Directions".Up to four modes of transportation are available depending on the area: driving, public transit (see the Google Transit section below), walking, and bicycling. In combination with Google Street View, issues such as parking, turning lanes, and one-way streets can be viewed before traveling. Driving directions are covered as follows:

How to do?
create a html pages like mapDisplay.html
<html>
<head>
<script
src="http://maps.googleapis.com/maps/api/js">
</script>
<script>
var myCenter=new google.maps.LatLng(22.2989532,87.6469777);   //this is the exact location give in your project
function initialize()
{
var mapProp = {
  center:myCenter,
  zoom:18,
  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>
</head>
<body>
<div id="googleMap"  style="width:500px;height:380px;"></div>
</body>
</html>
Second step >
Now run this code in your browser

Output:



Previous
Next Post »

1 comments:

Click here for comments
Unknown
admin
27 April 2016 at 05:01 ×

excellent karthik, i am not aware of this, thanks for the solution on binary tree structure.

Congrats bro Unknown you got PERTAMAX...! hehehehe...
Reply
avatar