把那个设置时间的去掉试试或者。直接参考 百度api示例源码
http://developer.baidu.com/map/jsdemo.htm#i4_1

解决方案 »

  1.   

    这个设置时间的是反应速度。比如我输入 比较详细的街道信息。天目山路1号到天目山路181号。地图上就没有显示了。时间去掉也是这个效果。~~~~(>_<)~~~~ 
      

  2.   

    Quote: 引用 2 楼 huanglin02 的回复:

    时间去掉也是这个效果。~~/quote] 那你去看官方api示例吧。
      

  3.   


    界面上点击查看,把起始点传入 那个界面。<a href="javascript:void(0);" onclick="doLocation('<s:property value="START"/>','<s:property value="FINISH"/>');"></a>
    function doLocation(START,FINISH)
    {
    window.document.getElementById("roadmap").src="${pageContext.request.contextPath}/netinfo/Hispaths.do?START="+START+"&FINISH="+FINISH;
    }
    去后台 就是 把传入的参数设置了一下不让其乱码。传入到 地图上界面获取 起始点。然后就是 地图界面<html>
    <head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <style type="text/css">
    body,html,#allmap {
    width: 100%;
    height: 100%;
    overflow: hidden;
    margin: 0;
    }#l-map {
    height: 100%;
    width: 78%;
    float: left;
    border-right: 2px solid #bcbcbc;
    }#r-result {
    height: 100%;
    width: 20%;
    float: left;
    }
    </style>
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=1.5&ak=密钥"></script>
    <title>HAKIM</title>
    </head> <s:hidden name="START" id="START"></s:hidden>
    <s:hidden name="FINISH" id="FINISH"></s:hidden>
    <div id="allmap"></div> <script type="text/javascript">
    var fromWhere = document.getElementById("START").value;
    var toWhere = document.getElementById("FINISH").value;
    var map = new BMap.Map("allmap");
    //setTimeout("seachNavigate()",0);
    //function seachNavigate() { var driving = new BMap.DrivingRoute(map, {
    renderOptions : {
    map : map,
    autoViewport : true
    }
    }); driving.search(fromWhere, toWhere);
    //}

    </script></html>
      

  4.   

    <!DOCTYPE html>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <style type="text/css">
    body, html, #allmap {
    width: 100%;
    height: 100%;
    overflow: hidden;
    margin: 0;
    }
    </style>
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=D4a8d74ef14707ec0e0ee5ea88ba0570"></script>
    <title>根据起终点名称查询公交换乘</title>
    </head>
    <body>
    <div id="allmap"></div>
    </body>
    </html>
    <script type="text/javascript"> // 百度地图API功能
    var map = new BMap.Map("allmap");
    // 创建Map实例
    map.centerAndZoom(new BMap.Point(120.16, 30.29), 14);
    var transit = new BMap.TransitRoute(map, {
    renderOptions: { map: map }
    });
    transit.search("天际大厦", "龙都大厦");
    </script>这样我试了一下。除了天目1到181不显示。其他都可以,我觉得你设置下
    map.centerAndZoom(new BMap.Point(120.16, 30.29), 14);这个精确度会更好点。