Hi, I guess nobody ever did Java Script routing for real, since routing usually involves going through a lot of data. As you normally have to retrieve this data from a server it's much easier just to let the server compute the route instead, possible making use of precomputation.
If you want to go ahead with this, take a look at Dijkstra's algorithm [1]. It requires a normal graph data structure ( an adjacency array should suffice ) as well as a priority queue ( e.g. a binary heap [2] ) Of course there exist more complex and efficient algorithms, but Dijkstra's should suffice for a first Java Script implementation. Best regards, Christian Vetter [1]: http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm [2]: http://en.wikipedia.org/wiki/Binary_heap On Sun, Jun 26, 2011 at 9:03 PM, Andreas Hubel <[email protected]> wrote: > Hi, > > as there is now an javascript renderer: has anyone of you experimented with > an routing algorithm in javascript? > > Where would you recommend to start? (which algorithm, data structures etc) > > Greets, Andi > > > > > _______________________________________________ > Routing mailing list > [email protected] > http://lists.openstreetmap.org/listinfo/routing > _______________________________________________ Routing mailing list [email protected] http://lists.openstreetmap.org/listinfo/routing
