2012-03-22 63 views
0

我試圖通過方向產生相應的信息窗口顯示路網信息顯示路線的細節呈現在谷歌地圖V3標記

渲染marker.Eg標記一個點擊信息窗口包含從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); 
     }); 

回答

0
  1. 沒有點擊事件的請求,infowWindow你看,當你在一個標記單擊由directionRenderer強迫和你沒有在標記和信息窗口任何控制,唯一你能做的就是鎮壓他們
  2. 路線沒有roadInfo

你可以做什麼:抑制標記和信息窗口的,並創建自己的。