Driving directions: departure address
Friday, 26. May 2006, 15:43:22
I do have a car, but I don't have a navigation system. I therefore use one of the many online services to get driving directions, but I don't always use the same service. That's because the one I usually prefer (Map24) sometimes crashes Opera and doesn't know new roads. For example, not so long ago it would still let you follow the Belgian coast to go from Amsterdam to Brest even though taking the A29 through Amiens would save you lots of kilometres. Moreover, their new beta doesn't work in Opera 8.54 and doesn't show maps in Opera 9. So I'm forced to switch to anwb.nl, mappy.com, viamichelin.com or one of many similar sites.
When getting driving directions from such a website, I mostly use my home address as the departure address, so I figured it would be nice to have the site remember that info. A cookie set by the website wouldn't work too well because I delete cookies when I close Opera. UserJS was my next option.
After examining a few dozens of route planners, I found out they all use code similar to this:
Of course, they all use different names for their elements; some sites use the id attribute instead. Some let you enter a State or Province (using either an <input type="text"> or a <select>); others ask for the house number and street name separately.
In short, there's little the route planners agree on.
And then there was another problem I had to solve if I wanted to write a script that would work with them all: in The Netherlands, the house number comes after the street name; in the US, they're reversed. In France, they put a comma between them. Furthermore, a French route planner may know what "Norvège" is, but a British one can only work with "Norway".
Finally, this is what I've done:
I have written a JS function that will figure out which element types have been used to contain the address info. Its input parameters are the names or id's of these elements. The function will get the correct information from an array that stores the street name, house number, zip code, city, state and country separately. The country is again an array consisting of several equivalents (in different languages, for instance). The user also sets what the right street address notation is (which can be overridden for specific sites)
Once I completed the function, it was relatively easy to make it work on the following sites (note that some pages simply use some other site's route planning service):
1bis
411.info
9292ov.nl
The AA Route Planner
Abacho.de
Allianz Routenplanung
Anwb.nl
AOL Travel
Aral Routenplaner
Auskunft.ch
Autobahn Tank & Rast
Autoroutes.fr
Autostadtplan.de
Bayerninfo.de
bottin.fr
BP The Netherlands
BP Route Finder
CNN Driving Directions
CompuServe Routeplanner
Deutscher Stadtplandienst
Drive Alive! Route Planner
Expedia
Fahrinfo Berlin
Falk.de Routenplaner
Free.fr Itinéraires
Freetrip.com
Google Maps
Green Flag Route Planning
Guia Campsa
InfoSpace
Iti.fr
KataWeb.it Mappe
klickTel.de
LeasePlan Nederland
Letsmove.be (also in French)
Lycos.de Routenplaner
Lycos.nl Routeplanner
Map24
Maporama.com
Mappy.com
MapQuest.com
Maps.com
Maps On Us
MSN Mappoint / Mapblast
Multimap.com
Onde Estou.br
Opel Route Planner
Planet.nl
QDQ.com
RAC Route Planner
Rand McNally Maps & Directions
RATP.fr
Reiseplanung.de / Routenplanung.de
Routemaster.nl
Routenet.nl / Routenet.be
Routenplaner-online.com
Routenplaner24.de
Routeplannerplaza.nl
Strassenroutenplaner.de / Strassenkarten-Europa.de
SuperPages.com / BigBook.com
T-Mobile Routenplaner
Terra.es Callejero
Touring.be (also in French)
Travelmate.com.au
VanAnaarB.nl
Veturo.com
Vialys.fr
ViaMichelin.com
Volkswagen.de Routenplaner
VTB/VAB.be (also in French)
Wanadoo.fr
Wanadoo.nl
Wannahaves.nl
Web.de
Yahoo! Deutschland Routenplaner
Yahoo! Driving Directions
Yahoo! France
When getting driving directions from such a website, I mostly use my home address as the departure address, so I figured it would be nice to have the site remember that info. A cookie set by the website wouldn't work too well because I delete cookies when I close Opera. UserJS was my next option.
After examining a few dozens of route planners, I found out they all use code similar to this:
<label for="startStreet">Street:</label> <input type="text" name="startStreet"> <label for="startCity">City:</label> <input type="text" name="startCity"> <label for="startZip">Zip:</label> <input type="text" name="startZip"> <label for="startCountry">Country:</label> <select type="text" name="startCountry">...</select>
Of course, they all use different names for their elements; some sites use the id attribute instead. Some let you enter a State or Province (using either an <input type="text"> or a <select>); others ask for the house number and street name separately.
In short, there's little the route planners agree on.
And then there was another problem I had to solve if I wanted to write a script that would work with them all: in The Netherlands, the house number comes after the street name; in the US, they're reversed. In France, they put a comma between them. Furthermore, a French route planner may know what "Norvège" is, but a British one can only work with "Norway".
Finally, this is what I've done:
I have written a JS function that will figure out which element types have been used to contain the address info. Its input parameters are the names or id's of these elements. The function will get the correct information from an array that stores the street name, house number, zip code, city, state and country separately. The country is again an array consisting of several equivalents (in different languages, for instance). The user also sets what the right street address notation is (which can be overridden for specific sites)
Once I completed the function, it was relatively easy to make it work on the following sites (note that some pages simply use some other site's route planning service):
1bis
411.info
9292ov.nl
The AA Route Planner
Abacho.de
Allianz Routenplanung
Anwb.nl
AOL Travel
Aral Routenplaner
Auskunft.ch
Autobahn Tank & Rast
Autoroutes.fr
Autostadtplan.de
Bayerninfo.de
bottin.fr
BP The Netherlands
BP Route Finder
CNN Driving Directions
CompuServe Routeplanner
Deutscher Stadtplandienst
Drive Alive! Route Planner
Expedia
Fahrinfo Berlin
Falk.de Routenplaner
Free.fr Itinéraires
Freetrip.com
Google Maps
Green Flag Route Planning
Guia Campsa
InfoSpace
Iti.fr
KataWeb.it Mappe
klickTel.de
LeasePlan Nederland
Letsmove.be (also in French)
Lycos.de Routenplaner
Lycos.nl Routeplanner
Map24
Maporama.com
Mappy.com
MapQuest.com
Maps.com
Maps On Us
MSN Mappoint / Mapblast
Multimap.com
Onde Estou.br
Opel Route Planner
Planet.nl
QDQ.com
RAC Route Planner
Rand McNally Maps & Directions
RATP.fr
Reiseplanung.de / Routenplanung.de
Routemaster.nl
Routenet.nl / Routenet.be
Routenplaner-online.com
Routenplaner24.de
Routeplannerplaza.nl
Strassenroutenplaner.de / Strassenkarten-Europa.de
SuperPages.com / BigBook.com
T-Mobile Routenplaner
Terra.es Callejero
Touring.be (also in French)
Travelmate.com.au
VanAnaarB.nl
Veturo.com
Vialys.fr
ViaMichelin.com
Volkswagen.de Routenplaner
VTB/VAB.be (also in French)
Wanadoo.fr
Wanadoo.nl
Wannahaves.nl
Web.de
Yahoo! Deutschland Routenplaner
Yahoo! Driving Directions
Yahoo! France














