<script src="http://ditu.google.cn/maps?file=api&amp;v=2&amp;key=ABQIAAAAFdUKFVuLyGlw8qKw1cVf_RTMjetJEhrR1R1RvCXjRPxALNPQwRTHOwBUUq3bsuOeLc1M7JjWKjuIBA&sensor=false&hl=zh-CN" type="text/javascript"></script>
   <script type="text/javascript">

 

    function initialize() {

      if (GBrowserIsCompatible()) {

        var map = new GMap2(document.getElementById("map_canvas"));

        map.setCenter(new GLatLng(39.917, 116.397), 14);

       

        map.addControl(new GSmallZoomControl());

        // Add a marker to the map at the location

        var bounds = map.getBounds();

        var southWest = bounds.getSouthWest();

        var northEast = bounds.getNorthEast();

        var lngSpan = northEast.lng() - southWest.lng();

        var latSpan = northEast.lat() - southWest.lat();

        var point = new GLatLng(39.917, 116.397);

        map.addOverlay(new GMarker(point));

      }

    }

    </script>

  <body onload="initialize()" onunload="GUnload()">

    <div id="map_canvas" style="width: 500px; height: 300px"></div>

  </body>

 

编程经验:Google Maps JavaScript API Example_qt