Fixes for the WMTS layer to properly update matrix related properties. Determining the best matrix in the set based on current map resolution. Properly parsing TopLeftCorner coordinates and providing a way to specify identifiers for backwards CRS. r=ahocevar (closes #2677)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10570 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -271,7 +271,7 @@ http://schemas.opengis.net/wmts/1.0/examples/wmtsGetCapabilities_response.xml
|
||||
<TileMatrix>
|
||||
<ows:Identifier>1e6</ows:Identifier>
|
||||
<ScaleDenominator>1e6</ScaleDenominator>
|
||||
<TopLeftCorner>84 -180</TopLeftCorner>
|
||||
<TopLeftCorner>-180 84</TopLeftCorner>
|
||||
<TileWidth>256</TileWidth>
|
||||
<TileHeight>256</TileHeight>
|
||||
<MatrixWidth>60000</MatrixWidth>
|
||||
@@ -280,7 +280,7 @@ http://schemas.opengis.net/wmts/1.0/examples/wmtsGetCapabilities_response.xml
|
||||
<TileMatrix>
|
||||
<ows:Identifier>2.5e6</ows:Identifier>
|
||||
<ScaleDenominator>2.5e6</ScaleDenominator>
|
||||
<TopLeftCorner>84 -180</TopLeftCorner>
|
||||
<TopLeftCorner>-180 84</TopLeftCorner>
|
||||
<TileWidth>256</TileWidth>
|
||||
<TileHeight>256</TileHeight>
|
||||
<MatrixWidth>9000</MatrixWidth>
|
||||
|
||||
+11
-2
@@ -18,6 +18,8 @@
|
||||
format: "image/png",
|
||||
isBaseLayer: false,
|
||||
requestEncoding: "KVP",
|
||||
maxResolution: 0.3521969032857032,
|
||||
numZoomLevels: 7,
|
||||
matrixIds: obj.contents.tileMatrixSets["arcgis-online-wgs84"].matrixIds
|
||||
});
|
||||
|
||||
@@ -40,7 +42,7 @@
|
||||
t.eq(layer1.tileSize.h, 512.0, "tileSize h is set correctly");
|
||||
}
|
||||
|
||||
function test_setMap(t) {
|
||||
function test_moveTo(t) {
|
||||
t.plan(9);
|
||||
var xml = document.getElementById("capabilities").firstChild.nodeValue;
|
||||
var doc = new OpenLayers.Format.XML().read(xml);
|
||||
@@ -54,12 +56,16 @@
|
||||
matrixSet: "arcgis-online-wgs84",
|
||||
format: "image/png",
|
||||
requestEncoding: "KVP",
|
||||
maxResolution: 0.3521969032857032,
|
||||
numZoomLevels: 7,
|
||||
matrixIds: obj.contents.tileMatrixSets["arcgis-online-wgs84"].matrixIds
|
||||
});
|
||||
|
||||
var map = new OpenLayers.Map('map');
|
||||
map.addLayer(layer0);
|
||||
|
||||
map.setCenter(new OpenLayers.LonLat(-97, 38), 1);
|
||||
|
||||
t.ok((layer0.tileOrigin instanceof OpenLayers.LonLat), "tileOrigin is an instance of OpenLayers.LonLat");
|
||||
t.ok((layer0.tileOrigin.lon == -180 && layer0.tileOrigin.lat == 90), "tileOrigin is set correctly");
|
||||
t.ok((layer0.tileSize instanceof OpenLayers.Size), "tileSize is an instance of OpenLayers.Size");
|
||||
@@ -177,6 +183,8 @@
|
||||
matrixSet: "arcgis-online-wgs84",
|
||||
format: "image/png",
|
||||
requestEncoding: "KVP",
|
||||
maxResolution: 0.3521969032857032,
|
||||
numZoomLevels: 7,
|
||||
matrixIds: obj.contents.tileMatrixSets["arcgis-online-wgs84"].matrixIds
|
||||
});
|
||||
|
||||
@@ -188,7 +196,8 @@
|
||||
matrixSet: "arcgis_online",
|
||||
format: "image/jpeg",
|
||||
tileSize: new OpenLayers.Size(512, 512),
|
||||
requestEncoding: "REST"
|
||||
requestEncoding: "REST",
|
||||
isBaseLayer: false
|
||||
});
|
||||
|
||||
var options = {
|
||||
|
||||
Reference in New Issue
Block a user