gdrirection.load()를 호출 할 때 문제가 발생했습니다. 작동하는 값을 지정했지만 텍스트 상자를 통해 전달하면 작동하지 않습니다. 여기 내 코드는 주소로 같은 주소로 TextBox1
및 txtAddress
을 전달하는google map api v2
var map;
var directionsPanel;
var directions;
function initialize() {
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(24.7116667, 46.7241667), 12);
map.setUIToDefault();
var txtAddress = document.getElementById('txtAddress').value;
var TextBox1 = document.getElementById('TextBox1').value;
directions = new GDirections(map, directionsPanel);
directions.load("from: 'TextBox1' to: 'txtAddress'");
}
}
<body onload=initialize()>
<asp:TextBox ID="txtAddress" runat="server" Visible="true" />
<input type="button" value="direction" onclick="initialize();" title="direction" />
<asp:TextBox ID="TextBox1" runat="server" Visible="true"></asp:TextBox>`
주셔서 감사합니다 코드에서
참고 [지도 V2입니다 구글 :-) 당신을 도와 fine.Hope 작동합니다 : 그래서 구글은 address.Use 모두에게 텍스트 상자에서 값을 전달하려면 다음 코드를 이해 할 수 없습니다 deprecated] (https://developers.google.com/maps/documentation/javascript/v2/) – ManseUK