From: Emmanuel Rodriguez Date: Tue, 5 May 2009 18:41:04 +0000 (+0200) Subject: Add get_id/set_id to Champlain::MapSource X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d2cdfc23a58ad8ed31b9670b8352d575c7ee58d;p=libchamplain Add get_id/set_id to Champlain::MapSource --- diff --git a/bindings/perl/Champlain/t/ChamplainMapSource.t b/bindings/perl/Champlain/t/ChamplainMapSource.t index 6db2aab..2c2224b 100644 --- a/bindings/perl/Champlain/t/ChamplainMapSource.t +++ b/bindings/perl/Champlain/t/ChamplainMapSource.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Clutter::TestHelper tests => 110; +use Clutter::TestHelper tests => 120; use Champlain ':coords'; @@ -28,6 +28,7 @@ sub test_osm_mapnik { isa_ok($map, 'Champlain::MapSource'); # Map identification + is($map->get_id, 'osm::mapnik', "$label id"); is($map->get_name, 'OpenStreetMap Mapnik', "$label name"); is($map->get_min_zoom_level, 0, "$label min zoom"); is($map->get_max_zoom_level, 18, "$label max zoom"); @@ -46,6 +47,7 @@ sub test_osm_cyclemap { isa_ok($map, 'Champlain::MapSource'); # Map identification + is($map->get_id, 'osm::cyclemap', "$label id"); is($map->get_name, 'OpenStreetMap Cycle Map', "$label name"); is($map->get_min_zoom_level, 0, "$label min zoom"); is($map->get_max_zoom_level, 18, "$label max zoom"); @@ -64,6 +66,7 @@ sub test_osm_osmarender { isa_ok($map, 'Champlain::MapSource'); # Map identification + is($map->get_id, 'osm::osmarender', "$label id"); is($map->get_name, 'OpenStreetMap Osmarender', "$label name"); is($map->get_min_zoom_level, 0, "$label min zoom"); is($map->get_max_zoom_level, 18, "$label max zoom"); @@ -82,6 +85,7 @@ sub test_oam { isa_ok($map, 'Champlain::MapSource'); # Map identification + is($map->get_id, 'oam', "$label id"); is($map->get_name, 'OpenAerialMap', "$label name"); is($map->get_min_zoom_level, 0, "$label min zoom"); is($map->get_max_zoom_level, 17, "$label max zoom"); @@ -100,6 +104,7 @@ sub test_mff_relief { isa_ok($map, 'Champlain::MapSource'); # Map identification + is($map->get_id, 'mff::relief', "$label id"); is($map->get_name, 'Maps for Free Relief', "$label name"); is($map->get_min_zoom_level, 0, "$label min zoom"); is($map->get_max_zoom_level, 11, "$label max zoom"); @@ -123,6 +128,9 @@ sub generic_map_operations { # Rename of the map $map->set_name("No name"); is($map->get_name, "No name", "Rename the map"); + $map->set_id('test::map'); + is($map->get_id, 'test::map', "Change the map id"); + # Relicense the map $map->set_license("Free for all!"); diff --git a/bindings/perl/Champlain/xs/ChamplainMapSource.xs b/bindings/perl/Champlain/xs/ChamplainMapSource.xs index 395d850..e4f53f5 100644 --- a/bindings/perl/Champlain/xs/ChamplainMapSource.xs +++ b/bindings/perl/Champlain/xs/ChamplainMapSource.xs @@ -66,3 +66,11 @@ champlain_map_source_set_projection (ChamplainMapSource *map_source, ChamplainMa ChamplainMapProjection champlain_map_source_get_projection (ChamplainMapSource *map_source) + + +void +champlain_map_source_set_id (ChamplainMapSource *map_source, const gchar *id) + + +const gchar* +champlain_map_source_get_id (ChamplainMapSource *map_source)