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 220 by harbaum, Sat Nov 28 14:20:28 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      /* only draw wpts that don't equal the main point */
185      if(pos_differ(&cache->pos, &wpt->pos)) {
186        if(!isnan(wpt->pos.lat) && !isnan(wpt->pos.lon))  {
187          GdkPixbuf *icon =
188            icon_get(ICON_WPT, (wpt->sym!=WPT_SYM_UNKNOWN)?
189                     wpt->sym:WPT_SYM_REFPOINT);
190    
191          osm_gps_map_add_image(OSM_GPS_MAP(map),
192                                wpt->pos.lat, wpt->pos.lon, icon);
193        }
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;
# Line 333  static void map_setup(map_context_t *con Line 356  static void map_setup(map_context_t *con
356  #endif  #endif
357    }    }
358    
359      /* also mark geomath position */
360    
361      /* remove all existing appearances of this icon first */
362      osm_gps_map_remove_image(OSM_GPS_MAP(context->widget),
363                               icon_get(ICON_MISC, 6));
364    
365      if(!isnan(context->appdata->geomath.lat) &&
366         !isnan(context->appdata->geomath.lon))  {
367    
368        osm_gps_map_add_image(OSM_GPS_MAP(context->widget),
369                              context->appdata->geomath.lat,
370                              context->appdata->geomath.lon,
371                              icon_get(ICON_MISC, 6));
372      }
373    
374    if(name) {    if(name) {
375      char *title = g_strdup_printf(_("Map - %s"), name);      char *title = g_strdup_printf(_("Map - %s"), name);
376      g_free(name);      g_free(name);

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