From 078612838a830c016d78f59d0d8887f4a1281006 Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Tue, 5 Aug 2008 16:40:40 +0300 Subject: [PATCH] MapWidgetTester: Add random track and route to map --- libs/libgtkmap/map-widget-test.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/libs/libgtkmap/map-widget-test.c b/libs/libgtkmap/map-widget-test.c index 08c6f08..84690a4 100644 --- a/libs/libgtkmap/map-widget-test.c +++ b/libs/libgtkmap/map-widget-test.c @@ -7,6 +7,8 @@ #define TESTREPO "/home/milang/MyDocs/.documents/Maps/OpenStreet" GtkWidget *map; +Path *track; +Path *route; static gboolean map_zoom(GtkWidget *widget, gpointer data) @@ -127,6 +129,23 @@ gtk_map_set_center_latlon(map, 60.45, 22.25); gtk_range_set_value(GTK_RANGE(zoomer), 8); gtk_map_set_zoom(map, 8); +gtk_map_set_path_display(map, TRACKS_MASK | ROUTES_MASK); + +track=path_new(PATH_TYPE_TRACK, 0); +route=path_new(PATH_TYPE_ROUTE, 1); + +{ +gint t; + +for (t=1;t<256;t++) + path_add_latlon(track, + 60.4500+g_random_double_range(-0.0008, 0.0008), + 22.241+g_random_double_range(-0.0008, 0.0008), t, 1, 1); +} + +gtk_map_add_path(map, track, TRUE); +gtk_map_add_path(map, route, TRUE); + gdk_threads_enter(); gtk_main(); gdk_threads_leave(); -- 2.39.5