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

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

revision 51 by harbaum, Wed Aug 12 12:16:05 2009 UTC revision 53 by harbaum, Wed Aug 12 19:18:53 2009 UTC
# Line 145  static gboolean map_gps_update(gpointer Line 145  static gboolean map_gps_update(gpointer
145    gtk_widget_set_sensitive(context->gps, ok);    gtk_widget_set_sensitive(context->gps, ok);
146    
147    if(ok) {    if(ok) {
148      float heading = context->appdata->use_gps?      float heading = NAN;
149        gps_get_heading(context->appdata):NAN;      int radius = 20;
150    
151     osm_gps_map_draw_gps(OSM_GPS_MAP(context->widget),      if(context->appdata->use_gps) {
152          heading = gps_get_heading(context->appdata);
153    
154          /* get error */
155          float eph = gps_get_eph(context->appdata);
156          if(!isnan(eph)) {
157    
158            /* world at zoom 1 == 512 pixels */
159            gint zoom;
160            g_object_get(OSM_GPS_MAP(context->widget), "zoom", &zoom, NULL);
161            float m_per_pix =
162              cos(DEG2RAD(refpos->lat))*2*M_PI*EQ_RADIUS/(1<<(8+zoom));
163    
164            radius = eph/m_per_pix;
165          }
166        }
167    
168        g_object_set(context->widget, "gps-track-highlight-radius", radius, NULL);
169        osm_gps_map_draw_gps(OSM_GPS_MAP(context->widget),
170                           refpos->lat, refpos->lon, heading);                           refpos->lat, refpos->lon, heading);
171    } else    } else
172      osm_gps_map_clear_gps(OSM_GPS_MAP(context->widget));      osm_gps_map_clear_gps(OSM_GPS_MAP(context->widget));
# Line 667  void map(appdata_t *appdata) { Line 685  void map(appdata_t *appdata) {
685                   NULL);                   NULL);
686    
687    if(proxy)    if(proxy)
688      g_object_set(OSM_GPS_MAP(context->widget),      g_object_set(OSM_GPS_MAP(context->widget), "proxy-uri", proxy, NULL);
                  "proxy-uri", proxy, NULL);  
689    
690    g_free(path);    g_free(path);
691    

Legend:
Removed from v.51  
changed lines
  Added in v.53