【发布时间】:2012-03-22 21:16:55
【问题描述】:
我尝试在 Direction 生成的相应 infoWindow 中显示路网信息
渲染标记。例如,单击信息窗口时标记 A 包含从 A 到 B 的所有详细信息。
此外,在源和目的地之间显示了一组航点。
信息不显示在 InfoWindow 弹出窗口中。这是代码的一部分。任何提示都可能
帮助谢谢。
directionsService.route(request, function (response, status) {
if (status == google.maps.DirectionsStatus.OK) {
var roadInfo = document.getElementById("directionsPanel");
roadInfo.innerHTML="<b>"+response.routes[0].roadInfo+"</b>";
directionDisplay.setDirections(response);
var myRoute = response.routes[0].legs[0];
google.maps.event.addListener(request, 'click', function() {
// Open an info window when the marker is clicked on,
// containing the text of the step.
displayStep.setContent(request,myRoute.steps[i].instructions);
});
【问题讨论】:
标签: google-maps-api-3 driving-directions