From 484eda2ee5116dd41c8572aacff26c17221bdd43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Tue, 26 Jun 2012 16:14:12 +0200 Subject: [PATCH] add alternate projection parsing --- tests/Format/WMTSCapabilities/v1_0_0.html | 174 ++++++++++++++++++++++ 1 file changed, 174 insertions(+) diff --git a/tests/Format/WMTSCapabilities/v1_0_0.html b/tests/Format/WMTSCapabilities/v1_0_0.html index 81686b1fff..43de62a077 100644 --- a/tests/Format/WMTSCapabilities/v1_0_0.html +++ b/tests/Format/WMTSCapabilities/v1_0_0.html @@ -232,6 +232,29 @@ t.eq(layer.params['TIME'], "2012", "correct params"); } + function test_parse_projection(t) { + t.plan(2); + + var format = new OpenLayers.Format.WMTSCapabilities(); + + var xml = document.getElementById("restsample-alternate-proj1").firstChild.nodeValue; + var doc = new OpenLayers.Format.XML().read(xml); + var caps = format.read(doc); + var layer = format.createLayer(caps, { + layer: "ch.are.agglomerationen_isolierte_staedte-2000", + matrixSet: "21781" + }); + t.eq(layer.projection.getCode(), "EPSG:21781", "correct projection"); + + xml = document.getElementById("restsample-alternate-proj2").firstChild.nodeValue; + doc = new OpenLayers.Format.XML().read(xml); + caps = format.read(doc); + layer = format.createLayer(caps, { + layer: "ch.are.agglomerationen_isolierte_staedte-2000", + matrixSet: "21781" + }); + t.eq(layer.projection.getCode(), "EPSG:21781", "correct projection"); + } @@ -528,5 +551,156 @@ http://schemas.opengis.net/wmts/1.0/examples/wmtsGetCapabilities_response.xml --> + +
+ +
+