<!DOCTYPE html "-//W3C//DTD XHTML 1.0 Strict//EN"    "<html xmlns="<head>
          <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
          <title>Google Maps JavaScript API Example</title>
          <script src="

          </head>
          <body onload="window.setTimeout('initialize()',1200)" onunload="GUnload()">
          <div id="map_canvas" style="width: 500px; height: 300px"></div>
          <script type="text/javascript">   
          var map = null;
          var geocoder = null;
           
          function initialize() {     
           if (GBrowserIsCompatible()) {     
            map = new GMap2(document.getElementById("map_canvas"));
              
           map.setCenter(new GLatLng(39.9493, 116.3975), 13);
             
            // map.setCenter(new GLatLng(39.9410345535317, 116.31178379058838),14);
           geocoder = new GClientGeocoder();
           alert(geocoder);
            showAddress("北京市海淀區紫竹院路62號院賽迪大廈1號樓10層2101室");  
           }    
          }   

            function showAddress(address) {
            if (geocoder) {
            geocoder.getLatLng(
            address,
            function(point) {
            if (!point) {
            alert("不能解析: " + address);
            } else {
            map.setCenter(point, 17);
          //map.openInfoWindow(map.getCenter(),document.createTextNode("Hello, world"));
            var marker = new GMarker(point);
           map.addOverlay(marker);
          marker.openInfoWindowHtml(address);
            }
            }
            );
            }
            }

           </script>
          </body>
          </html>


          只有注冊用戶登錄后才能發表評論。


          網站導航:
          博客園   IT新聞   Chat2DB   C++博客   博問  
           

          常用鏈接

          留言簿(5)

          隨筆分類

          隨筆檔案

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 平遥县| 台中县| 什邡市| 都昌县| 清远市| 惠州市| 米易县| 始兴县| 孟津县| 千阳县| 方山县| 永胜县| 长乐市| 澄城县| 广灵县| 利辛县| 措勤县| 阳春市| 搜索| 曲阳县| 吴江市| 博兴县| 富锦市| 黎川县| 临西县| 紫云| 青川县| 磐安县| 离岛区| 崇义县| 海晏县| 洛隆县| 南漳县| 新闻| 青州市| 东光县| 西峡县| 侯马市| 泰宁县| 安陆市| 石城县|