Open fobetor opened 7 years ago
Hi, sorry for the late reply. Mapfish uses the bbox
parameter to specify the print area. By default the print provider calculates the print
and scale
parameters and sends those:
var jsonData = JSON.stringify(L.extend({
units: L.print.Provider.UNITS,
srs: L.print.Provider.SRS,
layout: options.layout,
dpi: options.dpi,
outputFormat: options.outputFormat,
outputFilename: options.outputFilename,
layers: this._encodeLayers(this._map),
pages: [{
center: this._projectCoords(L.print.Provider.SRS, this._map.getCenter()),
scale: this._getScale(),
rotation: options.rotation
}]
}, this.options.customParams, options.customParams, this._makeLegends(this._map)))
You could try setting the bbox
in the pages configuration through customParams
.
Thanks Adam Yes, you are rigth, I managed to pass the bbox to the print provider and it works fine. Thank you Fernando
Hello again Adam Another question: Is there a way of changing the projection srs? I see it is defined as EPSG:3857 but if I change this and try touse the EPSG:27700 it throws an error? I cant find where it looks for the projexction definitions... Thank you
It's referencing the property L.print.Provider.SRS. I would try setting that immediately after you load the library e.g.
<script>
L.print.Provider.SRS = 'EPSG:27700';
</script>
Thanks ,i will try this
Hello I would like to know, if it may be possible to tell this print module to print an area (I am using the Area Select plugin), not just the full map, but themap inside the area. It may be interesting (similar as what geoext does)
Thanks in advance Fernando