【发布时间】:2012-11-03 05:53:54
【问题描述】:
我正在尝试提供建筑物之间的校园步行路线。当我使用以下代码时,起点和终点坐标被放置在最近的命名道路上,而不是指定的特定路径上。
var request = {
origin: "34.23974770397957,-118.53099968624116",
destination: "34.240064785369974,-118.52827992630006",
travelMode: google.maps.DirectionsTravelMode.WALKING
};
directionsService = new google.maps.DirectionsService();
directionsService.route(request, function(response, status) {
if (status == google.maps.DirectionsStatus.OK) {
directionsDisplay.setDirections(response);
}
});
您可以在http://www.csun.edu/~kjm39451/maps/mapsError/main.html 处通过选择两个字段中任何内容的下拉菜单来查看问题。
如何使用 google maps api 像 google maps 一样提供方向?
【问题讨论】:
标签: javascript json google-maps