Map Issues with Bing and Google

grahamvb

Registered User.
Local time
Today, 12:39
Joined
Aug 27, 2013
Messages
57
Hello Access-Programmers,

I am using the Access 2010 Web Browser Control in an attempt to display driving directions.

I am working with both Bing and Google maps to see which works best. Also, the licensing terms are very different, if I understand the terms correctly, Bing appears more open to free use,
within monthly and annual limits. Google appears to prohibit the free user from printing a map, even with a copyright notice. But I digress.

In the attached database I have a few map issues.
1. When maps display they display the entire web page within the Web Browser Control, not just the map?
2. Bing recognizes that directions are sought but does not pick up the destination address?
3. Google generates a sensor parameter missing error, although the parameter seems to be there?

I tried to follow the instructions for developing map URL's from Bing and Google at:
http://msdn.microsoft.com/en-us/library/dn217138.aspx
https://developers.google.com/maps/documentation/webservices/

The Web Browser Control, Control Source property for Bing is set as:
Code:
="http://bing.com/maps/default.aspx?rtp=adr." & [txtBingAddress]
The Web Browser Control, Control Source property for Google is set as:
Code:
="https://maps.googleapis.com/maps/api/directions/xml?origin=" & [txtHome] & "destination=" & [StoreAddress] & "+" & [StoreCity] & "+" & 
[StoreState] & "sensor=false"
I am at a loss as to why these issues are cropping up.
Any thoughts, even on one of the above issues would be appreciated?

Thank you in advance for looking into this.
 

Attachments

Your code for bing doesnt seem to include the destination at all ... Or perhaps it is a pasting error?

It should read something like:
Code:
="http://bing.com/maps/default.aspx?rtp=adr." & [txtBingAddress] & "~adr." & [txtDestination]
Which seems to work fine for me

As for google, the URL seems to work for, didnt try to make the API work:
Code:
https://maps.google.nl/maps?saddr=StartAddress&daddr=Destination

Hope this helps
 
The attached database initially uses the following string for txtBingAddress
Code:
1%20North%20Woodland%20Boulevard,%20Deland,%20FL~1699%20North%20Woodland%20Boulevard,%20Deland,%20FL

I see one error in my string, I only used the adr. once before the origin address. when I place it again between the tilde and the destination address I get the from/to search in the map. Thank you. Issue #2 solved.
 
Last edited:
namliam, I tried the Google URL you suggested instead of the Google API and it sort of works. (I used .com instead of .nl)
Code:
="https://maps.google.com/maps?saddr=" & [txtHome] & "&daddr=" & [StoreAddress] & ", " & [StoreCity] & ", " & [StoreState]

This is the string that is sent to Google maps:
Code:
https://maps.google.com/maps?saddr=1401 East New York Avenue, Deland, FL, 32724daddr=125 Jenkins Street, St. Augustine, FL
However an invalid character error occurs. (See attached image).
 

Attachments

  • Error.png
    Error.png
    76.6 KB · Views: 199
Bing specifies that spaces be replaced by "%20" but Google does not seem to be so specific. What should replace the spaces?

(Answered through research "+")
 
Last edited:
What I end up with is:
Code:
="https://maps.google.com/maps?saddr=" & [txtGoogleAddress]
txtGoogleAddress =
Code:
900+East+New+York+Avenue,+Deland,+FL,+32724&daddr125+Jenkins+Street,+St.+Augustine,+FL
This results in the attached error and the Web Browser Control goes blank if I choose either Yes or No in the Script Error message box.
 

Attachments

  • Error.jpg
    Error.jpg
    92.9 KB · Views: 178
should be ...
Code:
&daddr[COLOR="Red"][SIZE="6"]=[/SIZE][/COLOR]125...
 
This generates the same error and blank control.
Code:
https://maps.google.com/maps?saddr=900+East+New+York+Avenue,+Deland,+FL,+32724&daddr=125+Jenkins+Street,+St+Augustine,+FL
 
Last edited:
The last link you gave Graham seems to work for me

attachment.php
 

Attachments

  • route.jpg
    route.jpg
    71.2 KB · Views: 1,147

Users who are viewing this thread

Back
Top Bottom