Diff of /trunk/src/map-tool.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 218 by harbaum, Fri Nov 27 08:58:48 2009 UTC revision 219 by harbaum, Fri Nov 27 17:10:57 2009 UTC
# Line 180  static void map_draw_cache(GtkWidget *ma Line 180  static void map_draw_cache(GtkWidget *ma
180    }    }
181  }  }
182    
183    static void map_draw_wpt(GtkWidget *map, cache_t *cache, wpt_t *wpt) {
184    
185      /* only draw wpts that don't equal the main point */
186      if(pos_differ(&cache->pos, &wpt->pos)) {
187        GdkPixbuf *icon =
188          icon_get(ICON_WPT, (wpt->sym!=WPT_SYM_UNKNOWN)?
189                   wpt->sym:WPT_SYM_REFPOINT);
190    
191        if(!isnan(wpt->pos.lat) && !isnan(wpt->pos.lon))
192          osm_gps_map_add_image(OSM_GPS_MAP(map),
193                                wpt->pos.lat, wpt->pos.lon, icon);
194      }
195    }
196    
197  static void map_draw_gpx(appdata_t *appdata, cache_display_t *caches,  static void map_draw_gpx(appdata_t *appdata, cache_display_t *caches,
198                           GtkWidget *map, gpx_t *gpx,                           GtkWidget *map, gpx_t *gpx,
199                           cache_t *nav, gboolean semi) {                           cache_t *nav, gboolean semi) {
# Line 200  static void map_draw_gpx(appdata_t *appd Line 214  static void map_draw_gpx(appdata_t *appd
214        /* if nav is not given do what semi sais */        /* if nav is not given do what semi sais */
215        map_draw_cache(map, cache, nav?(cache != nav):semi);        map_draw_cache(map, cache, nav?(cache != nav):semi);
216        caches[i].id = cache->id;        caches[i].id = cache->id;
217    
218          /* also draw waypoints of nav cache */
219          if(nav && cache == nav) {
220            wpt_t *wpt = cache->wpt;
221            while(wpt) {
222              map_draw_wpt(map, cache, wpt);
223              wpt = wpt->next;
224            }
225          }
226      }      }
227    
228      cache = cache->next;      cache = cache->next;

Legend:
Removed from v.218  
changed lines
  Added in v.219