]> err.no Git - libchamplain/commitdiff
Make sure that the view has a size and that it is added to the stage
authorEmmanuel Rodriguez <emmanuel.rodriguez@gmail.com>
Thu, 17 Sep 2009 19:40:35 +0000 (21:40 +0200)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Mon, 21 Sep 2009 16:19:44 +0000 (12:19 -0400)
bindings/perl/Champlain/examples/capitals.pl
bindings/perl/Champlain/examples/flickr.pl
bindings/perl/Champlain/examples/image.pl
bindings/perl/Champlain/examples/launcher.pl

index 8ab6da01db2f65e94e26b3a74aee0d250421eaa7..34bd503d6287df35dc81dba3649e58b77bd51d8d 100755 (executable)
@@ -32,10 +32,12 @@ sub main {
 
        # Create the map stuff
        my $map = Champlain::View->new();
+       $map->set_size($stage->get_size);
        $map->center_on(0, 0);
        $map->set_scroll_mode('kinetic');
        $map->set_zoom_level(3);
-       
+       $stage->add($map);
+
        my $layer = Champlain::Layer->new();
        $map->add_layer($layer);
 
@@ -46,8 +48,8 @@ sub main {
        my $soup = My::Soup->new($capitals_url);
 
        my $data = {
-               map   => $map,
-               layer => $layer,
+               map     => $map,
+               layer   => $layer,
                markers => [],
        };
 
index 6e82229bbc1a3acba2983f975c871b614ddfe666..983dd3ec272dd2310709982e50f9412339742790 100755 (executable)
@@ -53,6 +53,7 @@ sub main {
        $map->set_scroll_mode('kinetic');
        $map->set_zoom_level(5);
        $map->set_size(640, 480);
+       $stage->add($map);
 
        # Create the markers and marker layer
        my $layer = Champlain::Layer->new();
index 0f85120f49dca1691e9e4f18c2342f53af94c231..3d1fde81163a8149df08c0a412a153ee3b1bee56 100755 (executable)
@@ -29,9 +29,11 @@ sub main {
 
        # Create the map view
        my $map = Champlain::View->new();
+       $map->set_size($stage->get_size);
        $map->center_on(47.130885, -70.764141);
        $map->set_scroll_mode('kinetic');
        $map->set_zoom_level(5);
+       $stage->add($map);
 
        # Create the markers and marker layer
        my $layer = create_marker_layer($map);
index fbe718cf29fceb3d40cd02423056044b9a9b35de..1018c442af99bc226d56e4c513e4f3e07c1f7b4c 100755 (executable)
@@ -24,7 +24,7 @@ sub main {
        # Create the map view
        my $map = Champlain::View->new();
        $map->set_scroll_mode('kinetic');
-       $map->set_size(800, 600);
+       $map->set_size($stage->get_size);
        $stage->add($map);
        
        # Create the zoom buttons