Hi Polen, currently you can only define layouts with a name in your config.yaml. You can add new ones, or modify the existing ones, than in the spec JSON you can specify the name of the layout you want to apply. Building a new layout from the client in real-time is not supported. Your layouts must be preconfigured in config.yaml
Mauro Il giorno mer 6 feb 2019 alle ore 13:11 Xemixal Z <polen.patow...@gmail.com> ha scritto: > Thanks Mauro for your quick response! > > I have gone through the docs. My question is that how can I make different > layout for different maps on the fly. > > How can I override the config.yaml specs on the run time? > > > Regards > > - Polen > > On Wed, Feb 6, 2019 at 1:44 PM Mauro Bartolomeoli < > mauro.bartolome...@geo-solutions.it> wrote: > >> Hi Polen, >> to customize the layout you have to edit the config.yaml file you can >> find in the printing folder of the GeoServer data dir. Documentation about >> this file is available here: >> http://www.mapfish.org/doc/print/configuration.html, while generic >> documentation on the printing module is here: >> https://docs.geoserver.org/latest/en/user/extensions/printing/index.html >> >> Please have a look at those and ask specific questions if you have any >> doubt on configuring your layout. >> Mauro >> >> Il giorno mer 6 feb 2019 alle ore 07:05 Xemixal Z < >> polen.patow...@gmail.com> ha scritto: >> >>> Hi, >>> >>> I have installed Geoserver Printing Module extension successfully and >>> trying to print a map using the following specifications using ajax >>> >>> >>> var specs = { >>> "units": "degrees", >>> "srs": "EPSG:4326", >>> "layout": "A4 portrait", >>> "dpi": 75, >>> "layers": [ >>> { >>> "baseURL": " >>> http://localhost:8080/geoserver/wms", >>> "opacity": 1, >>> "singleTile": false, >>> "type": "WMS", >>> "layers": [ >>> "topp:states" >>> ], >>> "format": "image/jpeg", >>> "styles": [ >>> "" >>> ], >>> "customParams": { >>> >>> } >>> } >>> ], >>> "pages": [ >>> { >>> "center": [ >>> -105.03125, //long >>> 40.87890625 //lat >>> ], >>> "scale": 4000000, >>> "rotation": "0", >>> "mapTitle": "USA Population", >>> "comment": "A custom comment" >>> } >>> ] >>> }; >>> >>> >>> >>> >>> >>> $.ajax( >>> { >>> url: ' >>> http://localhost:8080/geoserver/pdf/print.pdf', >>> data: 'spec=' + JSON.stringify(specs), >>> type: 'POST', >>> xhrFields: { >>> responseType: 'blob' >>> }, >>> success: function (data) >>> { >>> var blob = new Blob([data]); >>> var link = >>> document.getElementById('my-pdf'); >>> link.href = >>> window.URL.createObjectURL(blob); >>> link.download = "Pdf.pdf"; >>> alert("Success"); >>> }, >>> error: function () >>> { >>> alert("Failure"); >>> } >>> }); >>> } >>> >>> >>> >>> What I'm getting as output is the attached pdf. >>> >>> And I couldn't able to customize the layout. >>> >>> Please guide me what I'm missing. >>> >>> >>> Thanks >>> >>> - Polen >>> _______________________________________________ >>> Geoserver-users mailing list >>> >>> Please make sure you read the following two resources before posting to >>> this list: >>> - Earning your support instead of buying it, but Ian Turton: >>> http://www.ianturton.com/talks/foss4g.html#/ >>> - The GeoServer user list posting guidelines: >>> http://geoserver.org/comm/userlist-guidelines.html >>> >>> If you want to request a feature or an improvement, also see this: >>> https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer >>> >>> >>> Geoserver-users@lists.sourceforge.net >>> https://lists.sourceforge.net/lists/listinfo/geoserver-users >>> >> >> >> -- >> >> Regards, >> >> Mauro Bartolomeoli >> >> == >> GeoServer Professional Services from the experts! Visit >> http://goo.gl/it488V for more information. >> == >> >> Dott. Mauro Bartolomeoli >> @mauro_bart >> Technical Lead >> >> GeoSolutions S.A.S. >> Via di Montramito 3/A >> 55054 Massarosa (LU) >> Italy >> >> mobile: +39 393 904 1756 >> phone: +39 0584 962313 >> fax: +39 0584 1660272 >> >> http://www.geo-solutions.it >> http://twitter.com/geosolutions_it >> >> ------------------------------------------------------- >> >> Con riferimento alla normativa sul trattamento dei dati personali (Reg. >> UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si >> precisa che ogni circostanza inerente alla presente email (il suo >> contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è >> riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il >> messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra >> operazione è illecita. Le sarei comunque grato se potesse darmene notizia. >> >> This email is intended only for the person or entity to which it is >> addressed and may contain information that is privileged, confidential or >> otherwise protected from disclosure. We remind that - as provided by >> European Regulation 2016/679 “GDPR” - copying, dissemination or use of this >> e-mail or the information herein by anyone other than the intended >> recipient is prohibited. If you have received this email by mistake, please >> notify us immediately by telephone or e-mail. >> >> -- Regards, Mauro Bartolomeoli == GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Dott. Mauro Bartolomeoli @mauro_bart Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) Italy mobile: +39 393 904 1756 phone: +39 0584 962313 fax: +39 0584 1660272 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.
_______________________________________________ Geoserver-users mailing list Please make sure you read the following two resources before posting to this list: - Earning your support instead of buying it, but Ian Turton: http://www.ianturton.com/talks/foss4g.html#/ - The GeoServer user list posting guidelines: http://geoserver.org/comm/userlist-guidelines.html If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users