Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WMS print encoder supports WMS 1.3.0 #96

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/GeoExt/data/PrintProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -637,9 +637,9 @@ 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, {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you remove it ?

type: 'WMS',
version: layer.params.VERSION,
layers: [layer.params.LAYERS].join(",").split(","),
format: layer.params.FORMAT,
styles: [layer.params.STYLES].join(",").split(","),
Expand All @@ -649,7 +649,7 @@ GeoExt.data.PrintProvider = Ext.extend(Ext.util.Observable, {
for(var p in layer.params) {
param = p.toLowerCase();
if(layer.params[p] != null && !layer.DEFAULT_PARAMS[param] &&
"layers,styles,width,height,srs".indexOf(param) == -1) {
"layers,styles,width,height,srs,crs".indexOf(param) == -1) {
if(!enc.customParams) {
enc.customParams = {};
}
Expand Down
5 changes: 4 additions & 1 deletion tests/lib/GeoExt/data/PrintProvider.html
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@
"singleTile":false,
"type":"WMS",
"layers":["topp:tasmania_state_boundaries","topp:tasmania_water_bodies"],
"version": "1.1.1",
"format":"image/gif",
"styles":[""],
"customParams":{"VENDORFOO":"bar", "map_resolution": 150}
Expand Down Expand Up @@ -430,7 +431,7 @@
zoomOffset:14,
resolutions:[4000, 3750, 3500, 3250, 3000, 2750, 2500, 2250, 2000, 1750, 1500, 1250, 1000, 750, 650, 500, 250, 100, 50, 20, 10, 5, 2.5, 2, 1.5, 1, 0.5]
}],
"pages":[{"mapTitle":"foo","comment":"bar","center":[1,2],"scale":4000000,"rotation":0}],"customParam":"foo","legends":[{"name":"tilecache","classes":[{"name":"","icon":"http://trac.geoext.org/chrome/site/img/GeoExt.png"}]},{"name": "wms", "classes":[{"name":"","icons":["http://demo.opengeo.org/geoserver/wms?VENDORFOO=bar&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetLegendGraphic&EXCEPTIONS=application%2Fvnd.ogc.se_xml&LAYER=topp%3Atasmania_water_bodies&FORMAT=image%2Fgif&SCALE=4000000", "http://demo.opengeo.org/geoserver/wms?VENDORFOO=bar&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetLegendGraphic&EXCEPTIONS=application%2Fvnd.ogc.se_xml&LAYER=topp%3Atasmania_state_boundaries&FORMAT=image%2Fgif&SCALE=4000000"]}]}],"overviewLayers":[{"baseURL":"http://foo/","format":"image/jpeg",layers:["mylayer"],"opacity":1,"singleTile":false,styles:[""],type:"WMS", "customParams": {"map_resolution": 150}}]};
"pages":[{"mapTitle":"foo","comment":"bar","center":[1,2],"scale":4000000,"rotation":0}],"customParam":"foo","legends":[{"name":"tilecache","classes":[{"name":"","icon":"http://trac.geoext.org/chrome/site/img/GeoExt.png"}]},{"name": "wms", "classes":[{"name":"","icons":["http://demo.opengeo.org/geoserver/wms?VENDORFOO=bar&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetLegendGraphic&EXCEPTIONS=application%2Fvnd.ogc.se_xml&LAYER=topp%3Atasmania_water_bodies&FORMAT=image%2Fgif&SCALE=4000000", "http://demo.opengeo.org/geoserver/wms?VENDORFOO=bar&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetLegendGraphic&EXCEPTIONS=application%2Fvnd.ogc.se_xml&LAYER=topp%3Atasmania_state_boundaries&FORMAT=image%2Fgif&SCALE=4000000"]}]}],"overviewLayers":[{"baseURL":"http://foo/","format":"image/jpeg",layers:["mylayer"],"opacity":1,"singleTile":false,styles:[""],type:"WMS", version: "1.1.1", "customParams": {"map_resolution": 150}}]};

t.eq(log.request.jsonData, expect, "Request with encoded layers and legend is correct.");

Expand Down Expand Up @@ -495,6 +496,7 @@
"singleTile": false,
"type": "WMS",
"layers": ["topp:tasmania_state_boundaries"],
"version": "1.1.1",
"format": "image/gif",
"styles": [""]
},{
Expand All @@ -503,6 +505,7 @@
"singleTile": false,
"type": "WMS",
"layers": ["topp:tasmania_water_bodies"],
"version": "1.1.1",
"format": "image/gif",
"styles": [""]
}],
Expand Down