I have the start and end cordinates stored on client device with HTML5 localstorage.To diplay him the route between start and end i have to use google maps driving list(not a map..just the directions in text format) The application is in jquery mobile.
<div data-role="content">
<div data-role="content" id="list">
<ul data-role="listview" data-inset="true" data-filter="true" id="myList">
can i add that driving list in my listview with 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);
}
});
}
In that case, just set the directions panel on the directionsRenderer, not the map; and don’t create the map. Like this Example