Hi I am getting frustrated here, can anyone spot what I am doing wrong here. I can't update the reimers GoogleMAP control with my polyline ? What code is missing to get that damn controll to
redraw the map with my database content ?
Best regards
Janne
Dim poly As New GooglePolyline
Dim strPoly As String
Dim lat As String = ""
Dim lng As String = ""
Dim index As Integer
Dim con As New SqlConnection("Data Source=Janne-HPNEW;Initial Catalog=GPSGate;Persist Security Info=True;User ID=sa;Password=Ramses12")
con.Open()
Dim cmd As New SqlCommand("SELECT * FROM dbo.A1 WHERE speed > '10' ORDER BY time", con)
Dim result As SqlDataReader = cmd.ExecuteReader
While result.Read
lat = result("Latitude").ToString() / 100000
lng = result("Longitude").ToString() / 100000
poly.Points.Add(New GoogleLatLng(lat, lng))
' Below row is just for testing to se that the database is looping trouch the records. And it does !!!!
TextBox6.Text = TextBox6.Text + lat & " " & lng + Chr(10) + Chr(13)
End While
result = Nothing
con.Close()
con = Nothing
poly.Width = 8
poly.Color = Drawing.Color.Black
poly.Opacity = 0.5
Map.AddOverlay(poly)
Map.UpdateOverlays()