save the resourceUrl elements into the WMTS capabilities object. r=bartvde (closes #2986)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@11142 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -191,7 +191,14 @@ OpenLayers.Format.WMTSCapabilities.v1_0_0 = OpenLayers.Class(
|
|||||||
},
|
},
|
||||||
"MatrixHeight": function(node, obj) {
|
"MatrixHeight": function(node, obj) {
|
||||||
obj.matrixHeight = parseInt(this.getChildValue(node));
|
obj.matrixHeight = parseInt(this.getChildValue(node));
|
||||||
},
|
},
|
||||||
|
"ResourceURL": function(node, obj) {
|
||||||
|
obj.resourceUrl = obj.resourceUrl || {};
|
||||||
|
obj.resourceUrl[node.getAttribute("resourceType")] = {
|
||||||
|
format: node.getAttribute("format"),
|
||||||
|
template: node.getAttribute("template")
|
||||||
|
};
|
||||||
|
},
|
||||||
// not used for now, can be added in the future though
|
// not used for now, can be added in the future though
|
||||||
/*"Themes": function(node, obj) {
|
/*"Themes": function(node, obj) {
|
||||||
obj.themes = [];
|
obj.themes = [];
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function test_layers(t) {
|
function test_layers(t) {
|
||||||
t.plan(21);
|
t.plan(25);
|
||||||
var xml = document.getElementById("ogcsample").firstChild.nodeValue;
|
var xml = document.getElementById("ogcsample").firstChild.nodeValue;
|
||||||
var doc = new OpenLayers.Format.XML().read(xml);
|
var doc = new OpenLayers.Format.XML().read(xml);
|
||||||
|
|
||||||
@@ -75,7 +75,14 @@
|
|||||||
t.eq(wgs84Bbox.right, 180.0, "wgs84BoudingBox right is correct");
|
t.eq(wgs84Bbox.right, 180.0, "wgs84BoudingBox right is correct");
|
||||||
t.eq(wgs84Bbox.bottom, -90.0, "wgs84BoudingBox bottom is correct");
|
t.eq(wgs84Bbox.bottom, -90.0, "wgs84BoudingBox bottom is correct");
|
||||||
t.eq(wgs84Bbox.top, 90.0, "wgs84BoudingBox top is correct");
|
t.eq(wgs84Bbox.top, 90.0, "wgs84BoudingBox top is correct");
|
||||||
|
|
||||||
|
t.eq(layer.resourceUrl.tile.format, "image/png", "resourceUrl.tile.format is correct");
|
||||||
|
t.eq(layer.resourceUrl.tile.template, "http://www.example.com/wmts/coastlines/{TileMatrix}/{TileRow}/{TileCol}.png",
|
||||||
|
"resourceUrl.tile.template is correct");
|
||||||
|
|
||||||
|
t.eq(layer.resourceUrl.FeatureInfo.format, "application/gml+xml; version=3.1", "resourceUrl.FeatureInfo.format is correct");
|
||||||
|
t.eq(layer.resourceUrl.FeatureInfo.template, "http://www.example.com/wmts/coastlines/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}/{J}/{I}.xml",
|
||||||
|
"resourceUrl.FeatureInfo.template is correct");
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_tileMatrixSets(t) {
|
function test_tileMatrixSets(t) {
|
||||||
@@ -240,6 +247,10 @@ http://schemas.opengis.net/wmts/1.0/examples/wmtsGetCapabilities_response.xml
|
|||||||
<ows:UpperCorner>180 90</ows:UpperCorner>
|
<ows:UpperCorner>180 90</ows:UpperCorner>
|
||||||
</ows:WGS84BoundingBox>
|
</ows:WGS84BoundingBox>
|
||||||
<ows:Identifier>coastlines</ows:Identifier>
|
<ows:Identifier>coastlines</ows:Identifier>
|
||||||
|
<ResourceURL format="image/png" resourceType="tile"
|
||||||
|
template="http://www.example.com/wmts/coastlines/{TileMatrix}/{TileRow}/{TileCol}.png" />
|
||||||
|
<ResourceURL format="application/gml+xml; version=3.1" resourceType="FeatureInfo"
|
||||||
|
template="http://www.example.com/wmts/coastlines/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}/{J}/{I}.xml" />
|
||||||
<Style isDefault="true">
|
<Style isDefault="true">
|
||||||
<ows:Title>Dark Blue</ows:Title>
|
<ows:Title>Dark Blue</ows:Title>
|
||||||
<ows:Identifier>DarkBlue</ows:Identifier>
|
<ows:Identifier>DarkBlue</ows:Identifier>
|
||||||
|
|||||||
Reference in New Issue
Block a user