Add:Core:Possibility to activate routing per map independent of rendering
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Wed, 2 Dec 2009 16:38:35 +0000 (16:38 +0000)
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Wed, 2 Dec 2009 16:38:35 +0000 (16:38 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@2819 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/attr_def.h
navit/navit/mapset.c
navit/navit/route.c
navit/navit/track.c

index c8a6c11..2f2690a 100644 (file)
@@ -180,6 +180,7 @@ ATTR(frame)
 ATTR(tell_street_name)
 ATTR(bluetooth)
 ATTR(signal_on_map_click)
+ATTR(route_active)
 ATTR2(0x0002ffff,type_int_end)
 ATTR2(0x00030000,type_string_begin)
 ATTR(type)
index 81e2103..a6846c5 100644 (file)
@@ -192,6 +192,13 @@ struct map * mapset_next(struct mapset_handle *msh, int active)
                msh->l=g_list_next(msh->l);
                if (!active)
                        return ret;                     
+               dbg(0,"active=%d\n",active);
+               if (active == 2 && map_get_attr(ret, attr_route_active, &active_attr, NULL)) {
+                       if (active_attr.u.num)
+                               return ret;
+                       else
+                               continue;
+               }
                if (!map_get_attr(ret, attr_active, &active_attr, NULL))
                        return ret;
                if (active_attr.u.num)
index d4f0d14..65cc9ed 100644 (file)
@@ -1995,7 +1995,7 @@ static int
 route_graph_build_next_map(struct route_graph *rg)
 {
        do {
-               rg->m=mapset_next(rg->h, 1);
+               rg->m=mapset_next(rg->h, 2);
                if (! rg->m)
                        return 0;
                map_rect_destroy(rg->mr);
@@ -2377,7 +2377,7 @@ route_find_nearest_street(struct vehicleprofile *vehicleprofile, struct mapset *
        mindist = INT_MAX;
 
        h=mapset_open(ms);
-       while ((m=mapset_next(h,1))) {
+       while ((m=mapset_next(h,2))) {
                c.x = pc->x;
                c.y = pc->y;
                if (map_projection(m) != pc->pro) {
index e48abd1..769fa14 100644 (file)
@@ -438,7 +438,7 @@ tracking_doupdate_lines(struct tracking *tr, struct coord *pc, enum projection p
 
        dbg(1,"enter\n");
        h=mapset_open(tr->ms);
-       while ((m=mapset_next(h,1))) {
+       while ((m=mapset_next(h,2))) {
                cc.x = pc->x;
                cc.y = pc->y;
                if (map_projection(m) != pro) {