如 http://hotels.ctrip.com/hotel/57694.html  传个酒店名称 显示酒店所在的周边地图     最好有实例代码贴

解决方案 »

  1.   

    http://tianjin.fantong.com/cate/700000926/
    看看这个代码拿来就能用
    哦这个是51地图的
    google的需要有个注册一个api的key
    然后下载一个js代码Google上提供
    我给你一个,key自己注册
    其中城市,和地址动态添加的 <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.917, 116.397), 13);
            geocoder = new GClientGeocoder();
        }}function myClick(address)
    {
        // Place a er in the center of the map and open the info window
        // automatically
        var er = new GMarker(map.getCenter());
        GEvent.addListener(er, "click", function()
        {
            //er.openInfoWindowTabsHtml(address);
            er.openInfoWindowHtml(address);
        });
        map.addOverlay(er);
    }    function showAddress(address) {
          if (geocoder) {
              geocoder.getLatLng(
              address,
              function(point)
              {
                  if (!point)
                  {
                      //alert("不能解析: " + address);
                      return false;
                  }
                  else
                  {
                      map.setCenter(point, 13);
                      var er = new GMarker(point);
                      map.addOverlay(er);
                      //er.openInfoWindowHtml(address);
                      myClick(address);
                      return true;
                  }
              }
            );
          }
      }
      function getmap()
      {
          if (!showAddress('<%=address %>'))
              showAddress('<%=city %>');
          //return false;
      }
        </script>
      

  2.   

    请查阅
    http://code.google.com/intl/zh-CN/apis/maps/
      

  3.   

    对头他们是有提供专门的API的
      

  4.   

    调用Google Maps API
    http://www.cnblogs.com/zbqy/articles/852703.html
    http://www.cnblogs.com/liangqihui/archive/2008/02/15/1069733.html
      

  5.   

    【SD2C谷歌技术专场】刘黎:十行内代码嵌入Google地图
    http://news.csdn.net/n/20081207/121545.html