Click here to Skip to main content
15,891,567 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi all
i'm developping a windowsform nwebmapping application in .net language via visual studio ultimate
i've written this code
VB.NET
Imports System.Text
Imports Microsoft.VisualBasic
Imports System.Timers





Public Class Tracking_Theft

Private Sub butnsrchmap_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles butnsrchmap.Click
Try

Dim Street As String = String.Empty
Dim City As String = String.Empty
Dim Zip As String = String.Empty
Dim IMEI As Decimal = Decimal.Zero
Dim Lattitude As Decimal = Decimal.Zero
Dim Longitude As Decimal = Decimal.Zero
Dim Number_Of_Satellites As Integer = Integer.MinValue
Dim queryAdress As New StringBuilder()
queryAdress.Append("https://maps.google.com/mapps?q=")

'build street part query
If txtstreet.text <> String.Empty Then
Street = txtstreet.Text.Replace(" ", "+")
queryAdress.Append(Street + "," & "+")
End If

'build city part query
If cmbxcity.Text <> String.Empty Then
City = cmbxcity.Text.Replace(" ", "+")
queryAdress.Append(City + "," & "+")
End If

'build zip part query
If txtzip.Text <> String.Empty Then
Zip = txtzip.Text.Replace(" ", "+")
queryAdress.Append(Zip + "," & "+")
End If

'build IMEI part query
If txtimei.Text <> String.Empty Then
IMEI = txtimei.Text.Replace(" ", "+")
queryAdress.Append(IMEI + "," & "+")
End If

'build latitude part query
If txtlatitude.Text <> String.Empty Then
Lattitude = txtlatitude.Text.Replace(" ", "+")
queryAdress.Append(Lattitude + "," & "+")
End If

'build longitude part query
If txtlongitude.Text <> String.Empty Then
Longitude = txtlongitude.Text.Replace(" ", "+")
queryAdress.Append(Longitude + "," & "+")
End If

'build Number of Stellites part query
If txtnumbsat.Text <> String.Empty Then
Number_Of_Satellites = txtnumbsat.Text.Replace(" ", "+")
queryAdress.Append(Number_Of_Satellites + "," & "+")
End If

WebBrowser1.Navigate(queryAdress.ToString())


Catch ex As Exception
MessageBox.Show(ex.Message.ToString(), "Unable to load the map")

End Try
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

daylab.Text = " " & Now.ToShortDateString
timelab.Text = "" & Now.ToShortTimeString

End Sub

End Class


while executing, ive found this error message:
[^]
would u like to tell me please what is missing on my code so that the execution do not work?
is it related to something missing on the code (a library or else?)
i'd like also to inform you that i'm using firefox as a default webbrowser on my pc, should this interfere?
waiting for ur help, alot of thanks in advance :)
Posted
Updated 4-Jun-13 15:51pm
v2
Comments
[no name] 4-Jun-13 18:25pm    
"error message", that is not an error message. It is to a link to something that is somewhere else that gives a 404 error.
fridrai raissi 6-Jun-13 18:38pm    
i've tried to replace it by
[code]'build latitude part query
If txtlatitude.Text <> String.Empty Then
Lattitude = txtlatitude.Text.Replace(" ", "+")
queryAdress.Append(Lattitude + "," & "+")
End If

'build longitude part query
If txtlongitude.Text <> String.Empty Then
Longitude = txtlongitude.Text.Replace(" ", "+")
queryAdress.Append(Longitude + "," & "+")
End If
[/code]
but it still do not find by geographical coordinates :'(
fridrai raissi 8-Jun-13 18:48pm    
another punctuation mistake, no need for the comma after the the longitude, i've replaced it by:
[code]
If txtlongitude.Text <> String.Empty Then
Longitude = txtlongitude.Text.Replace(" ", "+")
queryAdress.Append(Longitude & "+")
End If
[/code]
and now it works
last question: can i get how many satellites has my gps tracker detected ?

queryAdress.Append("https://maps.google.com/mapps?q=")


Just a guess, but I suspect that "mapps" should be "maps".

Err 404 means "not found".
 
Share this answer
 
Comments
fridrai raissi 6-Jun-13 18:35pm    
still have another problem, i can find just by zip code, city and street, how should i make it workable by latitude and longitude?
TnTinMn 6-Jun-13 20:10pm    
Sorry, but I know nothing about this API.
You may get a response by posting a new detailed question.

Have you tried: https://developers.google.com/maps/

Also found this: Google Maps API for .NET
http://gmaps.codeplex.com/

You may find some hints in looking at that code.
thaaaaaaaaaaaaaaaaaaaanks for correction, now it perfectly works, the problem was just due to the double p
thanks again TnTinMn :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900