English 中文(简体)
go图
原标题:google map api v2

I ve problem calling gdrirection.load(),if I specified the values it ll work ,but if I pass them through text boxes it doesn t work. here s my code

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>`

成就

问题回答

您的代码为:TextBox1,作为地址和txtAddress。 因此,不能理解这两个问题。 利用以下代码从文字箱中传递价值:

directions.load("from: "+TextBox1+" to: "+txtAddress+"");

此人将罚款。 希望有助于:





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签