DataSource |
The DataSource object defines all data source types and their attributes supported in the WebMap specification.
Attribute | Type | Description |
type |
string |
[Required] Fixed constant: "REST_DATA". |
url |
string |
[Required] The address (URI) of the datasource. |
dataSourceName |
string |
[Required] The name of the datasource. |
Create a layer conforming to the WebMap specification whose data source is RestData.
{
"layers": [
{
"layerType": "VECTOR",
"name": "World:Ocean",
"visible": true,
"featureType": "POLYGON",
"projection": "EPSG:4326",
"enableFields": [
"SMID",
"SMSDRIW",
"SMSDRIN",
"SMSDRIE",
"SMSDRIS",
"SMUSERID",
"SMAREA",
"SMPERIMETER",
"SMGEOMETRYSIZE",
"WRLD30_ID"
],
"style": {
"fillColor": "#826DBA",
"fillOpacity": 0.9,
"strokeColor": "#ffffff",
"strokeWidth": 1,
"strokeOpacity": 1,
"lineDash": "solid",
"type": "POLYGON"
},
"dataSource": {
"type": "REST_DATA",
"url": "http://192.168.17.199:8090/iserver/services/data-world/rest/data",
"dataSourceName": "World:Ocean"
}
}
],
}
Attribute | Type | Description |
type |
string |
[Required] Fixed constant: "REST_MAP". |
url |
string |
[Required] The address (URI) of the datasource. |
layerName |
string |
[Required] The name of the layer in the datasource. |
Create a layer conforming to the WebMap specification with the data source of the RestMap type.
{
"layers": [
{
"layerType": "RANGE",
"visible": true,
"dataSource": {
"layerName": "Shaanxi_County-level administrative division map@public data",
"type": "REST_MAP",
"url": "http://www.supermapol.com/iserver/services/map_ShiLiShuJu/rest/maps/Shaanxi_County-level administrative division map@public data"
},
"themeSetting": {
"themeField": "SmID",
"customSettings": [
{
"color": "#80ffff",
"segment": {
"start": 1,
"end": 18.67
}
},
...
],
"segmentMethod": "offset",
"segmentCount": 6,
"colors": [
"#80ffff",
"#2ea7f2",
"#000068"
]
},
"filterCondition": "",
"name": "Shaanxi_County-level administrative division map",
"featureType": "POLYGON",
"style": {
"fillColor": "#826dba",
"strokeWidth": 1,
"fillOpacity": 0.9,
"lineDash": "solid",
"type": "POLYGON",
"strokeColor": "#ffffff",
"strokeOpacity": 1
}
}
],
}
The data source is the sample data in iPortal.
Attribute | Type | Description |
type |
string |
[Required] Fixed constant: "SAMPLE_DATA". |
name |
string |
[Required]The name of the sample data, optional values: "BeijingResidentialDistrict","BeijingSubwayLine","ChinaEarthquakeIntensityZone","ChinaMeteorologicalObservationStation", "ChinaRecordOfOver6Earthquakes","GlobalRecordOfOver7Earthquakes","Sacramentorealestatetransactions","SalesJan2009". |
Create a WebMap-compliant layer whose data source is the sample data in iPortal.
{
"layers": [
{
"layerType": "VECTOR",
"name": "Beijing subway traffic lines",
"visible": true,
"featureType": "LINE",
"projection": "EPSG:4326",
"enableFields": [
"Standard name"
],
"style": {
"strokeColor": "#4CC8A3",
"strokeWidth": 2,
"strokeOpacity": 1,
"lineDash": "solid",
"type": "LINE"
},
"dataSource": {
"type": "SAMPLE_DATA",
"name": "BeijingSubwayLine"
}
}
],
}
The GeoJson data uploaded in iPortal.
Attribute | Type | Description |
type |
string |
[Required] Fixed constant: "USER_DATA". |
url |
string |
[Required] The address (URI) of the GeoJson data. |
Create a layer conforming to the WebMap specification whose data source is UserData.
{
"layers": [
{
"layerType": "VECTOR",
"name": "1",
"visible": true,
"featureType": "POLYGON",
"projection": "EPSG:4326",
"enableFields": [
"X",
"Y",
"District",
"Confirmed",
"Dead",
"Cured",
"Last",
"dataviz_featureID"
],
"style": {
"fillColor": "#826DBA",
"fillOpacity": 0.9,
"strokeColor": "#ffffff",
"strokeWidth": 1,
"strokeOpacity": 1,
"lineDash": "solid",
"type": "POLYGON"
},
"dataSource": {
"type": "USER_DATA",
"url": "https://iportal.supermap.io/iportal/apps/viewer/getUrlResource.json?url: https://cdn1.supermapol.com/statichtml/0218pm/Epidemic distribution.json"
}
}
],
}
The data uploaded in iPortal.
Attribute | Type | Description |
type |
string |
[Required] Fixed constant: "PORTAL_DATA". |
serverId |
string |
[Required] The generated data item id of the uploaded data. |
accessType |
string |
[Required] The data type in the data source. Optional values: "DIRECT", "REST_DATA", "REST_MAP". |
administrativeInfo |
[Optional] Adds datasource according to the administrative division. This attribute can be added only when the data type in the datasource is "DIRECT". |
Attribute | Type | Description |
divisionType |
string |
Administrative category division method, optional "Province", "City", "GB-T_2260" (province, city, code). |
divisionField |
string |
Administrative field. |
{
"layers": [
{
"layerType": "UNIQUE",
"name": "Capitals",
"visible": true,
"featureType": "POLYGON",
"projection": "EPSG:4326",
"dataSource": {
"type": "PORTAL_DATA",
"serverId": "1599597990",
"accessType": "DIRECT",
"administrativeInfo": {
"divisionType": "Province",
"divisionField": "Province"
}
},
"enableFields": [
"X",
"Y",
],
"style": {
"lineDash": "solid",
"strokeWidth": 1,
"strokeColor": "#ffffff",
"strokeOpacity": 1,
"fillOpacity": 0.9,
"fillColor": "#3288bd",
"type": "POLYGON"
},
"themeSetting": {
"themeField": "Province",
"colors": [
"#D53E4F",
"#FC8D59",
"#FEE08B",
...
],
"customSettings": {
"Xinjiang": "#d53e4f",
"Tibet": "#db4b50",
"Qinghai": "#f57f57",
"Gansu": "#fc8d59",
....
}
}
}
],
}