Vb.net + mapping

Résolu/Fermé
meskasousoubiba Messages postés 1208 Date d'inscription vendredi 15 avril 2011 Statut Membre Dernière intervention 23 avril 2014 - Modifié par meskasousoubiba le 6/06/2013 à 08:49
meskasousoubiba Messages postés 1208 Date d'inscription vendredi 15 avril 2011 Statut Membre Dernière intervention 23 avril 2014 - 8 juin 2013 à 12:51
Bonjour,
Bonjour;)
je suis entrain de developper une application de geolocalisation dont voici le code:
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

en l'executant je trouve un problème: ça ne me permet que d'ouvrir le navigateur gmaps sur le second splitwindow, et pour rechercher, je ne peux pas utiliser mon propre moteur de recherche: en saissant un zip code ou un nom de ville ds le split 1, ça ne mène à aucune recherche, uniquement l'ouverture du google map sur lequel je dois ajouter un mot clè :(
merci pour votre aide




************** j'attends votre aide ccmiens :) *****************
*******et je vous aiderai aussi autant que je peux ;)**********

2 réponses

meskasousoubiba Messages postés 1208 Date d'inscription vendredi 15 avril 2011 Statut Membre Dernière intervention 23 avril 2014 28
7 juin 2013 à 00:51
partiellement résolu: une simple faute d'ortographe: j'ai remplacé mapps par maps et ça a marché ;)
reste le prob de géolocalisation par lattitude et longitude, problem resolved, it was just a spelling mistake: mapps which i replaced by maps ;)
j'ai remplacé decimal par string
'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
mais je ne peux toujours pas faire une recherche par coordonnées géographiques, qu'est ce que vou me proposez?
0
meskasousoubiba Messages postés 1208 Date d'inscription vendredi 15 avril 2011 Statut Membre Dernière intervention 23 avril 2014 28
8 juin 2013 à 12:51
Encore une maudite virgule a bloqué. Mon prof, mais je l'ai résolue en la supprimant apres longitude, maintenant tous les moyens de recherche fonctionnent:)
0