Friday, 30 December 2011

How to add Google Map on your page?

 Hi Guys!

Plesae put following lines on your page to add google map:

<!DOCTYPE html>
    <title>Google Maps JavaScript API v3 Example: Map Simple</title>
    <meta name="viewport"
        content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta charset="UTF-8">
    <style type="text/css">
      html, body, #map_canvas {
        margin: 0;
        padding: 0;
    width: 400px;
        height: 400px;
    <script type="text/javascript"

    <script type="text/javascript">
      var map;
      function initialize() {
        var myOptions = {
          zoom: 18,
          center: new google.maps.LatLng(-34.397, 150.644),
          mapTypeId: google.maps.MapTypeId.TERRAIN
        map = new google.maps.Map(document.getElementById('map_canvas'),

      google.maps.event.addDomListener(window, 'load', initialize);
    <div id="map_canvas"></div>


1 comment: