0

I tried to display road network info in the respective infoWindow generated by Direction

Render marker.E.g Marker A when click the infoWindow contain all details from A to B.

Besides, an array of waypoints are shown between the source and destination. The

informations are not shown on InfoWindow popup. Here is part of the code. Any hint might

help thanks.

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);
        });
4

1 回答 1

0
  1. 没有请求的单击事件,当您单击标记时看到的 infowWindow 是由 directionRenderer 强制执行的,并且您无法控制标记和 infoWindows,您唯一能做的就是抑制它们
  2. 路线没有 roadInfo

你可以做什么:抑制标记和 infoWindow 并创建你自己的。

于 2012-03-22T22:19:45.863 回答