2012-08-23 3 views
1

Google 다 지점 맵을 버전 2에서 3으로 옮깁니다. 아이콘을 표시하고 클릭하면 새 창이 열립니다. 정보 창을 열었을 때 '여기와 여기에서 오는 길'옵션이있었습니다. 여기 또는 여기에서 클릭하면 텍스트 필드가 나타나고 예를 들어 마을 이름을 입력 할 수 있습니다. 버튼을 클릭하면 사용자가 새 창에서 Google지도로 전송되었습니다. 그런 옵션을 찾을 수없는 것 같습니다.infowindow 내에서 간단한 방향을 추가하는 방법

// The info window version with the "to here" form open 
    to_htmls[i] = html + '<br>Directions: <b>To here</b> - <a href="javascript:fromhere(' + i + ')">From here</a>' + 
     '<br>Start address:<form action="http://maps.google.com/maps" method="get" target="_blank">' + 
     '<input type="text" SIZE=40 MAXLENGTH=40 name="saddr" id="saddr" value="" /><br>' + 
     '<INPUT value="Get Directions" TYPE="SUBMIT">' + 
     '<input type="hidden" name="daddr" value="' + point.lat() + ',' + point.lng() + 
       // "(" + name + ")" + 
     '"/>'; 
    // The info window version with the "to here" form open 
    from_htmls[i] = html + '<br>Directions: <a href="javascript:tohere(' + i + ')">To here</a> - <b>From here</b>' + 
     '<br>End address:<form action="http://maps.google.com/maps" method="get"" target="_blank">' + 
     '<input type="text" SIZE=40 MAXLENGTH=40 name="daddr" id="daddr" value="" /><br>' + 
     '<INPUT value="Get Directions" TYPE="SUBMIT">' + 
     '<input type="hidden" name="saddr" value="' + point.lat() + ',' + point.lng() + 
       // "(" + name + ")" + 
     '"/>'; 
    // The inactive version of the direction info 
    html = html + '<br><br>Directions: <a href="javascript:tohere('+i+')">To here</a> - <a href="javascript:fromhere('+i+')">From here</a>'; 
+1

게시 한 코드 중 Google Maps API v2에만 해당되는 것은 없습니다. 더 많은 컨텍스트를 제공하거나이 작업을 시도한 곳에서지도 (또는 jsfiddle)에 대한 링크를 제공해야하며 작동하지 못하게해야합니다. – geocodezip

답변

관련 문제