|
Hola a todos! Estoy haciendo un site donde pegue un control subgurim google maps. Le agrego objetos markers.Y quiero que cuando le doy a un marker haga una select en la base de datos y me actualize una grilla. La select la hago bien y me carga la grilla, pero no me muestra nada. Probe cargar la grilla por inicio y luego actualizarla con el click del marker pero no hace nada. Aca les paso el codigo fuente del evento click del marker
Muchas Gracias!
Protected Function GMapaAVL_MarkerClick(ByVal s As Object, ByVal e As Subgurim.Controles.GAjaxServerEventArgs) As String Handles GMapaAVL.MarkerClick Dim js As String = "" Dim markerID As String = "" Dim latlng = New GLatLng Dim lo_DataTable1 As New Data.DataTable Dim lo_Options As New GInfoWindowOptions() Dim lo_Window As New GInfoWindow() Dim stringWrite As New System.IO.StringWriter Dim ls_html As String = "" Dim da As SqlDataAdapter Dim dt As New DataTable
latlng = New GLatLng(CDbl(e.point.lat), CDbl(e.point.lng)) gs_sql = "SELECT * FROM mags.EL_Nodos" gs_sql &= " WHERE nod_pos_x = " & latlng.lng gs_sql &= " AND nod_pos_y = " & latlng.lat
Dim da As New SqlDataAdapter(gs_sql, go_ConexionBase_SAR) Dim dt As New DataTable() da.Fill(dt)
Me.GridView1.DataSource = dt 'GridView1.DataBind()
lblmsj.Text = Strings.Format("Total datos en la tabla: " & lo_DataTable1.Rows.Count)
Dim latlon = New GLatLng(latlng.lat, latlng.lng) GMapaAVL.setCenter(latlon, 4)
For Each lo_DataRow As Data.DataRow In lo_DataTable1.Rows lo_Options = New GInfoWindowOptions("NODO " & lo_DataRow("nod_id").ToString, ls_html) lo_Window = New GInfoWindow(e.point, "ID NODO " & lo_DataRow("nod_id"), True, lo_Options) Next
GMapaAVL.addInfoWindow(lo_Window)
Return lo_Window.ToString(e.map)
End Function
|