]> err.no Git - libchamplain/commitdiff
Add the MapSource ID constants
authorEmmanuel Rodriguez <emmanuel.rodriguez@gmail.com>
Sun, 17 May 2009 08:13:06 +0000 (10:13 +0200)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Mon, 18 May 2009 20:12:21 +0000 (16:12 -0400)
bindings/perl/Champlain/lib/Champlain.pm
bindings/perl/Champlain/t/Champlain.t

index 4bca0d89dd1520a134bd4923a575f99adbf6f618..99ac0a688a464809f59a3c7e9cbe1a85629c1919 100644 (file)
@@ -109,11 +109,39 @@ use constant {
 
 our %EXPORT_TAGS = (
        coords => [qw(MIN_LAT MAX_LAT MIN_LONG MAX_LONG)],
+       maps => [qw(
+               MAP_OSM_MAPNIK
+               MAP_OSM_OSMARENDER
+               MAP_OSM_CYCLE_MAP
+               MAP_OAM
+               MAP_MFF_RELIEF
+       )],
 );
 
 our @EXPORT_OK = map { @{ $_ } } values %EXPORT_TAGS;
 
 
+sub MAP_OSM_MAPNIK {
+       return Champlain::MapSourceFactory->OSM_MAPNIK;
+}
+
+sub MAP_OSM_OSMARENDER {
+       return Champlain::MapSourceFactory->OSM_OSMARENDER;
+}
+
+sub MAP_OSM_CYCLE_MAP {
+       return Champlain::MapSourceFactory->OSM_CYCLE_MAP;
+}
+
+sub MAP_OAM {
+       return Champlain::MapSourceFactory->OAM;
+}
+
+sub MAP_MFF_RELIEF {
+       return Champlain::MapSourceFactory->MFF_RELIEF;
+}
+
+
 sub dl_load_flags { $^O eq 'darwin' ? 0x00 : 0x01 }
 
 __PACKAGE__->bootstrap($VERSION);
index 23da614917740921b0d2fa8ff416dc19017163f8..7ffcafcc20e1a52d127abec015fbb2a4801b28c3 100644 (file)
@@ -3,9 +3,10 @@
 use strict;
 use warnings;
 
-use Clutter::TestHelper tests => 11;
+use Clutter::TestHelper tests => 16;
 
-use Champlain ':coords';
+#use Champlain qw(:coords :maps);
+use Champlain qw(:coords :maps);
 
 exit tests();
 
@@ -33,6 +34,12 @@ sub test_version {
                Champlain::MICRO_VERSION,
        );
        is_deeply(\@version, \@expected, "GET_VERSION_INFO");
+
+       is(MAP_OSM_MAPNIK, Champlain::MapSourceFactory->OSM_MAPNIK, "MAP_OSM_MAPNIK exists");
+       is(MAP_OSM_OSMARENDER, Champlain::MapSourceFactory->OSM_OSMARENDER, "MAP_OSM_OSMARENDER exists");
+       is(MAP_OSM_CYCLE_MAP, Champlain::MapSourceFactory->OSM_CYCLE_MAP, "MAP_OSM_CYCLE_MAP exists");
+       is(MAP_OAM, Champlain::MapSourceFactory->OAM, "MAP_OAM exists");
+       is(MAP_MFF_RELIEF, Champlain::MapSourceFactory->MFF_RELIEF, "MAP_MFF_RELIEF exists");
 }