Skip to content

L.print.provider ignores my configuration parameters #20

Description

@ClaraIV

I want to print a map in Leaflet using the Geoserver Print Module, built on Mapfish. I configured the .yaml file and I am specifying the parameters to be used in the request as below:

var printProvider = L.print.provider({
capabilities: printConfig,
url: "http://localhost:8080/geoserver/print",
method: 'POST',
autoLoad: true,
dpi: 150,

legends: true,
geodetic:true,
outputFormat: 'pdf',

pages: [{center: projcenter,
       scale: 5000000,

       rotation:1}],
customParams: {
          mapTitle: 'XYZ,
          comment: 'xyz'
      }
});

The parameters seem to be ignored, the map is always printed at the same scale(which is listed in .yaml) and does not take into account the scale I set, or the rotation.

pages:[{"center":[2782987.2698318395,5780349.220256353],"scale":2576870,"rotation":0}]

I need help understanding why is this happening and how can I make it listen to my configurations?

The request being sent to the server is here: POST XHR
http://localhost:8080/geoserver/pdf/create.json

{"units":"m","srs":"EPSG:3857","layout":"A4","dpi":150,"outputFormat":"pdf","outputFilename":"leaflet-map","layers":[{"baseURL":"http://server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/","opacity":1,"type":"OSM","extension":"png","tileSize":[256,256],"maxExtent":[-20037508.34,-20037508.34,20037508.34,20037508.34],"resolutions":[156543.03390625,78271.516953125,39135.7584765625,19567.87923828125,9783.939619140625,4891.9698095703125,2445.9849047851562,1222.9924523925781,611.4962261962891,305.74811309814453,152.87405654907226,76.43702827453613,38.218514137268066,19.109257068634033,9.554628534317017,4.777314267158508,2.388657133579254],"singleTile":false}],"pages":[{"center":[2783012.2521448596,5780253.74709147],"scale":2576870,"rotation":0}],"mapTitle":"XYZ","comment":"xyz ","legends":[]}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions