17 |
* along with GPXView. If not, see <http://www.gnu.org/licenses/>. |
* along with GPXView. If not, see <http://www.gnu.org/licenses/>. |
18 |
*/ |
*/ |
19 |
|
|
20 |
|
/* |
21 |
|
* http://topo.geofabrik.de/relief/${z}/${x}/${y}.png 8-15 |
22 |
|
* http://topo.geofabrik.de/trail/${z}/${x}/${y}.png 8-15 |
23 |
|
*/ |
24 |
|
|
25 |
#include "gpxview.h" |
#include "gpxview.h" |
26 |
#include "converter.h" |
#include "converter.h" |
27 |
#include <math.h> // for isnan |
#include <math.h> // for isnan |
38 |
|
|
39 |
// #define MAP_SOURCE OSM_GPS_MAP_SOURCE_OPENSTREETMAP |
// #define MAP_SOURCE OSM_GPS_MAP_SOURCE_OPENSTREETMAP |
40 |
#define MAP_SOURCE OSM_GPS_MAP_SOURCE_OPENCYCLEMAP |
#define MAP_SOURCE OSM_GPS_MAP_SOURCE_OPENCYCLEMAP |
41 |
|
// #define MAP_SOURCE OSM_GPS_MAP_SOURCE_GOOGLE_STREET |
42 |
#define GPS_DEFAULT_ZOOM 13 |
#define GPS_DEFAULT_ZOOM 13 |
43 |
|
|
44 |
#define PROXY_KEY "/system/http_proxy/" |
#define PROXY_KEY "/system/http_proxy/" |
242 |
GdkEventButton *event, map_context_t *context) { |
GdkEventButton *event, map_context_t *context) { |
243 |
OsmGpsMap *map = OSM_GPS_MAP(context->widget); |
OsmGpsMap *map = OSM_GPS_MAP(context->widget); |
244 |
|
|
245 |
|
/* check if we actually clicked parts of the OSD */ |
246 |
|
if(osm_gps_map_osd_check(map, event->x, event->y) != OSD_NONE) |
247 |
|
return FALSE; |
248 |
|
|
249 |
/* got a press event without release event? eat it! */ |
/* got a press event without release event? eat it! */ |
250 |
if(context->press_on != NULL) { |
if(context->press_on != NULL) { |
251 |
printf("PRESS: already\n"); |
printf("PRESS: already\n"); |
252 |
return TRUE; |
return FALSE; |
253 |
} |
} |
254 |
|
|
255 |
pos_t pos = |
pos_t pos = |
457 |
context->appdata->map.pos.lat = lat; |
context->appdata->map.pos.lat = lat; |
458 |
context->appdata->map.pos.lon = lon; |
context->appdata->map.pos.lon = lon; |
459 |
|
|
460 |
|
gint source; |
461 |
|
g_object_get(map, "map-source", &source, NULL); |
462 |
|
context->appdata->map.source = source; |
463 |
|
|
464 |
#if MAEMO_VERSION_MAJOR == 5 |
#if MAEMO_VERSION_MAJOR == 5 |
465 |
/* restore cur_view */ |
/* restore cur_view */ |
466 |
context->appdata->cur_view = context->old_view; |
context->appdata->cur_view = context->old_view; |
530 |
|
|
531 |
const char *proxy = get_proxy_uri(appdata); |
const char *proxy = get_proxy_uri(appdata); |
532 |
|
|
533 |
|
gint source = context->appdata->map.source; |
534 |
|
if(!source) source = MAP_SOURCE; |
535 |
|
|
536 |
context->widget = g_object_new(OSM_TYPE_GPS_MAP, |
context->widget = g_object_new(OSM_TYPE_GPS_MAP, |
537 |
"map-source", MAP_SOURCE, |
"map-source", source, |
538 |
"tile-cache", path, |
"tile-cache", path, |
539 |
"auto-center", FALSE, |
"auto-center", FALSE, |
540 |
"record-trip-history", FALSE, |
"record-trip-history", FALSE, |