--- trunk/src/cache.c 2009/06/26 20:07:33 12 +++ trunk/src/cache.c 2009/06/27 11:09:19 13 @@ -92,8 +92,11 @@ (GtkCallback)gtk_widget_destroy, NULL); /* update distance/etc */ - bearing_fill_hbox(context->bearing_hbox, context->appdata, - *get_pos(context->appdata), notes_get_pos(context)); + if(!isnan(context->cache->pos.lat) && + !isnan(context->cache->pos.lon)) + bearing_fill_hbox(context->bearing_hbox, context->appdata, + *get_pos(context->appdata), notes_get_pos(context)); + gtk_widget_show_all(context->bearing_hbox); } @@ -212,10 +215,12 @@ context->pos_lon_label = pos_lon(cache->pos.lon, SIZE_BIG, strike)); /* but calculations may be done with respect to the overriden one */ - context->bearing_hbox = gtk_hbox_new(FALSE, 0); - bearing_fill_hbox(context->bearing_hbox, appdata, *refpos, - gpx_cache_pos(cache)); - gtk_box_pack_start_defaults(GTK_BOX(ivbox), context->bearing_hbox); + if(!isnan(cache->pos.lat) && !isnan(cache->pos.lon)) { + context->bearing_hbox = gtk_hbox_new(FALSE, 0); + bearing_fill_hbox(context->bearing_hbox, appdata, *refpos, + gpx_cache_pos(cache)); + gtk_box_pack_start_defaults(GTK_BOX(ivbox), context->bearing_hbox); + } gtk_table_attach_defaults(GTK_TABLE(table), ivbox, 3,4,0,2);