Vous voulez vérifier l'Api GoogleMaps:
Static Map API
Directions API
Ces API vous fournit une réponse XML où vous pouvez les analyser pour obtenir les résultats affichés. J'ai fait un pour trouver le temps et la distance que vous pouvez utiliser comme exemple: Ceci est l'une de mes précédentes tentatives donc pas de XML est utilisé mais il vous donnera une idée de comment travailler avec les réponses de google.
Public Function GMap(origin_address As String, destination_address As String, Optional mode As Integer = 1, Optional datatype As Integer = 1)
Dim surl As String
Dim oXH As Object
Dim bodytxt As String
Dim time_e As String
Dim distanc_e As String
Dim strmode As String
If mode = 1 Then
strmode = "walking"
ElseIf mode = 2 Then
strmode = "driving"
ElseIf mode = 3 Then
strmode = "bicycling"
Else
GMap = "Invalid Mode"
Exit Function
End If
surl = "http://maps.googleapis.com/maps/api/distancematrix/xml?origins=;" & _
Replace(origin_address, " ", "+") & "&destinations=" & Replace(destination_address, " ", "+") & _
"&mode=" & strmode & "&sensor=false&units=metric"
Set oXH = CreateObject("msxml2.xmlhttp")
With oXH
.Open "get", surl, False
.send
bodytxt = .responseText
End With
bodytxt = Right(bodytxt, Len(bodytxt) - InStr(1, bodytxt, "<text>") - 5)
tim_e = Left(bodytxt, InStr(1, bodytxt, "</text>") - 1)
bodytxt = Right(bodytxt, Len(bodytxt) - InStr(1, bodytxt, "<text>") - 5)
distanc_e = Left(bodytxt, InStr(1, bodytxt, "</text>") - 1)
If datatype = 1 Then
GMap = CDbl(Replace(tim_e, "mins", ""))
ElseIf datatype = 2 Then
GMap = CDbl(Replace(distanc_e, "km", ""))
Else
GMap = "Invalid Data"
End If
Set oXH = Nothing
End Function