【发布时间】:2012-11-01 20:16:02
【问题描述】:
我在客户端设备上使用 HTML5 localstorage 存储了开始和结束坐标。要显示他在开始和结束之间的路线,我必须使用谷歌地图驾驶列表(不是地图..只是文本格式的方向)应用程序在 jquery mobile 中。
<div data-role="content">
<div data-role="content" id="list">
<ul data-role="listview" data-inset="true" data-filter="true" id="myList">
我可以在我的列表视图中添加 ID 为 myList 的行车列表吗?
function gotDirections(geo){
var directionsService = new google.maps.DirectionsService();
var directionsDisplay = new google.maps.DirectionsRenderer();
directionsDisplay.setPanel(document.getElementById("myList"));
var storedlati=localStorage.getItem("text1");
var storedlongi=localStorage.getItem("text");
var destilati=localStorage.getItem("text2");
var destilongi=localStorage.getItem("text3");
var request = {
origin:google.maps.LatLng(storedlati,storedlongi),
destination:google.maps.LatLng(destilati,destilongi),
travelMode: google.maps.TravelMode.DRIVING
};
directionsService.route(request, function(result, status) {
if (status == google.maps.DirectionsStatus.OK) {
directionsDisplay.setDirections(result);
}
});
}
【问题讨论】:
-
什么是“谷歌地图行车清单”?它只是您想要的面板的内容(如this 但没有地图)?还是有什么额外的?
-
我想要您提供的链接右侧的列表 :)
标签: html google-maps jquery-mobile