66 |
#include <gdk/gdkkeysyms.h> |
#include <gdk/gdkkeysyms.h> |
67 |
#endif |
#endif |
68 |
|
|
69 |
|
#define USER_AGENT "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11" |
70 |
|
|
71 |
struct _OsmGpsMapPrivate |
struct _OsmGpsMapPrivate |
72 |
{ |
{ |
73 |
GHashTable *tile_queue; |
GHashTable *tile_queue; |
97 |
char *proxy_uri; |
char *proxy_uri; |
98 |
|
|
99 |
//where downloaded tiles are cached |
//where downloaded tiles are cached |
100 |
|
char *tile_dir; |
101 |
char *cache_dir; |
char *cache_dir; |
102 |
|
|
103 |
//contains flags indicating the various special characters |
//contains flags indicating the various special characters |
115 |
gboolean show_trip_history; |
gboolean show_trip_history; |
116 |
GSList *trip_history; |
GSList *trip_history; |
117 |
coord_t *gps; |
coord_t *gps; |
118 |
|
float gps_heading; |
119 |
gboolean gps_valid; |
gboolean gps_valid; |
120 |
|
|
121 |
#ifdef ENABLE_BALLOON |
#ifdef ENABLE_BALLOON |
352 |
inspect_map_uri(OsmGpsMap *map) |
inspect_map_uri(OsmGpsMap *map) |
353 |
{ |
{ |
354 |
OsmGpsMapPrivate *priv = map->priv; |
OsmGpsMapPrivate *priv = map->priv; |
355 |
|
priv->uri_format = 0; |
356 |
|
priv->the_google = FALSE; |
357 |
|
|
358 |
if (g_strrstr(priv->repo_uri, URI_MARKER_X)) |
if (g_strrstr(priv->repo_uri, URI_MARKER_X)) |
359 |
priv->uri_format |= URI_HAS_X; |
priv->uri_format |= URI_HAS_X; |
590 |
int x, y; |
int x, y; |
591 |
int r = priv->ui_gps_point_inner_radius; |
int r = priv->ui_gps_point_inner_radius; |
592 |
int r2 = priv->ui_gps_point_outer_radius; |
int r2 = priv->ui_gps_point_outer_radius; |
593 |
// int lw = priv->ui_gps_track_width; |
int mr = MAX(3*r,r2); |
|
int mr = MAX(r,r2); |
|
594 |
|
|
595 |
map_x0 = priv->map_x - EXTRA_BORDER; |
map_x0 = priv->map_x - EXTRA_BORDER; |
596 |
map_y0 = priv->map_y - EXTRA_BORDER; |
map_y0 = priv->map_y - EXTRA_BORDER; |
621 |
|
|
622 |
// draw ball gradient |
// draw ball gradient |
623 |
if (r > 0) { |
if (r > 0) { |
624 |
|
// draw direction arrow |
625 |
|
if(!isnan(priv->gps_heading)) |
626 |
|
{ |
627 |
|
cairo_move_to (cr, x-r*cos(priv->gps_heading), y-r*sin(priv->gps_heading)); |
628 |
|
cairo_line_to (cr, x+3*r*sin(priv->gps_heading), y-3*r*cos(priv->gps_heading)); |
629 |
|
cairo_line_to (cr, x+r*cos(priv->gps_heading), y+r*sin(priv->gps_heading)); |
630 |
|
cairo_close_path (cr); |
631 |
|
|
632 |
|
cairo_set_source_rgba (cr, 0.3, 0.3, 1.0, 0.5); |
633 |
|
cairo_fill_preserve (cr); |
634 |
|
|
635 |
|
cairo_set_line_width (cr, 1.0); |
636 |
|
cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, 0.5); |
637 |
|
cairo_stroke(cr); |
638 |
|
} |
639 |
|
|
640 |
pat = cairo_pattern_create_radial (x-(r/5), y-(r/5), (r/5), x, y, r); |
pat = cairo_pattern_create_radial (x-(r/5), y-(r/5), (r/5), x, y, r); |
641 |
cairo_pattern_add_color_stop_rgba (pat, 0, 1, 1, 1, 1.0); |
cairo_pattern_add_color_stop_rgba (pat, 0, 1, 1, 1, 1.0); |
642 |
cairo_pattern_add_color_stop_rgba (pat, 1, 0, 0, 1, 1.0); |
cairo_pattern_add_color_stop_rgba (pat, 1, 0, 0, 1, 1.0); |
650 |
cairo_arc (cr, x, y, r, 0, 2 * M_PI); |
cairo_arc (cr, x, y, r, 0, 2 * M_PI); |
651 |
cairo_stroke(cr); |
cairo_stroke(cr); |
652 |
} |
} |
653 |
|
|
654 |
cairo_destroy(cr); |
cairo_destroy(cr); |
655 |
gtk_widget_queue_draw_area (GTK_WIDGET(map), |
gtk_widget_queue_draw_area (GTK_WIDGET(map), |
656 |
x-mr, |
x-mr, |
1115 |
} |
} |
1116 |
} |
} |
1117 |
|
|
1118 |
|
#ifdef LIBSOUP22 |
1119 |
|
soup_message_headers_append(msg->request_headers, |
1120 |
|
"User-Agent", USER_AGENT); |
1121 |
|
#endif |
1122 |
|
|
1123 |
g_hash_table_insert (priv->tile_queue, dl->uri, msg); |
g_hash_table_insert (priv->tile_queue, dl->uri, msg); |
1124 |
soup_session_queue_message (priv->soup_session, msg, osm_gps_map_tile_download_complete, dl); |
soup_session_queue_message (priv->soup_session, msg, osm_gps_map_tile_download_complete, dl); |
1125 |
} else { |
} else { |
1472 |
|
|
1473 |
priv->idle_map_redraw = 0; |
priv->idle_map_redraw = 0; |
1474 |
|
|
1475 |
|
/* don't redraw the entire map while the OSD is doing */ |
1476 |
|
/* some animation or the like. This is to keep the animation */ |
1477 |
|
/* fluid */ |
1478 |
|
if (priv->osd->busy(priv->osd)) |
1479 |
|
return FALSE; |
1480 |
|
|
1481 |
/* the motion_notify handler uses priv->pixmap to redraw the area; if we |
/* the motion_notify handler uses priv->pixmap to redraw the area; if we |
1482 |
* change it while we are dragging, we will end up showing it in the wrong |
* change it while we are dragging, we will end up showing it in the wrong |
1483 |
* place. This could be fixed by carefully recompute the coordinates, but |
* place. This could be fixed by carefully recompute the coordinates, but |
1528 |
gboolean handled = FALSE; |
gboolean handled = FALSE; |
1529 |
int step = GTK_WIDGET(widget)->allocation.width/OSM_GPS_MAP_SCROLL_STEP; |
int step = GTK_WIDGET(widget)->allocation.width/OSM_GPS_MAP_SCROLL_STEP; |
1530 |
|
|
|
// printf("key event with keyval %x\n", event->keyval); |
|
|
|
|
1531 |
// the map handles some keys on its own ... |
// the map handles some keys on its own ... |
1532 |
switch(event->keyval) { |
switch(event->keyval) { |
1533 |
#ifdef OSM_GPS_MAP_KEY_FULLSCREEN |
#ifdef OSM_GPS_MAP_KEY_FULLSCREEN |
1594 |
#endif |
#endif |
1595 |
|
|
1596 |
default: |
default: |
|
// printf("unhandled key event with keyval %x\n", event->keyval); |
|
1597 |
break; |
break; |
1598 |
} |
} |
1599 |
|
|
1614 |
priv->trip_history = NULL; |
priv->trip_history = NULL; |
1615 |
priv->gps = g_new0(coord_t, 1); |
priv->gps = g_new0(coord_t, 1); |
1616 |
priv->gps_valid = FALSE; |
priv->gps_valid = FALSE; |
1617 |
|
priv->gps_heading = OSM_GPS_MAP_INVALID; |
1618 |
|
|
1619 |
#ifdef ENABLE_BALLOON |
#ifdef ENABLE_BALLOON |
1620 |
priv->balloon.coo = g_new0(coord_t, 1); |
priv->balloon.coo = g_new0(coord_t, 1); |
1646 |
|
|
1647 |
#ifndef LIBSOUP22 |
#ifndef LIBSOUP22 |
1648 |
//Change naumber of concurrent connections option? |
//Change naumber of concurrent connections option? |
1649 |
priv->soup_session = soup_session_async_new_with_options( |
priv->soup_session = |
1650 |
SOUP_SESSION_USER_AGENT, |
soup_session_async_new_with_options(SOUP_SESSION_USER_AGENT, |
1651 |
"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11", |
USER_AGENT, NULL); |
|
NULL); |
|
1652 |
#else |
#else |
1653 |
/* libsoup-2.2 seems not to be able to set the user agent */ |
/* libsoup-2.2 has no special way to set the user agent, so we */ |
1654 |
|
/* set it seperately as an extra header field for each reuest */ |
1655 |
priv->soup_session = soup_session_async_new(); |
priv->soup_session = soup_session_async_new(); |
1656 |
#endif |
#endif |
1657 |
|
|
1676 |
g_log_set_handler (G_LOG_DOMAIN, G_LOG_LEVEL_MASK, my_log_handler, NULL); |
g_log_set_handler (G_LOG_DOMAIN, G_LOG_LEVEL_MASK, my_log_handler, NULL); |
1677 |
|
|
1678 |
#ifdef OSM_GPS_MAP_KEYS |
#ifdef OSM_GPS_MAP_KEYS |
|
// GtkWidget *toplevel = gtk_widget_get_toplevel(GTK_WIDGET(object)); |
|
1679 |
g_signal_connect(G_OBJECT(object), "key_press_event", |
g_signal_connect(G_OBJECT(object), "key_press_event", |
1680 |
G_CALLBACK(on_window_key_press), priv); |
G_CALLBACK(on_window_key_press), priv); |
1681 |
#endif |
#endif |
1682 |
} |
} |
1683 |
|
|
1684 |
static GObject * |
static void |
1685 |
osm_gps_map_constructor (GType gtype, guint n_properties, GObjectConstructParam *properties) |
osm_gps_map_setup(OsmGpsMapPrivate *priv) { |
|
{ |
|
|
GObject *object; |
|
|
OsmGpsMapPrivate *priv; |
|
|
OsmGpsMap *map; |
|
1686 |
const char *uri; |
const char *uri; |
1687 |
|
|
|
//Always chain up to the parent constructor |
|
|
object = G_OBJECT_CLASS(osm_gps_map_parent_class)->constructor(gtype, n_properties, properties); |
|
|
map = OSM_GPS_MAP(object); |
|
|
priv = OSM_GPS_MAP_PRIVATE(object); |
|
|
|
|
1688 |
//user can specify a map source ID, or a repo URI as the map source |
//user can specify a map source ID, or a repo URI as the map source |
1689 |
uri = osm_gps_map_source_get_repo_uri(OSM_GPS_MAP_SOURCE_NULL); |
uri = osm_gps_map_source_get_repo_uri(OSM_GPS_MAP_SOURCE_NULL); |
1690 |
if ( (priv->map_source == 0) || (strcmp(priv->repo_uri, uri) == 0) ) { |
if ( (priv->map_source == 0) || (strcmp(priv->repo_uri, uri) == 0) ) { |
1712 |
const char *fname = osm_gps_map_source_get_friendly_name(priv->map_source); |
const char *fname = osm_gps_map_source_get_friendly_name(priv->map_source); |
1713 |
if(!fname) fname = "_unknown_"; |
if(!fname) fname = "_unknown_"; |
1714 |
|
|
1715 |
if (priv->cache_dir) { |
if (priv->tile_dir) { |
1716 |
char *old = priv->cache_dir; |
//the new cachedir is the given cache dir + the friendly name of the repo_uri |
1717 |
//the new cachedir is the given cache dir + the md5 of the repo_uri |
priv->cache_dir = g_strdup_printf("%s%c%s", priv->tile_dir, G_DIR_SEPARATOR, fname); |
1718 |
priv->cache_dir = g_strdup_printf("%s%c%s", old, G_DIR_SEPARATOR, fname); |
g_debug("Adjusting cache dir %s -> %s", priv->tile_dir, priv->cache_dir); |
|
g_debug("Adjusting cache dir %s -> %s", old, priv->cache_dir); |
|
|
g_free(old); |
|
1719 |
} |
} |
1720 |
|
} |
1721 |
|
|
1722 |
inspect_map_uri(map); |
static GObject * |
1723 |
|
osm_gps_map_constructor (GType gtype, guint n_properties, GObjectConstructParam *properties) |
1724 |
|
{ |
1725 |
|
//Always chain up to the parent constructor |
1726 |
|
GObject *object = |
1727 |
|
G_OBJECT_CLASS(osm_gps_map_parent_class)->constructor(gtype, n_properties, properties); |
1728 |
|
|
1729 |
|
osm_gps_map_setup(OSM_GPS_MAP_PRIVATE(object)); |
1730 |
|
|
1731 |
|
inspect_map_uri(OSM_GPS_MAP(object)); |
1732 |
|
|
1733 |
return object; |
return object; |
1734 |
} |
} |
1790 |
OsmGpsMap *map = OSM_GPS_MAP(object); |
OsmGpsMap *map = OSM_GPS_MAP(object); |
1791 |
OsmGpsMapPrivate *priv = map->priv; |
OsmGpsMapPrivate *priv = map->priv; |
1792 |
|
|
1793 |
g_free(priv->cache_dir); |
if(priv->tile_dir) |
1794 |
|
g_free(priv->tile_dir); |
1795 |
|
|
1796 |
|
if(priv->cache_dir) |
1797 |
|
g_free(priv->cache_dir); |
1798 |
|
|
1799 |
g_free(priv->repo_uri); |
g_free(priv->repo_uri); |
1800 |
g_free(priv->image_format); |
g_free(priv->image_format); |
1801 |
|
|
1852 |
break; |
break; |
1853 |
case PROP_TILE_CACHE_DIR: |
case PROP_TILE_CACHE_DIR: |
1854 |
if ( g_value_get_string(value) ) |
if ( g_value_get_string(value) ) |
1855 |
priv->cache_dir = g_value_dup_string (value); |
priv->tile_dir = g_value_dup_string (value); |
1856 |
break; |
break; |
1857 |
case PROP_ZOOM: |
case PROP_ZOOM: |
1858 |
priv->map_zoom = g_value_get_int (value); |
priv->map_zoom = g_value_get_int (value); |
1880 |
case PROP_GPS_POINT_R2: |
case PROP_GPS_POINT_R2: |
1881 |
priv->ui_gps_point_outer_radius = g_value_get_int (value); |
priv->ui_gps_point_outer_radius = g_value_get_int (value); |
1882 |
break; |
break; |
1883 |
case PROP_MAP_SOURCE: |
case PROP_MAP_SOURCE: { |
1884 |
|
gint old = priv->map_source; |
1885 |
priv->map_source = g_value_get_int (value); |
priv->map_source = g_value_get_int (value); |
1886 |
break; |
if(old >= OSM_GPS_MAP_SOURCE_NULL && |
1887 |
|
priv->map_source != old && |
1888 |
|
priv->map_source >= OSM_GPS_MAP_SOURCE_NULL && |
1889 |
|
priv->map_source <= OSM_GPS_MAP_SOURCE_LAST) { |
1890 |
|
|
1891 |
|
/* we now have to switch the entire map */ |
1892 |
|
|
1893 |
|
/* flush the ram cache */ |
1894 |
|
g_hash_table_remove_all(priv->tile_cache); |
1895 |
|
|
1896 |
|
osm_gps_map_setup(priv); |
1897 |
|
|
1898 |
|
inspect_map_uri(map); |
1899 |
|
|
1900 |
|
/* adjust zoom if necessary */ |
1901 |
|
if(priv->map_zoom > priv->max_zoom) |
1902 |
|
osm_gps_map_set_zoom(map, priv->max_zoom); |
1903 |
|
|
1904 |
|
if(priv->map_zoom < priv->min_zoom) |
1905 |
|
osm_gps_map_set_zoom(map, priv->min_zoom); |
1906 |
|
|
1907 |
|
} } break; |
1908 |
case PROP_IMAGE_FORMAT: |
case PROP_IMAGE_FORMAT: |
1909 |
priv->image_format = g_value_dup_string (value); |
priv->image_format = g_value_dup_string (value); |
1910 |
break; |
break; |
2041 |
case OSD_UP: |
case OSD_UP: |
2042 |
priv->map_y -= step; |
priv->map_y -= step; |
2043 |
priv->center_coord_set = FALSE; |
priv->center_coord_set = FALSE; |
2044 |
|
g_object_set(G_OBJECT(widget), "auto-center", FALSE, NULL); |
2045 |
osm_gps_map_map_redraw_idle(OSM_GPS_MAP(widget)); |
osm_gps_map_map_redraw_idle(OSM_GPS_MAP(widget)); |
2046 |
break; |
break; |
2047 |
|
|
2048 |
case OSD_DOWN: |
case OSD_DOWN: |
2049 |
priv->map_y += step; |
priv->map_y += step; |
2050 |
priv->center_coord_set = FALSE; |
priv->center_coord_set = FALSE; |
2051 |
|
g_object_set(G_OBJECT(widget), "auto-center", FALSE, NULL); |
2052 |
osm_gps_map_map_redraw_idle(OSM_GPS_MAP(widget)); |
osm_gps_map_map_redraw_idle(OSM_GPS_MAP(widget)); |
2053 |
break; |
break; |
2054 |
|
|
2055 |
case OSD_LEFT: |
case OSD_LEFT: |
2056 |
priv->map_x -= step; |
priv->map_x -= step; |
2057 |
priv->center_coord_set = FALSE; |
priv->center_coord_set = FALSE; |
2058 |
|
g_object_set(G_OBJECT(widget), "auto-center", FALSE, NULL); |
2059 |
osm_gps_map_map_redraw_idle(OSM_GPS_MAP(widget)); |
osm_gps_map_map_redraw_idle(OSM_GPS_MAP(widget)); |
2060 |
break; |
break; |
2061 |
|
|
2062 |
case OSD_RIGHT: |
case OSD_RIGHT: |
2063 |
priv->map_x += step; |
priv->map_x += step; |
2064 |
priv->center_coord_set = FALSE; |
priv->center_coord_set = FALSE; |
2065 |
|
g_object_set(G_OBJECT(widget), "auto-center", FALSE, NULL); |
2066 |
osm_gps_map_map_redraw_idle(OSM_GPS_MAP(widget)); |
osm_gps_map_map_redraw_idle(OSM_GPS_MAP(widget)); |
2067 |
break; |
break; |
2068 |
|
|
2512 |
-1, /* minimum property value */ |
-1, /* minimum property value */ |
2513 |
G_MAXINT, /* maximum property value */ |
G_MAXINT, /* maximum property value */ |
2514 |
-1, |
-1, |
2515 |
G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); |
G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT)); |
2516 |
|
|
2517 |
g_object_class_install_property (object_class, |
g_object_class_install_property (object_class, |
2518 |
PROP_IMAGE_FORMAT, |
PROP_IMAGE_FORMAT, |
2531 |
case OSM_GPS_MAP_SOURCE_NULL: |
case OSM_GPS_MAP_SOURCE_NULL: |
2532 |
return "None"; |
return "None"; |
2533 |
case OSM_GPS_MAP_SOURCE_OPENSTREETMAP: |
case OSM_GPS_MAP_SOURCE_OPENSTREETMAP: |
2534 |
return "OpenStreetMap"; |
return "OpenStreetMap I"; |
2535 |
case OSM_GPS_MAP_SOURCE_OPENSTREETMAP_RENDERER: |
case OSM_GPS_MAP_SOURCE_OPENSTREETMAP_RENDERER: |
2536 |
return "OpenStreetMap Renderer"; |
return "OpenStreetMap II"; |
2537 |
case OSM_GPS_MAP_SOURCE_OPENCYCLEMAP: |
case OSM_GPS_MAP_SOURCE_OPENCYCLEMAP: |
2538 |
return "OpenCycleMap"; |
return "OpenCycleMap"; |
2539 |
|
case OSM_GPS_MAP_SOURCE_OSMC_TRAILS: |
2540 |
|
return "OSMC Trails"; |
2541 |
case OSM_GPS_MAP_SOURCE_MAPS_FOR_FREE: |
case OSM_GPS_MAP_SOURCE_MAPS_FOR_FREE: |
2542 |
return "Maps-For-Free"; |
return "Maps-For-Free"; |
2543 |
case OSM_GPS_MAP_SOURCE_GOOGLE_STREET: |
case OSM_GPS_MAP_SOURCE_GOOGLE_STREET: |
2581 |
return "http://tah.openstreetmap.org/Tiles/tile/#Z/#X/#Y.png"; |
return "http://tah.openstreetmap.org/Tiles/tile/#Z/#X/#Y.png"; |
2582 |
case OSM_GPS_MAP_SOURCE_OPENCYCLEMAP: |
case OSM_GPS_MAP_SOURCE_OPENCYCLEMAP: |
2583 |
return "http://c.andy.sandbox.cloudmade.com/tiles/cycle/#Z/#X/#Y.png"; |
return "http://c.andy.sandbox.cloudmade.com/tiles/cycle/#Z/#X/#Y.png"; |
2584 |
|
case OSM_GPS_MAP_SOURCE_OSMC_TRAILS: |
2585 |
|
return "http://topo.geofabrik.de/trails/#Z/#X/#Y.png"; |
2586 |
case OSM_GPS_MAP_SOURCE_MAPS_FOR_FREE: |
case OSM_GPS_MAP_SOURCE_MAPS_FOR_FREE: |
2587 |
return "http://maps-for-free.com/layer/relief/z#Z/row#Y/#Z_#X-#Y.jpg"; |
return "http://maps-for-free.com/layer/relief/z#Z/row#Y/#Z_#X-#Y.jpg"; |
2588 |
case OSM_GPS_MAP_SOURCE_GOOGLE_STREET: |
case OSM_GPS_MAP_SOURCE_GOOGLE_STREET: |
2621 |
case OSM_GPS_MAP_SOURCE_OPENSTREETMAP: |
case OSM_GPS_MAP_SOURCE_OPENSTREETMAP: |
2622 |
case OSM_GPS_MAP_SOURCE_OPENSTREETMAP_RENDERER: |
case OSM_GPS_MAP_SOURCE_OPENSTREETMAP_RENDERER: |
2623 |
case OSM_GPS_MAP_SOURCE_OPENCYCLEMAP: |
case OSM_GPS_MAP_SOURCE_OPENCYCLEMAP: |
2624 |
|
case OSM_GPS_MAP_SOURCE_OSMC_TRAILS: |
2625 |
return "png"; |
return "png"; |
2626 |
|
case OSM_GPS_MAP_SOURCE_MAPS_FOR_FREE: |
2627 |
case OSM_GPS_MAP_SOURCE_GOOGLE_STREET: |
case OSM_GPS_MAP_SOURCE_GOOGLE_STREET: |
2628 |
|
case OSM_GPS_MAP_SOURCE_GOOGLE_SATELLITE: |
2629 |
case OSM_GPS_MAP_SOURCE_GOOGLE_HYBRID: |
case OSM_GPS_MAP_SOURCE_GOOGLE_HYBRID: |
2630 |
case OSM_GPS_MAP_SOURCE_VIRTUAL_EARTH_STREET: |
case OSM_GPS_MAP_SOURCE_VIRTUAL_EARTH_STREET: |
2631 |
case OSM_GPS_MAP_SOURCE_VIRTUAL_EARTH_SATELLITE: |
case OSM_GPS_MAP_SOURCE_VIRTUAL_EARTH_SATELLITE: |
2633 |
case OSM_GPS_MAP_SOURCE_YAHOO_STREET: |
case OSM_GPS_MAP_SOURCE_YAHOO_STREET: |
2634 |
case OSM_GPS_MAP_SOURCE_YAHOO_SATELLITE: |
case OSM_GPS_MAP_SOURCE_YAHOO_SATELLITE: |
2635 |
case OSM_GPS_MAP_SOURCE_YAHOO_HYBRID: |
case OSM_GPS_MAP_SOURCE_YAHOO_HYBRID: |
|
case OSM_GPS_MAP_SOURCE_MAPS_FOR_FREE: |
|
|
case OSM_GPS_MAP_SOURCE_GOOGLE_SATELLITE: |
|
2636 |
return "jpg"; |
return "jpg"; |
2637 |
default: |
default: |
2638 |
return "bin"; |
return "bin"; |
2666 |
case OSM_GPS_MAP_SOURCE_YAHOO_SATELLITE: |
case OSM_GPS_MAP_SOURCE_YAHOO_SATELLITE: |
2667 |
case OSM_GPS_MAP_SOURCE_YAHOO_HYBRID: |
case OSM_GPS_MAP_SOURCE_YAHOO_HYBRID: |
2668 |
return 17; |
return 17; |
2669 |
|
case OSM_GPS_MAP_SOURCE_OSMC_TRAILS: |
2670 |
|
return 15; |
2671 |
case OSM_GPS_MAP_SOURCE_MAPS_FOR_FREE: |
case OSM_GPS_MAP_SOURCE_MAPS_FOR_FREE: |
2672 |
return 11; |
return 11; |
2673 |
case OSM_GPS_MAP_SOURCE_GOOGLE_SATELLITE: |
case OSM_GPS_MAP_SOURCE_GOOGLE_SATELLITE: |
2903 |
priv->gps->rlat = deg2rad(latitude); |
priv->gps->rlat = deg2rad(latitude); |
2904 |
priv->gps->rlon = deg2rad(longitude); |
priv->gps->rlon = deg2rad(longitude); |
2905 |
priv->gps_valid = TRUE; |
priv->gps_valid = TRUE; |
2906 |
|
priv->gps_heading = deg2rad(heading); |
2907 |
|
|
2908 |
// pixel_x,y, offsets |
// pixel_x,y, offsets |
2909 |
pixel_x = lon2pixel(priv->map_zoom, priv->gps->rlon); |
pixel_x = lon2pixel(priv->map_zoom, priv->gps->rlon); |
3018 |
{ |
{ |
3019 |
OsmGpsMapPrivate *priv; |
OsmGpsMapPrivate *priv; |
3020 |
|
|
3021 |
g_return_val_if_fail (OSM_IS_GPS_MAP (map), OSM_NAN); |
g_return_val_if_fail (OSM_IS_GPS_MAP (map), OSM_GPS_MAP_INVALID); |
3022 |
priv = map->priv; |
priv = map->priv; |
3023 |
|
|
3024 |
return osm_gps_map_get_scale_at_point(priv->map_zoom, priv->center_rlat, priv->center_rlon); |
return osm_gps_map_get_scale_at_point(priv->map_zoom, priv->center_rlat, priv->center_rlon); |