Hente værdier ud fra googel maps
Jeg har følgende kode<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>Google Maps JavaScript API v3 Example: Directions Draggable</title>
<link href="http://code.google.com/ (...) rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://maps.googleapis.com/ (...)
<script type="text/javascript">
var rendererOptions = {
draggable: false
};
var directionsDisplay = new google.maps.DirectionsRenderer(rendererOptions);;
var directionsService = new google.maps.DirectionsService();
var map;
var center = new google.maps.LatLng(56.1336, 9.775136);
function initialize() {
var myOptions = {
zoom: 7,
mapTypeId: google.maps.MapTypeId.ROADMAP,
center: center
};
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
directionsDisplay.setMap(map);
directionsDisplay.setPanel(document.getElementById("directionsPanel"));
calcRoute();
}
function calcRoute() {
var request = {
origin: "56.154560,10.151438",
destination: "55.632812,12.466144",
waypoints:[{location: "55.877956,9.828019"}, {location: "55.145782 10.781363"}],
travelMode: google.maps.DirectionsTravelMode.DRIVING
};
directionsService.route(request, function(response, status) {
if (status == google.maps.DirectionsStatus.OK) {
directionsDisplay.setDirections(response);
}
});
}
</script>
</head>
<body onload="initialize()">
<div id="map_canvas" style="float:left;width:70%; height:100%"></div>
<div id="directionsPanel" style="float:right;width:30%;height 100%; display: hidden; font-size: 10px;">
</div>
</body>
</html>
Jeg ville gerne have indholdet af rute beskrivelse i et eller andet format hvor jeg kan hente kilometer og køretid ud som en variabel, så jeg kan gemme dem i database
http://ruthwillumsen.dk/distance.php