Class: module:Service


new module:Service(url, $http, gettextCatalog, ngeoLayerHelper)

Provides a function to create ngeo.print.Service objects used to interact with MapFish Print v3 services.

ngeo.print.Service objects expose the following methods:

  • createSpec: create a report specification object
  • createReport: send a create report request
  • getStatus: get the status of a report
  • getReportUrl: get the URL of a report
  • getCapabilities: get the capabilities of the server
let printBaseUrl = '';
let print = new ngeo.print.Service(printBaseUrl);

let scale = 5000;
let dpi = 72;
let layout = 'A4 portrait';
let format = 'pdf';
let reportSpec = print.createSpec(map, scale, dpi, layout, format, {
  'title': 'A title for my report',
  'rotation': 45 // degree

See our live example: ../examples/mapfishprint.html

TODO and limitations:

  • createSpec should also accept a bbox instead of a center and a scale.
  • Add support for MapFish Print supports symbols like crosses, stars and squares, so printing regular shapes should be possible.
  • may use a sprite image, and offsets to define to rectangle to use within the sprite. This type of icons won't be printed correctly as MapFish Print does not support sprite icons.
Name Type Description
url string

URL to MapFish print web service.

$http angular.$http

Angular $http service.

gettextCatalog !angularGettext.Catalog

Gettext service.


Ngeo Layer Helper service.


(protected) vectorEncoder: ngeo.print.VectorEncoder