#include "settings.h"
#include "mapper-types.h"
#include "ui-common.h"
+#include "latlon.h"
+#include "route.h"
void
gps_display_data_speed(GtkWidget *widget, gfloat s)
widget->style->fg_gc[GTK_STATE_NORMAL],
x, y, _heading_panel_layout);
g_free(text);
+
+ if (_dest.valid || _next_way) {
+ GdkColor color;
+ GdkGC *gc;
+ gdouble t;
+
+ gc = gdk_gc_new(widget->window);
+ gdk_gc_set_line_attributes(gc, 6, GDK_LINE_SOLID, GDK_CAP_ROUND, GDK_JOIN_ROUND);
+
+ if (_dest.valid) {
+ gdouble dc=calculate_course(_gps.lat,_gps.lon, _dest.lat, _dest.lon);
+
+ color.red = 0x5000;
+ color.green = 0xffff;
+ color.blue = 0;
+ gdk_gc_set_rgb_fg_color(gc, &color);
+
+ t = ((dc-_gps.heading) * (1.f / 180.f)) * PI;
+ gdk_draw_line(widget->window,gc,
+ xoffset + size / 2 + ((size / 2 - 5) * sin(t)),
+ yoffset + size - ((size / 2 - 5) * cos(t)),
+ xoffset + size / 2 + ((size / 2 + 5) * sin(t)),
+ yoffset + size - ((size / 2 + 5) * cos(t)));
+
+
+ }
+
+ if (_next_way) {
+ gdouble lat,lon;
+ gdouble wc;
+
+ unit2latlon(_next_way->point->unitx,_next_way->point->unity, lat, lon);
+ wc=calculate_course(_gps.lat,_gps.lon, lat, lon);
+
+ color.red = 0;
+ color.green = 0xffff;
+ color.blue = 0;
+ gdk_gc_set_rgb_fg_color(gc, &color);
+
+ t = ((wc-_gps.heading) * (1.f / 180.f)) * PI;
+ gdk_draw_line(widget->window,gc,
+ xoffset + size / 2 + ((size / 2 - 5) * sin(t)),
+ yoffset + size - ((size / 2 - 5) * cos(t)),
+ xoffset + size / 2 + ((size / 2 + 5) * sin(t)),
+ yoffset + size - ((size / 2 + 5) * cos(t)));
+
+ }
+ g_object_unref(gc);
+ }
+
}
vprintf("%s(): return\n", __PRETTY_FUNCTION__);