我想从谷歌地图解析源和目的地之间的所有位置,如下所示:Google Maps API v3 Directions Example
<script type="text/javascript">
var directionsService = new google.maps.DirectionsService();
var directionsDisplay = new google.maps.DirectionsRenderer();
var map = new google.maps.Map(document.getElementById('map'), {
zoom:7,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
directionsDisplay.setMap(map);
directionsDisplay.setPanel(document.getElementById('panel'));
var request = {
origin: 'Kolkata',
destination: 'Patna',
travelMode: google.maps.DirectionsTravelMode.DRIVING
};
//echo 'directionsService.route()';
directionsService.route(request, function(response, status) {
if (status == google.maps.DirectionsStatus.OK) {
directionsDisplay.setDirections(response);
}
});
</script>
</body>
</html>
这样我就可以解析位置并将其存储在数据库中的表中。请帮助找到一种方法来做到这一点。在此先感谢