Permalink
Browse files

Merge pull request #49 from sbrunner/wmts

Add WMTS gris suport in print module
  • Loading branch information...
2 parents a692c45 + 2d905eb commit c5f6071ef3a836cff7ab5c2809153ef466e09773 @fredj fredj committed Jun 27, 2012
Showing with 252 additions and 33 deletions.
  1. +36 −11 lib/GeoExt/data/PrintProvider.js
  2. +216 −22 tests/lib/GeoExt/data/PrintProvider.html
@@ -633,11 +633,13 @@ GeoExt.data.PrintProvider = Ext.extend(Ext.util.Observable, {
},
"WMS": function(layer) {
var enc = this.encoders.layers.HTTPRequest.call(this, layer);
+ enc.singleTile = layer.singleTile;
Ext.apply(enc, {
type: 'WMS',
layers: [layer.params.LAYERS].join(",").split(","),
format: layer.params.FORMAT,
- styles: [layer.params.STYLES].join(",").split(",")
+ styles: [layer.params.STYLES].join(",").split(","),
+ singleTile: layer.singleTile
});
var param;
for(var p in layer.params) {
@@ -680,22 +682,46 @@ GeoExt.data.PrintProvider = Ext.extend(Ext.util.Observable, {
},
"WMTS": function(layer) {
var enc = this.encoders.layers.HTTPRequest.call(this, layer);
- return Ext.apply(enc, {
+ enc = Ext.apply(enc, {
type: 'WMTS',
layer: layer.layer,
version: layer.version,
requestEncoding: layer.requestEncoding,
- tileOrigin: [layer.tileOrigin.lon, layer.tileOrigin.lat],
- tileSize: [layer.tileSize.w, layer.tileSize.h],
style: layer.style,
- formatSuffix: layer.formatSuffix,
dimensions: layer.dimensions,
params: layer.params,
- maxExtent: (layer.tileFullExtent != null) ? layer.tileFullExtent.toArray() : layer.maxExtent.toArray(),
- matrixSet: layer.matrixSet,
- zoomOffset: layer.zoomOffset,
- resolutions: layer.serverResolutions || layer.resolutions
+ matrixSet: layer.matrixSet
});
+ if (layer.matrixIds) {
+ if (layer.requestEncoding == "KVP") {
+ enc.format = layer.format;
+ }
+ enc.matrixIds = []
+ Ext.each(layer.matrixIds, function(matrixId) {
+ enc.matrixIds.push({
+ identifier: matrixId.identifier,
+ matrixSize: [matrixId.matrixWidth,
+ matrixId.matrixHeight],
+ resolution: matrixId.scaleDenominator * 0.28E-3
+ / OpenLayers.METERS_PER_INCH
+ / OpenLayers.INCHES_PER_UNIT[layer.units],
+ tileSize: [matrixId.tileWidth, matrixId.tileHeight],
+ topLeftCorner: [matrixId.topLeftCorner.lon,
+ matrixId.topLeftCorner.lat]
+ });
+ })
+ return enc;
+ }
+ else {
+ return Ext.apply(enc, {
+ formatSuffix: layer.formatSuffix,
+ tileOrigin: [layer.tileOrigin.lon, layer.tileOrigin.lat],
+ tileSize: [layer.tileSize.w, layer.tileSize.h],
+ maxExtent: (layer.tileFullExtent != null) ? layer.tileFullExtent.toArray() : layer.maxExtent.toArray(),
+ zoomOffset: layer.zoomOffset,
+ resolutions: layer.serverResolutions || layer.resolutions
+ });
+ }
},
"KaMapCache": function(layer) {
var enc = this.encoders.layers.KaMap.call(this, layer);
@@ -725,8 +751,7 @@ GeoExt.data.PrintProvider = Ext.extend(Ext.util.Observable, {
return Ext.apply(enc, {
baseURL: this.getAbsoluteUrl(layer.url instanceof Array ?
layer.url[0] : layer.url),
- opacity: (layer.opacity != null) ? layer.opacity : 1.0,
- singleTile: layer.singleTile
+ opacity: (layer.opacity != null) ? layer.opacity : 1.0
});
},
"Image": function(layer) {
Oops, something went wrong.

0 comments on commit c5f6071

Please sign in to comment.