Wednesday, 16 September 2015

locate and embed your own place in webpage with details of place

<html>
<head>
<script src="http://maps.googleapis.com/maps/api/js"></script>
<script>
function loadMap() {
   var mapOptions = {
      center:new google.maps.LatLng(26.9509557,93.8586473),
      zoom:5
   }
   var map=new google.maps.Map(document.getElementById("sample"),mapOptions);
   var marker = new google.maps.Marker({
      position: new google.maps.LatLng(26.9509557,93.8586473),
      map: map,
 draggable:true,
      icon:'myicon.png'
   });  
   marker.setMap(map);
   var infowindow = new google.maps.InfoWindow({
   content:"NH-52, North Lakhimpur, Assam, India"
  });
infowindow.open(map,marker);
}
</script>
</head>
<body onload="loadMap()">
<div id="sample" style="height: 400px; width: 580px;">
</div>
</body>
</html>

No comments:

Post a Comment