You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recent versions of MapFish Print (at least from june 2013 onward) take the TMS tileOrigin into account when rendering print output on "create". The current GeoExt encoder in PrintProvider.js does not take this into account. I have fixed this by extending the TileCache base encoder (called by the TMS encoder) as follows:
"TileCache": function (layer) {
var enc = this.encoders.layers.HTTPRequest.call(this, layer);
// Heron fix JvdB 6 oct 2013
// Add tileOrigin otherwise MapFish Print will be confused.
// https://github.com/mapfish/mapfish-print/issues/68
var maxExtent = layer.maxExtent.toArray();
var tileOriginX = layer.tileOrigin ? layer.tileOrigin.lon : maxExtent[0];
var tileOriginY = layer.tileOrigin ? layer.tileOrigin.lat : maxExtent[1];
return Ext.apply(enc, {
type: 'TileCache',
layer: layer.layername,
maxExtent: maxExtent,
tileOrigin: {x: tileOriginX, y: tileOriginY},
tileSize: [layer.tileSize.w, layer.tileSize.h],
extension: layer.extension,
resolutions: layer.serverResolutions || layer.resolutions
});
},
So "tileOrigin" is determined from the TMS tileOrigin if provided or the Map/Layer maxExtent LL coords. Yes the tileOrigin should be encoded as an Object with either x,y or lon,lat. Possibly needs refinement. According to the TMS spec (wiki) tileOrigin may be independently defined from maxExtent.
As the author of the mapfish-print tile origin patches, I can verify that specifying the tile origin from the layer in this manner is ok ( I have a local fork that does just this).
I also fashioned mapfish's implementation off of OpenLayers tile origin strategy, so everything should be compatible.
Recent versions of MapFish Print (at least from june 2013 onward) take the TMS tileOrigin into account when rendering print output on "create". The current GeoExt encoder in PrintProvider.js does not take this into account. I have fixed this by extending the TileCache base encoder (called by the TMS encoder) as follows:
So "tileOrigin" is determined from the TMS tileOrigin if provided or the Map/Layer maxExtent LL coords. Yes the tileOrigin should be encoded as an Object with either x,y or lon,lat. Possibly needs refinement. According to the TMS spec (wiki) tileOrigin may be independently defined from maxExtent.
This came out from a longstanding MapFish Print issue:
mapfish/mapfish-print#68
See code at bottom of:
https://code.google.com/p/geoext-viewer/source/browse/trunk/heron/lib/override-geoext.js but I can provide a pull if neccessary.
The text was updated successfully, but these errors were encountered: