Wednesday, June 24, 2015

How to Use Google Map on Web Page

 <head><style>
      #map-canvas {
        width: 500px;
        height: 400px;
background-color: #CCC;
      }
    </style>
<script src="https://maps.googleapis.com/maps/api/js"></script>
<script>
  function initialize() {
  var mapCanvas = document.getElementById('map-canvas');
    var mapOptions = {
      center: new google.maps.LatLng(28.38, 77.12),
      zoom: 8,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    }
    var map = new google.maps.Map(mapCanvas, mapOptions);
  }
  google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
  <body>
  <div id="map-canvas"></div>
  </body>

Source to get Longitude and Latitude Values
http://www.latlong.net/

No comments:

Post a Comment