Those of you who attended DevCon 2011 in San Diego may recall meeting Andries Heylen of BH&A, who cheerfully answered questions in the FileMaker Visionary Bar. Well, from the sow’s ear demo I posted in part 1, Andries has woven a silk purse (google-route-mapping-part-2), which I am sharing with his permission, and which uses Google “waypoints” to produce an optimized travel route.
Notes from Andries:
- The google distance API allows you to just send a start point, an end point and some waypoints (or just waypoints works as well) and returns the path to it in XML.
- In the XML there is a node that has an encrypted path in it that you can send back to the Static Google Maps API, which will return the image. I combined it with putting the markers on it as well, which are just one of the many parameters you can send to the API.
- I use some custom functions from Fabrice Nordmann and Andy Knasinski to parse out the XML, and there is the a custom function I made to convert the “content” created by the webviewer on Windows back into some nice XML
- The webviewer refreshes on datachanges, which makes this demo so interactive.
- The principle of Virtual List is used to show the Directions.
Thank you Andries for generously sharing this with the FileMaker community.