]> err.no Git - mapper/commitdiff
Add real lat,lon to the store
authorKaj-Michael Lang <milang@onion.tal.org>
Wed, 13 Feb 2008 12:20:57 +0000 (14:20 +0200)
committerKaj-Michael Lang <milang@onion.tal.org>
Wed, 13 Feb 2008 12:20:57 +0000 (14:20 +0200)
src/mapper-types.h
src/route.c

index 17abe329f6e071fbf4416dc238a08a3fb7574383..9bee657b628715460de5b9cac7dc480a400eda66 100644 (file)
@@ -49,6 +49,8 @@ typedef enum {
        ROUTE_LATLON,
        ROUTE_DISTANCE,
        ROUTE_WAYPOINT,
+       ROUTE_LAT,
+       ROUTE_LON,
        ROUTE_NUM_COLUMNS
 } RouteList;
 
index bf3806da0b62818c6f44de088d376f09600e74c7..18cb83beff9e6f25ff7be8f51b2b652b4ebf8721 100644 (file)
@@ -759,7 +759,7 @@ if (!wcurr->point)
 
 unit2latlon(wcurr->point->unitx, wcurr->point->unity, lat1, lon1);
 
-store = gtk_list_store_new(ROUTE_NUM_COLUMNS,G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
+store = gtk_list_store_new(ROUTE_NUM_COLUMNS,G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_DOUBLE, G_TYPE_DOUBLE);
 
 while (wcurr!=route->wtail) {
        if (!wcurr)
@@ -770,16 +770,18 @@ while (wcurr!=route->wtail) {
        sum += calculate_distance(lat1, lon1, lat2, lon2);
        g_snprintf(buffer2, sizeof(buffer2), "%.02f %s", sum * UNITS_CONVERT[_units], UNITS_TEXT[_units]);
 
-       lat1=lat2;
-       lon1=lon2;
-
        gtk_list_store_append(store, &iter);
        gtk_list_store_set(store, &iter,
         ROUTE_LATLON, buffer1,
                ROUTE_DISTANCE, buffer2,
                ROUTE_WAYPOINT, wcurr->desc,
+               ROUTE_LAT, lat2,
+               ROUTE_LON, lon2,
                -1);
 
+       lat1=lat2;
+       lon1=lon2;
+
        wcurr++;
 }