Bing maps directions -URL

Anthony Daleo

New member
Local time
Today, 12:57
Joined
Sep 26, 2010
Messages
2
I have an access 2007 database with a command button (cmdYahoo) on a form. It takes addresses from two text boxes and opens a yahoo map with directions. It works fine.
Here’s the code –
Private Sub cmdYahoo_Click()
Const URL_1 As String = _
"http://maps.yahoo.com/dd_result.php?q1=@ADDR@&q2=@DEST@"
Dim addr As String
Dim url As String
addr = TxStreetZip
addr = Replace$(addr, " ", "+")
addr = Replace$(addr, ",", "%2c")
dest = TxDestAdDestZip
dest = Replace$(dest, " ", "+")
dest = Replace$(dest, ",", "%2c")
url = Replace$(URL_1, "@ADDR@", addr)
url = Replace$(url, "@DEST@", dest)
ShellExecute ByVal 0&, "open", url, _
vbNullString, vbNullString, SW_SHOWMAXIMIZED
End Sub

Now I am trying to do the same for Bing Maps, using the same code but different URL. The code seems to be working but I can’t get the URL right for directions. I can do it for one address (where=) "http://www.bing.com/maps/?v=2&where1=@ADDR@".

I tried "http://www.bing.com/maps/explore/?rtp=@ADDR@~@DEST@" but does not work.

Does anyone know the right URL?
 
In Bing Maps create some "Directions" open the directions in a new window, then look at the URL, you should see the format required...
 
I tried to do that, but URL contained lat and lon coordinates that messed it up. Went back to try again and thru trial and error come up with this URL.
"http://www.bing.com/maps/explore/?org=aj&FORM=Z9LH8#5003/0.5040=rtp:adr.@ADDR@~adr.@DEST@:mode:D:rtop:1:avoid:0/5872/style=auto&lat=39.673532&lon=-74.297703&z=11&pid=5874"
This worked!
Thanks to Uncle Gizmo for making me try again.
 
I have an access 2007 database with a command button (cmdYahoo) on a form. It takes addresses from two text boxes and opens a yahoo map with directions. It works fine.
Here’s the code –
Private Sub cmdYahoo_Click()
Const URL_1 As String = _
"http://maps.yahoo.com/dd_result.php?q1=@ADDR@&q2=@DEST@"
Dim addr As String
Dim url As String
addr = TxStreetZip
addr = Replace$(addr, " ", "+")
addr = Replace$(addr, ",", "%2c")
dest = TxDestAdDestZip
dest = Replace$(dest, " ", "+")
dest = Replace$(dest, ",", "%2c")
url = Replace$(URL_1, "@ADDR@", addr)
url = Replace$(url, "@DEST@", dest)
ShellExecute ByVal 0&, "open", url, _
vbNullString, vbNullString, SW_SHOWMAXIMIZED
End Sub

Now I am trying to do the same for Bing Maps, using the same code but different URL. The code seems to be working but I can’t get the URL right for directions. I can do it for one address (where=) "http://www.bing.com/maps/?v=2&where1=@ADDR@".

I tried "http://www.bing.com/maps/explore/?rtp=@ADDR@~@DEST@" but does not work.

Does anyone know the right URL?

Anthony,

How does it know which two text boxes to pull from? Do I have to create specific text boxes? I currently have three text boxes. One with the address, another with just the city, and the other with the province.
 

Users who are viewing this thread

Back
Top Bottom