In NetMaps.clw you call a proc to Draw all routes, it is like:
NetMapsBase.DrawRoutes Procedure(Long pDisplay=true)
doneRoute like(self.RouteQueue.Id)
x long
Code
loop x = 1 to records(self.RouteQueue)
get(self.RouteQueue,x)
if self.RouteQueue.Id <> doneRoute
self._DrawRoute(self.RouteQueue.Id)
doneRoute = self.RouteQueue.Id
end
end
self.RouteQueue has ALL the wps of ALL routes
you are trying to call self._DrawRoute once each time the route ID changes
but self._DrawRoute does not filter by self.RouteQueue.Id and loops over all the waypoint of the routes
and at the end self.RouteQueue.Id is not the original route id but the last
then all the following records are different from doneRoute and the routine is called thouthand of times
to solve this you have to put the line:
doneRoute = self.RouteQueue.Id
before
self._DrawRoute(self.RouteQueue.Id)
But you still have a problem, self._DrawRoute is not filtering by route id, then when you have many routes the last wps of one route is linked with the first of the next route.
Another problem is that self._DrawRoute is taking the first record of the queue as the fisrt wp.
So you need to change the self._DrawRoute logic to draw only the wps of the route ID.
The queue is suppouse to be sorted by ID and the order obtained by the optimization.
So get the first route.Id record and loop till it change may be a solution.
Hope this helps