GMap currently uses Google for routingservices, which is OK as long as you are using Google Maps as maptype. Personally I'd like to use OpenStreetMap maps hence the route can at some times differ from the map.
For this I need to be able to implement my own routing, be it an internet service or local.
So, I decoupled the routing functionality into an interface called IRoutingProvider. All I needed to do then was to implement it using an online OpenStreetMap routing service called YOURS (www.yournavigation.org).
The provider is exposed in GMaps.RoutingProvider. By default it's the Google service.
There is no change in how you request routes, the public methods in Gmaps for routing wraps the selected RoutingProvider.
For now these services are implemented:
- Google Maps - Same codebase as before
- Bing Maps -Not 100% optimal since it does not return point-by-point directions. Need to find another Bing map API call that returns more detailed routes. You need to provide your own ApplicationKey to the routing provider for it to work.
- YourNavigation - Except that they seem to have some capacity issues at the moment it works perfect with OpenStreetMap map!
Implent an offline alternative. There are OSM routing apps in Java and C with APIs you can call into to get GPX and KML routes. Even better would be .Net routing with .OSM data and Djikstras algorithm.
This is available in my fork https://hg01.codeplex.com/forks/viktorbergman/viktorbergman
I hope you will find it useful :)