﻿
    var map = null;
    var geocoder = null;

    function initialize() {
      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map_canvas"));
        map.addMapType(G_PHYSICAL_MAP);	
		map.addControl(new GScaleControl());
		map.addControl(new GMapTypeControl());
		map.addControl(new GLargeMapControl());
		 
        geocoder = new GClientGeocoder();
      }
    }

    function showAddress(address,bili) {
      if (geocoder) {
        geocoder.getLatLng(
          address,
          function(point) {
            if (!point) {
              alert("找不到地点： " + address);
            } else {
              map.setCenter(point, bili);
              var marker = new GMarker(point);
              map.addOverlay(marker);
              marker.openInfoWindowHtml(address);
            }
          }
        );
      }
    }
    
    function china() {
    //设为全国地图 
    map.setCenter(new GLatLng(37, 107), 4);
    }
