]> err.no Git - libchamplain/commitdiff
Better line demo
authorPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Tue, 26 May 2009 02:48:38 +0000 (22:48 -0400)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Wed, 10 Jun 2009 00:27:36 +0000 (20:27 -0400)
demos/lines.c

index eacca131ee13e0a89210602b23f7ec63e025daac..955a2976f3d056dd476ba3334bc6584c88c1ec60 100644 (file)
@@ -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);