Ready to Print

Feedback


The Web content that the SuperMap iServer Web printing service supports for printing is a WebMap, which is a map created online. When creating a print task using iServer Web printing service, you need to provide the "JavaScript Object Notation" (JSON) representation of the WebMap in the input request body. This JSON must be built according to the SuperMap WebMap specification.

Use SuperMap iPo rtal of data on the map Web App to make a WebMap without building for The JSON worry is that you simply pass the URL of a SuperMap iPortal WebMap in the URL parameter in the content object of the request body. Address, for example:

{

    "content": {

        "type": "WEBMAP",

        "url":"http://supermapiportal:8190/iportal/web/maps/{mapid}/map.rjson"

     },

    "layoutOptions": {

           ......

     },

    "exportOptions": {

          ......

     }

}

You can also pass a complete SuperMap iPortal data in the JSON representation of the WebMap created in the content object of the request body, such as:

{

    "content": {

        "type": "WEBMAP",

        "value": {

            "extent": {

                "leftBottom": {

                    "x": -20037508.3427892,

                    "y": -20037508.3427891

                },

                "rightTop": {

                    "x": 20037508.3427892,

                    "y": 20037508.3427891

                }

            },

            "maxScale": "1:144447.927",

            "level": 4,

            "center": {

                "x": 11382417.9336122,

                "y": 4134167.44525748

            },

            "baseLayer": {

                "layerType": "TILE",

                "name": "ChinaDark",

                "url": "https://iserver.supermap.io/iserver/services/map-china400/rest/maps/ChinaDark"

            },

            "layers": [

                {

                    "layerType": "VECTOR",

                    "visible": true,

                    "name": "Records of earthquakes of magnitude 6 or above in Chinese history",

                    "featureType": "POINT",

                    "xyField": {

                        "xField": "Longitude",

                        "yField": "Latitude"

                    },

                    "style": {

                        "fillColor": "#EE4D5A",

                        "strokeWidth": 1,

                        "offsetX": 0,

                        "offsetY": 0,

                        "fillOpacity": 0.9,

                        "radius": 8,

                        "strokeColor": "#ffffff",

                        "type": "BASIC_POINT",

                        "strokeOpacity": 1

                    },

                    "projection": "EPSG:4326",

                    "enableFields": [

                        "Year",

                        "Month",

                        "Day",

                        "Time",

                        "Minute",

                        "Seconds",

                        "Longitude",

                        "Latitude",

                        "Depth",

                        "Magnitude",

                        "Magnitude Type",

                        "Reference place name"

                    ],

                    "dataSource": {

                        "name": "ChinaRecordOfOver6Earthquakes",

                        "type": "SAMPLE_DATA"

                    }

                }

            ],

            "description": "",

            "projection": "EPSG:3857",

            "minScale": "1:591658710.909",

            "title": "testdizhen",

            "version": "2.2.1",

            "rootUrl": "https://iptl.supermap.io/iportal/services/../"

        }

    },

    "layoutOptions": {

           ......

     },

    "exportOptions": {

          ......

     }

}

Currently, the WebMap layers supported by the Web printing service include: vector layer, Tianditu, WMS, WMTS, iServer REST map services and temporary layers, single-value thematic maps, segmented thematic maps, grade symbol thematic maps, and labeling layers. The layers in the corresponding SuperMap WebMap specification are VectorLayer, TiandituLayer, WMSLayer, WMTSLayer, TileLayer, UniqueLayer, RangeLayer, RankSymbolLayer、MarkerLayer、MapStylerLayer。

Note: For the tianditu service, the Web print service also supports printing the sky map loaded in the form of WMTS. For the construction of the request body, refer to the WMTSLayer. It should be noted that if the sky map you load is EPSG: 3857 coordinate system, an additional matrix array parameter: matrices needs to be added in the request body of the WMTS layer. The specific request example is as follows:

{

    "layers": [

        {

            "layerType": "WMTS",

            "name": "vec",

            "visible": true,

            "url": "http://t0.tianditu.gov.cn/vec_w/wmts?tk=67942a36e0dd97aa9d72f42393454241",

            "tileMatrixSet": "w",

            "matrices": [

                {

                    "identifier": "1",

                    "matrixSize": [

                        2,

                        2

                    ],

                    "scaleDenominator": 279541131.975446,

                    "tileSize": [

                        256,

                        256

                    ],

                    "topLeftCorner": [

                        -20037508.34,

                        20037508

                    ]

                }

            ],

            "layer": "vec",

            "requestEncoding": "KVP",

            "opacity": 1,

            "style": "default",

            "imageFormat": "tiles"

        }

    ]

}