SuperMap iPortal 9D(2019) SP1+ provides the WebMap specification. WebMap is a JSON Schema that defines the standard format of map content in iPortal. When using the WebMap REST API to query/modify the content of a map, the passed JSON object must conform to the WebMap specification. Otherwise, a map that conforms to the WebMap specification can be used across SuperMap related products. For example, a WebMap map created in DataViz WebApp can also be used in DataInsight WebApp.
This section below shows the class structure of the WebMap specification and provides some examples for your reference. For the specific content of WebMap schema file, download: WebMap-Schema.json,
Attribute | Type | Description |
title |
string |
[Required] The map name |
version |
string |
[Required] The version number of the WebMap specification. The optional constants are 1.0, 2.0.0, 2.1.0, and 2.2.1. |
projection |
string |
[Required] The projected coordinate system of the map, which uses the EPSG or WKT coordinate system description standard. Example: "EPSG:3857" |
baseLayer |
object |
[Required] The base map of the map. Supported base map types: TiandituLayer, InternetMap, WMTSLayer, WMSLayer, TileLayer, MapStylerLayer |
minScale |
string |
[Required] The minimum visible scale of the map. When the current map scale is smaller than this value, the map will not be displayed. |
maxScale |
string |
[Required] The maximum visible scale of the map. When the current map scale is greater than this value, the map will not be displayed. |
rootURL |
string |
[Internal attribute] The root url of the map address, i.e., the iPortal service address, used in WebPrinting service. Note: You don't need to fill in this value. When accessing a specific map json representation (http://<server>:<port>/iportal/web/maps/{id}/map.json), iPortal will pass the value to the corresponding response. |
description |
string |
[Optional] The map description |
layers |
array<object> |
[Optional] The layers superimposed on the map. The layers below are supported to be added: TileLayer, HostedTileLayer, WMTSLayer, WMSLayer、MarkerLayer, VectorLayer, UniqueLayer, RangeLayer, RankSymbolLayer, MigrationLayer, HeatLayer, MapStylerLayer, DataflowPointTrackLayer, DataflowHeatLayer。 |
extent |
Rectangle2D | [Optional] The map extent. |
visibleExtent |
array<number> |
[Optional] The visible range of the current map window, storing the coordinates of the vertices of the lower left corner and the upper right corner of the rectangular area of the visible range. |
level |
number |
[Optional] The zoom level of the map, the value range is 0-22. |
center |
Point2D |
[Optional] The map center. |
grid |
Graticule |
[Optional] Added graticule. |
Create a map object that conforms to the WebMap specification, where the map uses OpenStreetMap as the basemap, and superimposes a gratitude symbol thematic map layer.
{
"version": "2.2.1",
"title": "China",
"description": "",
"projection": "EPSG:3857",
"center": {
"x": 12561308.6318938,
"y": 4061850.69482617
},
"level": 5,
"extent": {
"leftBottom": {
"x": -20037508.3427892,
"y": -20037508.3427892
},
"rightTop": {
"x": 20037508.3427892,
"y": 20037508.3427892
}
},
"baseLayer": {
"layerType": "OSM",
"name": "OpenStreetMap"
},
"layers": [
{
"layerType": "VECTOR",
"name": "Capitals",
"visible": true,
"featureType": "POINT",
"xyField": {
"xField": "X",
"yField": "Y"
},
"projection": "EPSG:4326",
"enableFields": [
"X",
"Y",
"Province",
"Provincial capitals"
],
"style": {
"radius": 8,
"fillColor": "#b8e986",
"fillOpacity": 0.9,
"strokeColor": "#ffffff",
"strokeWidth": 1,
"strokeOpacity": 1,
"offsetX": 0,
"offsetY": 0,
"type": "BASIC_POINT"
},
"visibleScale": {
"maxScale": "1:2256.999",
"minScale": "1:591658710.909"
},
"dataSource": {
"type": "PORTAL_DATA",
"serverId": "979738148",
"accessType": "DIRECT"
}
}
],
"minScale": "1:591658710.909",
"maxScale": "1:2256.999",
"grid": {
"graticule": {
"extent": [
-20037508.3427892,
-20037508.3427892,
20037508.3427892,
20037508.3427892
],
"strokeColor": "#F6C158",
"strokeWidth": 2,
"lineDash": [
0.5,
4
],
"interval": [
5
],
"lonLabelStyle": {
"fontFamily": "Calibri,sans-serif",
"textBaseline": "bottom",
"fill": "#000000",
"outlineColor": "rgba(255,255,255,0.85)",
"outlineWidth": 3,
"fontSize": "12px"
},
"latLabelStyle": {
"fontFamily": "Calibri,sans-serif",
"textBaseline": "bottom",
"fill": "#000000",
"outlineColor": "rgba(255,255,255,0.85)",
"outlineWidth": 3,
"fontSize": "12px"
}
}
}
}
Visit http://127.0.0.1:8190/iportal/web/maps/1481260482/map.json to read the class structure information of the map object that conforms to the WebMap specification.
{
"extent": {
"leftBottom": {
"x": -20037508.3427892,
"y": -20037508.3427892
},
"rightTop": {
"x": 20037508.3427892,
"y": 20037508.3427892
}
},
"maxScale": "1:2256.999",
"level": 5,
"center": {
"x": 12561308.6318938,
"y": 4061850.69482617
},
"baseLayer": {
"layerType": "OSM",
"name": "OpenStreetMap"
},
"layers": [
{
"layerType": "VECTOR",
"visible": true,
"visibleScale": {
"maxScale": "1:2256.999",
"minScale": "1:591658710.909"
},
"name": "Capitals",
"featureType": "POINT",
"xyField": {
"xField": "X",
"yField": "Y"
},
"style": {
"fillColor": "#b8e986",
"strokeWidth": 1,
"offsetX": 0,
"offsetY": 0,
"fillOpacity": 0.9,
"radius": 8,
"strokeColor": "#ffffff",
"type": "BASIC_POINT",
"strokeOpacity": 1
},
"projection": "EPSG:4326",
"enableFields": [
"X",
"Y",
"Province",
"Provincial capitals"
],
"dataSource": {
"accessType": "DIRECT",
"type": "PORTAL_DATA",
"serverId": "979738148"
}
}
],
"description": "",
"projection": "EPSG:3857",
"minScale": "1:591658710.909",
"title": "China",
"version": "2.2.1",
"rootUrl": "http://127.0.0.1:8190/iportal/services/../"
}