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

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

revision 72 by harbaum, Thu Aug 20 18:54:06 2009 UTC revision 73 by harbaum, Sun Aug 23 19:38:15 2009 UTC
# Line 23  Line 23 
23    
24  #ifdef ENABLE_OSM_GPS_MAP  #ifdef ENABLE_OSM_GPS_MAP
25  #include "osm-gps-map.h"  #include "osm-gps-map.h"
26    #include "osm-gps-map-osd-classic.h"
27  #endif  #endif
28    
29  #define MAP_SOURCE  OSM_GPS_MAP_SOURCE_OPENSTREETMAP  #define MAP_SOURCE  OSM_GPS_MAP_SOURCE_OPENSTREETMAP
# Line 67  static const char *get_proxy_uri(appdata Line 68  static const char *get_proxy_uri(appdata
68  }  }
69    
70  static void  static void
71  cb_map_gps(map_context_t *context) {  cb_map_gps(osd_button_t but, map_context_t *context) {
72    pos_t *refpos = get_pos(context->appdata);    if(but == OSD_GPS) {
73    if(refpos && !isnan(refpos->lat) && !isnan(refpos->lon)) {      pos_t *refpos = get_pos(context->appdata);
74      osm_gps_map_set_mapcenter(OSM_GPS_MAP(context->widget),      if(refpos && !isnan(refpos->lat) && !isnan(refpos->lon)) {
75                        refpos->lat, refpos->lon, GPS_DEFAULT_ZOOM);        osm_gps_map_set_mapcenter(OSM_GPS_MAP(context->widget),
76    } else {                                  refpos->lat, refpos->lon, GPS_DEFAULT_ZOOM);
77      /* no coordinates given: display the entire world */      } else {
78      osm_gps_map_set_mapcenter(OSM_GPS_MAP(context->widget),        /* no coordinates given: display the entire world */
79                                0.0, 0.0, 1);        osm_gps_map_set_mapcenter(OSM_GPS_MAP(context->widget),
80                                    0.0, 0.0, 1);
81        }
82    }    }
83  }  }
84    
# Line 92  static gboolean map_gps_update(gpointer Line 95  static gboolean map_gps_update(gpointer
95    
96    /* ... and enable "goto" button if it's valid */    /* ... and enable "goto" button if it's valid */
97    osm_gps_map_osd_enable_gps (OSM_GPS_MAP(context->widget),    osm_gps_map_osd_enable_gps (OSM_GPS_MAP(context->widget),
98                   OSM_GPS_MAP_OSD_GPS_CALLBACK(ok?cb_map_gps:NULL), context);                   OSM_GPS_MAP_OSD_CALLBACK(ok?cb_map_gps:NULL), context);
99    
100    if(ok) {    if(ok) {
101      float heading = NAN;      float heading = NAN;
# Line 144  static gboolean on_map_configure(GtkWidg Line 147  static gboolean on_map_configure(GtkWidg
147                              context->appdata->map.pos.lat,                              context->appdata->map.pos.lat,
148                              context->appdata->map.pos.lon,                              context->appdata->map.pos.lon,
149                              context->appdata->map.zoom);                              context->appdata->map.zoom);
150    
151    return FALSE;    return FALSE;
152  }  }
153    
# Line 464  void map(appdata_t *appdata) { Line 467  void map(appdata_t *appdata) {
467    
468    g_free(path);    g_free(path);
469    
470      osm_gps_map_osd_classic_init(OSM_GPS_MAP(context->widget));
471    
472    char *name = NULL;    char *name = NULL;
473  #ifdef USE_MAEMO  #ifdef USE_MAEMO
474    if(!appdata->cur_gpx) {    if(!appdata->cur_gpx) {

Legend:
Removed from v.72  
changed lines
  Added in v.73