RE:error webbrowser // informe
Hola Javier!
Te mando el codigo entero del codebehind:
Partial Class Inmobiliarias_mapa
Inherits System.Web.UI.Page
'PONIENDO DIRECCION NORMAL
Private Sub btnMapIt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMapIt.Click
Try
Dim street As String = String.Empty
Dim city As String = String.Empty
Dim state As String = String.Empty
Dim zip As String = String.Empty
Dim queryAddress As New StringBuilder()
queryAddress.Append("http://maps.google.com/maps?q=")
' build street part of query string
If txtStreet.Text <> String.Empty Then
street = txtStreet.Text.Replace(" ", "+")
queryAddress.Append(street + "," & "+")
End If
' build city part of query string
If txtCity.Text <> String.Empty Then
city = txtCity.Text.Replace(" ", "+")
queryAddress.Append(city + "," & "+")
End If
' build state part of query string
If txtState.Text <> String.Empty Then
state = txtState.Text.Replace(" ", "+")
queryAddress.Append(state + "," & "+")
End If
' build zip code part of query string
If txtZipCode.Text <> String.Empty Then
zip = txtZipCode.Text.ToString()
queryAddress.Append(zip)
End If
' pass the url with the query string to web browser control
webBrowser1.Navigate(queryAddress.ToString())
Catch ex As Exception
' MessageBox.Show(ex.Message.ToString(), "Unable to Retrieve Map")
End Try
End Sub
'PONIENDO LATITUD Y LONGITUD
Private Sub btnMapLatLong_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles btnMapLatLong.Click
If txtLat.Text = String.Empty Or txtLong.Text = String.Empty Then
' MessageBox.Show("Supply a latitude and longitude value.", "Missing Data")
End If
Try
Dim lat As String = String.Empty
Dim lon As String = String.Empty
Dim queryAddress As New StringBuilder()
queryAddress.Append("http://maps.google.com/maps?q=")
' build latitude part of query string
If txtLat.Text <> String.Empty Then
lat = txtLat.Text
queryAddress.Append(lat + "%2C")
End If
' build longitude part of query string
If txtLong.Text <> String.Empty Then
lon = txtLong.Text
queryAddress.Append(lon)
End If
webBrowser1.Navigate(queryAddress.ToString())
Catch ex As Exception
' MessageBox.Show(ex.Message.ToString(), "Error")
End Try
End Sub
End Class
Es para que en google maps que estoy utilizando, puedas escribir la direccion y te lo busque en el mapa.
Gracias.