PrintSnapshot - geosolutions-it/MapStore GitHub Wiki
The PrintSnapshot plugin makes it possible to produce an image containing the Map overlays. This uses 'canvas' through the 'canvg' JS library in MapStore. The dynamic rendering ServiceBox is used from this plugin in order to produce the resulting image.
ServiceBox is basically a backend support that allows this functionalities through 'ad hoc' Java Servlets. You can find all necessary information about how to build and deploy ServiceBox here.
When you have build and deployed the ServiceBox backend component, you can enable the PrintSnapshot plugin simply adding the proper configuration below inside the mapStoreConfig.js file (default) or your own configuration file used.
In order to enable the 'PrintSnapshot' in your MapStore instance read the instructions below.
-
Open the 'buildjs.cfg' file and check if the dependency below is present:
#. plugins/PrintSnapshot.js // Inside the GXP block #. [canvg-1.2.js] root = app/static/externals/canvg-1.2/ include = canvg.js rgbcolor.js
-
Below a possible configuration of the 'PrintSnapshot' plugin to use in your MapStore configuration:
{ "ptype":"gxp_printsnapshot", "service": "http://localhost:8080/servicebox/", "customParams":{ "outputFilename":"mapstore-print" }, "actionTarget":{ "target":"paneltbar", "index":5 } }
ptype
: ptype of the pluginactionTarget
: the tool location inside the MapStore GUI.outputFilename
: the resulting file name (the snapshot).