DataViz WebApp extension development open API |
Used to add an iServer RESTMAP service as a tiled layer on the map.
new DataViz.Plugins.DatavizPlugins().addTileLayer(layerInfo, url, token, addLayerCallback)
Parameter | Type | Description |
layerInfo | object | [Required] The layer information. The layerinfo object contains: id: The layer id, can't be set to 1 (if set to 1, the layer will conflict with the basemap) name: The layer name Example: {id: 11, name: 'tiled layer'} |
url | string |
[Required] The iServer RESTMAP service address. The url needs to be filled into the map name level |
token | string | [Optional] The token of the service. If the service is private, token is required to pass. |
addLayerCallback | Function | [Optional] The callback function. If the layer is added successfully, no value will be returned; if failed, a failure message will be returned. |
Used to add an iServer RESTDATA service as a vector layer on the map.
new DataViz.Plugins.DatavizPlugins().addVectorLayerFromUrl(layerInfo, url, addLayerCallback)
Parameter | Type | Description |
layerInfo | object | [Required] The layer information. The layerinfo object contains: id: The layer id, can't be set to 1 (if set to 1, the layer will conflict with the basemap) name: The layer name Example: {id: 11, name: vector layer'} |
url | string | [Required] The iServer RESTDATA service address. The url needs to be filled into the dataset name level |
addLayerCallback | Function | [Optional] The callback function. If the layer is added successfully, no value will be returned; if failed, a failure message will be returned. |
Used to add data in geojson format as a vector layer on the map.
new DataViz.Plugins.DatavizPlugins().addVectorLayerFromJSON(layerInfo, geojson, projection, addLayerCallback)
Parameter | Type | Description |
layerInfo | object | [Required] The layer information. The layerinfo object contains: id: The layer id, can't be set to 1 (if set to 1, the layer will conflict with the basemap) name: The layer name Example: {id: 11, name: vector layer'} |
geojson | geojson | [Required] The standard geojson format data |
projection | string | [Required] The coordinate system of the geojson data. Example: EPSG:4326 |
addLayerCallback | Function | [Optional] The callback function. If the layer is added successfully, no value will be returned; if failed, a failure message will be returned. |
Used to add an iServer RESTDATA service as a marker layer on the map.
new DataViz.Plugins.DatavizPlugins().addMarkerLayerFromUrl(layerInfo, url, addLayerCallback)
Parameter | Type | Description |
layerInfo | object | [Required] The layer information. The layerinfo object contains: id: The layer id, can't be set to 1 (if set to 1, the layer will conflict with the basemap) name: The layer name Example: {id: 11, name: marker layer'} |
url | string | [Required] The iServer RESTDATA service address. The url needs to be filled into the dataset name level |
addLayerCallback | Function | [Optional] The callback function. If the layer is added successfully, no value will be returned; if failed, a failure message will be returned. |
Used to add data in geojson format as a marker layer on the map.
new DataViz.Plugins.DatavizPlugins().addMarkerLayerFromJSON(layerInfo, geojson, projection, addLayerCallback)
Parameter | Type | Description |
layerInfo | object | [Required] The layer information. The layerinfo object contains: id: The layer id, can't be set to 1 (if set to 1, the layer will conflict with the basemap) name: The layer name Example: {id: 11, name: marker layer'} |
geojson | geojson | [Required] The standard geojson format data |
projection | string | [Required] The coordinate system of the geojson data. Example: EPSG:4326 |
addLayerCallback | Function | [Optional] The callback function. If the layer is added successfully, no value will be returned; if failed, a failure message will be returned. |
Used to add a WMTSLayer on the map.
new DataViz.Plugins.DatavizPlugins().addWMTSLayer(layerInfo, projection, addLayerCallback)
Parameter | Type | Description |
layerInfo | object | [Required] The layer information. The parameters of layerinfo object are described in the table below. |
projection | string | [Required] The coordinate system of the layer to add. The value should be consistent with the baselayer. Example: EPSG:4326 |
addLayerCallback | Function | [Optional] The callback function. If the layer is added successfully, no value will be returned; if failed, a failure message will be returned. |
The paramters of the layerInfo object:
Parameter | Type | Description |
id | string、number | [Required] The layer id, can't be set to 1 (if set to 1, the layer will conflict with the basemap) |
name | string | [Required] The layer name. |
url | string | [Required] The WMTS service address. The address should comply with OGC specifications. |
layer | string | [Required] The layer name in the WMTS service. |
tileMatrixSet | string | [Required] The tile matrix set corresponding to the layer in the WMTS service. |
requestEncoding | string | [Optional] The WMTS service access mode. Two access modes are available: HTTP KVP(key-Value Pair)or REST. KVP is used by default. |
Used to add a WMSLayer on the map.
new DataViz.Plugins.DatavizPlugins().addWMSLayer(layerInfo, addLayerCallback)
Parameter | Type | Description |
layerInfo | object | [[Required] The layer information. The parameters of layerinfo object are described in the table below. |
addLayerCallback | Function | [Optional] The callback function. If the layer is added successfully, no value will be returned; if failed, a failure message will be returned. |
The paramters of the layerInfo object:
Parameter | Type | Description |
id | string、number | [Required] The layer id, can't be set to 1 (if set to 1, the layer will conflict with the basemap) |
name | string | [Required] The layer name. |
url | string | [Required] The WMTS service address. The address should comply with OGC specifications. |
layers | array <string> |
[Required] The layer list in WMTS service. The first layer in the list is at the bottom, the next layer is placed on top of the previous one, and so on.The layer name is the value of the <Name> element in the <Layer> element. |
projection | string | [Required] The coordinate system of the layer to add. The value should be consistent with the baselayer. Example: EPSG:4326 |
Used to obtain the service capability document of a specified WMTS service.
new DataViz.Plugins.DatavizPlugins().getWMTSCapabilities(url, isKvp)
Parameter | Type | Description |
url | string | [Required] The WMTS service address. |
isKvp | boolean | [Required] The url method of requesting the document. true is kvp mode; false is restful mode. |
Used to remove the layer specified with id.
new DataViz.Plugins.DatavizPlugins().removeLayerById(layerId)
Parameter | Type | Description |
layerId | string、number | [Required] The layer id to be deleted. |
Used to get the current map object.
new DataViz.Plugins.DatavizPlugins().getOLMap()
ol.Map object