From 26c27a581964d72d73700efad0b94891cb15d75d Mon Sep 17 00:00:00 2001 From: Emmanuel Rodriguez Date: Sun, 17 May 2009 10:13:06 +0200 Subject: [PATCH] Add the MapSource ID constants --- bindings/perl/Champlain/lib/Champlain.pm | 28 ++++++++++++++++++++++++ bindings/perl/Champlain/t/Champlain.t | 11 ++++++++-- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/bindings/perl/Champlain/lib/Champlain.pm b/bindings/perl/Champlain/lib/Champlain.pm index 4bca0d8..99ac0a6 100644 --- a/bindings/perl/Champlain/lib/Champlain.pm +++ b/bindings/perl/Champlain/lib/Champlain.pm @@ -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); diff --git a/bindings/perl/Champlain/t/Champlain.t b/bindings/perl/Champlain/t/Champlain.t index 23da614..7ffcafc 100644 --- a/bindings/perl/Champlain/t/Champlain.t +++ b/bindings/perl/Champlain/t/Champlain.t @@ -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"); } -- 2.39.5