From: Pierre-Luc Beaudoin Date: Tue, 26 May 2009 02:48:38 +0000 (-0400) Subject: Better line demo X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d158f8c917653b6567c10593280abb57d65d5a5c;p=libchamplain Better line demo --- diff --git a/demos/lines.c b/demos/lines.c index eacca13..955a297 100644 --- a/demos/lines.c +++ b/demos/lines.c @@ -109,20 +109,32 @@ main (int argc, /* draw a line */ line = champlain_line_new (); - champlain_line_add_point (line, 44, -74); - champlain_line_add_point (line, 45, -75); + /* Cheap approx of Highway 10 */ + champlain_line_add_point (line, 45.4095, -73.3197); + champlain_line_add_point (line, 45.4104, -73.2846); + champlain_line_add_point (line, 45.4178, -73.2239); + champlain_line_add_point (line, 45.4176, -73.2181); + champlain_line_add_point (line, 45.4151, -73.2126); + champlain_line_add_point (line, 45.4016, -73.1926); + champlain_line_add_point (line, 45.3994, -73.1877); + champlain_line_add_point (line, 45.4000, -73.1815); + champlain_line_add_point (line, 45.4151, -73.1218); + champlain_line_set_stroke_width (line, 5.0); champlain_view_add_line (CHAMPLAIN_VIEW (actor), line); + /* draw a polygon */ line = champlain_line_new (); - champlain_line_add_point (line, 44, -75); - champlain_line_add_point (line, 45, -74); - champlain_line_add_point (line, 46, -74); + champlain_line_add_point (line, 45.1386, -73.9196); + champlain_line_add_point (line, 45.1229, -73.8991); + champlain_line_add_point (line, 45.0946, -73.9531); + champlain_line_add_point (line, 45.1085, -73.9714); + champlain_line_add_point (line, 45.1104, -73.9761); champlain_view_add_line (CHAMPLAIN_VIEW (actor), line); g_object_set (line, "closed-path", TRUE, NULL); g_object_set (line, "fill", TRUE, NULL); /* Finish initialising the map view */ - g_object_set (G_OBJECT (actor), "zoom-level", 12, + g_object_set (G_OBJECT (actor), "zoom-level", 9, "scroll-mode", CHAMPLAIN_SCROLL_MODE_KINETIC, NULL); champlain_view_center_on(CHAMPLAIN_VIEW(actor), 45.466, -73.75);