2017-08-18 9 views
0

私のウェブページにサブグリムを使用しています。私は方向を入力しようとしています。私はマーカーが正しく表示されている。私は道順を追加する過程にないが、なぜ彼らが表示されていないのか見ていない。ここでは、コードが方向ウェブページにサブグリムGDirectionが表示されない

Protected Sub GetDirections() 
    Dim NavcareDirection As New GDirection() 
    Dim sItemNbr As String 

    txtMapMsg.Visible = False 
    txtMapMsg.Text = "" 

    If ddlDirectionsFrom.SelectedItem.Value = "0" Then 
     txtMapMsg.Text = "You must select a From to get directions" 
     txtMapMsg.Visible = True 
     txtOtherStart.Focus() 
     Exit Sub 
    End If 

    If ddlDirectionsTo.SelectedItem.Value = "0" Then 
     txtMapMsg.Text = "You must select a TO to get directions" 
     txtMapMsg.Visible = True 
     txtOtherStart.Focus() 
     Exit Sub 
    End If 

    sItemNbr = ddlDirectionsFrom.SelectedItem.Value 

    tb_fromPoint.Visible = True 
    tb_endPoint.Visible = True 


    NavcareDirection = New GDirection() 
    NavcareDirection.autoGenerate = False 
    NavcareDirection.buttonElementId = "bt_Go" 
    NavcareDirection.fromElementId = tb_fromPoint.ClientID 
    NavcareDirection.toElementId = tb_endPoint.ClientID 
    NavcareDirection.divElementId = "div_directions" 
    NavcareDirection.clearMap = True 

    NavcareDirection.errorMessage = "Directions Error" 

    GMap1.Add(NavcareDirection) 
End Sub 

私はエラーなし方向を取得していない午前を作成するためである

<%@ register assembly="GMaps" namespace="Subgurim.Controles" tagprefix="cc1" %> 
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server"> 
<table align="center" width="80%" border="0" cellspacing="0" cellpadding="0"> 
<tr> 
    <td align="center" valign="top" width="10%"> 
     <asp:Label ID="lblDirectionsFrom" runat="server" CssClass="Label" Text="Drive From:" Visible="False"></asp:Label> 
     &nbsp; 
     <asp:DropDownList ID="ddlDirectionsFrom" runat="server" CssClass="Textbox" Width="100px" AppendDataBoundItems="True" Visible="false" AutoPostBack="True"> 
     </asp:DropDownList> 
     &nbsp; 
    </td> 
    <td align="center" valign="top" width="20%" colspan="3"> 
     <asp:Label ID="lblDirectionsTo" runat="server" CssClass="Label" Text="Drive To:" Visible="False"></asp:Label> 
     &nbsp; 
     <asp:DropDownList ID="ddlDirectionsTo" runat="server" CssClass="Textbox" Width="100px" AppendDataBoundItems="True" Visible="false" AutoPostBack="True"> 
     </asp:DropDownList> 
    </td> 
    <td align="left" valign="top" colspan="4" width="40%"> 
     <input type="button" id="bt_Go" runat="server" value="Get Directions" onserverclick="GetDirections" class="CmdButton" visible="False" /> 
    </td> 
</tr> 
<tr> 
    <td align="right" valign="top" width="10%"> 
    </td> 
    <td align="left" valign="top" width="20%" colspan="3"> 
    </td> 
    <td align="left" valign="top" colspan="4" width="40%"> 
     <asp:Label ID="txtMapMsg" 
      runat="server" 
      Text="txtMapMsg" 
      CssClass="Msgbox" 
      Width="80%" 
      Visible="False" 
      BackColor="#F7B432"></asp:Label> 
    </td> 
</tr> 
<tr> 
    <td align="center" valign="top" colspan="4" width="60%"> 
     <asp:TextBox ID="tb_fromPoint" runat="server" meta:resourcekey="tb_fromPointResource1"></asp:TextBox> 
     <asp:TextBox ID="tb_endPoint" runat="server" meta:resourcekey="tb_endPointResource1"></asp:TextBox> 
     <cc1:GMap ID="GMap1" runat="server" Key="googlemaps.subgurim.net" CommercialKey="googlemaps.subgurim.net_Commercial" enableServerEvents="true" /> 
     <div id="div_directions"></div> 
    </td> 
    <td align="center" valign="top" colspan="4" width="40%">    
    </td> 
</tr> 
    </table> 
</asp:Content> 

は、以下のウェブページです。どんな助けでも大歓迎です。

答えて

1

しばらくして、私は戻って来て、私が間違っていたことを見つけました。

NavcareDirection = New GDirection() 
NavcareDirection.autoGenerate = False 
NavcareDirection.buttonElementId = "bt_Go" 
NavcareDirection.fromElementId = tb_fromPoint.ClientID 
NavcareDirection.toElementId = tb_endPoint.ClientID 
NavcareDirection.divElementId = "div_directions" 
NavcareDirection.clearMap = True 

NavcareDirection.errorMessage = "Directions Error" 

GMap1.Add(NavcareDirection) 

私は最終的にエラーメッセージを受け取りましたが、なぜ私がそれらを取得しているのかわかりません。私は新しい質問にそれを置きます。

関連する問題