我想用谷歌地图来实现:
比如说:我的出发点是:重庆 目的地是:三亚 当我输入后一点搜索后;就在谷歌地图上面把这条路中间要经过的所有的景点全部显示出来; 当然,我会先把经过的景点整理出来; 可是怎么才能让它在地图上面给用线连在一起呢
比如说:我的出发点是:重庆 目的地是:三亚 当我输入后一点搜索后;就在谷歌地图上面把这条路中间要经过的所有的景点全部显示出来; 当然,我会先把经过的景点整理出来; 可是怎么才能让它在地图上面给用线连在一起呢
解决方案 »
- 再问!自定义控件问题
- 自动获取当前时间分别判断出今天是星期几?请高手赐教,
- SQL2005+.net2.0+三层结构+数据库缓存依赖--问题
- 谁知道水晶报表怎么连接oracle服务器阿?
- 很简单的存储过程用于用户登录判断
- 怎样在DataGrid中通过点击行尾的Button弹出一个新窗口?又怎样在此新窗口中显示DataGrid中一行的全部值?
- 两张关联表,取重复记录中的一条
- 怎样使网页中所有TextBox的text=""
- NT上能装ASP.NET吗,要做网站!
- 菜鸟问题:ASP.NET中我怎么连SQL SERVER 数据库?谢谢!
- 收藏 不显示删除回复显示所有回复显示星级回复显示得分回复 Reporting Services 2008 报表开发 表达式除0错误
- dnn user login register 界面 如何汉化
//出发地
var start = document.getElementById("start").value;
//目的地
var end = document.getElementById("end").value;
//出行方式
var selectedMode = document.getElementById("TravelMode").value; var image = new google.maps.MarkerImage('IMG/icon.png',
new google.maps.Size(19, 30));
var request = {
origin: start,
destination: end,
travelMode: google.maps.DirectionsTravelMode[selectedMode]
};
directionsService.route(request, function (response, status) {
if (status == google.maps.DirectionsStatus.OK) {
directionsDisplay.setDirections(response);
}
});
var location = new google.maps.LatLng(28.681984, 115.906947);
var er = new google.maps.Marker({
position: location,
map: map,
icon: image
});
er.setTitle("1");
attachSecretMessage(er, 0);
}
<strong>出发地: </strong>
<input id="start" type="text" />
<strong>目的地: </strong>
<input id="end" type="text" style="width:200px;" />
<strong>出行方式: </strong>
<select id="TravelMode">
<option value="WALKING">步行</option>
<option value="DRIVING">乘车</option>
</select>
<input id="searchButton" type="button" value="搜索路线" onclick="calcRoute();" />
一个前辈的代码。
行车路线