new SuperMapImageryProvider()
Provide image tiles through SuperMap iServer REST API.
| Name | Type | Default | Description |
|---|---|---|---|
options.url |
String |
Image service address. |
|
options.name |
String | '' |
optional
Image layer name. |
options.minimumLevel |
Number | 0 |
optional
The minimum level. |
options.maximumLevel |
Number | 20 |
optional
The maximum level. |
options.transparent |
boolean | true |
optional
Set the parameter of the requested map service to transparent. |
options.credit |
String | 'MapQuest, SuperMap iServer Imagery' |
optional
Image service description information. |
options.tileFormat |
String | '' |
optional
The image format is PNG by default. |
options.cacheKey |
String |
optional
3D image tile key. |
|
options.layersID |
String |
optional
Image layer ID. |
|
options.prjCoordSys |
Object |
optional
When dynamically plotting, the specified projection coordinate system provided by iServer's dynamic plotting service can be used. When the coordinate system set by this parameter is different from the original coordinate system of the map, dynamic projection will be performed and the map image after dynamic projection will be returned |
|
options.useGSG |
boolean | false |
optional
The partitioning method when loading the REST dynamic map service. Default is local partitioning, set to true to use global partitioning method. |
options.tileWidth |
Number | 256 |
optional
Set the width of the image tiles. |
options.tileHeight |
Number | 256 |
optional
Set the height of the image tiles. |
options.chartSetting |
ChartSetting |
optional
Set the display parameter object for the nautical chart map service |
Example
// Create a provider.
var provider = new SuperMap3D.SuperMapImageryProvider({url : URL_CONFIG.ZF_IMG});,
prjCoordSys: {'epsgCode':4326});
// Create an imagery layer.
var layer = viewer.imageryLayers.addImageryProvider(provider);
Members
-
readonly creditCredit
-
Obtain the descriptive information object of the image service.
-
customRequestHeadersObject
-
Custom request header
-
readonly maximumLevelNumber
-
Get the maximum level (the maximum level that can be requested during LOD scheduling).
-
readonly minimumLevelNumber
-
Obtain the minimum level (the minimum level that can be requested during LOD scheduling).
-
nameString
-
Obtain the name of the imaging service.
-
packingRequest
-
Batch request encoding method.
- See:
-
readonly readyBoolean
-
Obtain whether the imaging service is ready.
-
readonly readyPromisePromise
-
Promise to obtain the request status of the service.
-
readonly rectangleRectangle
-
Obtain the rectangular range of the image service.
-
subdomainsString
-
Get or set the subdomain name. This interface allows you to request data from a specified subdomain.
-
readonly tileDiscardPolicyDiscardColorTileImagePolicy
-
Obtain the color ratio of discarded image tiles.
-
readonly tileFormatNumber
-
Obtain request slice format
-
readonly tileHeightNumber
-
Obtain tile height.
-
tileversionString
-
Retrieve the tile version name and match it with iServer.
-
readonly tileWidthNumber
-
Obtain tile width.
-
readonly tilingSchemeTilingScheme
-
Obtain projection methods (supporting latitude and longitude projection and Mercator projection).
-
readonly urlString
-
Obtain the URL of the imaging service.
Methods
-
setDisplayFilters(filters)
-
Set attribute filtering
Name Type Description filtersObject Attribute filtering criteria.
Example
var imageryProvider = new SuperMap3D.SuperMapImageryProvider({ url : ‘http://localhost:8090/iserver/services/datas/China’ }); var imageryLayer = new SuperMap3D.ImageryLayer(imageryProvider); imageryProvider.setDisplayFilters({ "CountryLabel@worldtest":"SmID==39" }); -
setLayerStatusParameters(v){*}
-
Set filtering criteria for map sub layers. Note: layerName corresponds to the layer name in the desktop software layer properties, not the layer title.
Name Type Description vArray Array of filtering conditions
Returns:
Type Description * Promise Example
普通过滤: viewer.imageryLayers.addImageryProvider(new SuperMap3D.SuperMapImageryProvider({ url: 'http/……/maps/……', layerStatusParameters: [{ layerName: '线1', isVisible: true, displayFilter: "stadedate2<20131024" }, { layerName: '线2', isVisible: false, }] })); 图层组过滤: var layer = viewer.imageryLayers.addImageryProvider(new SuperMap3D.SuperMapImageryProvider({ url: 'http/……/maps/……', })); var layers = layerName; // Sublayer name let params = []; for (var i = 0; i < layers.length; i++) { // Layer group array var layerGroupParams = { layerName: layers[i].name, isVisible: true, subLayers: [] } // Sublayer array var subLayerParams = layers[i].subLayers.layers; for (var j = 0; j < subLayerParams.length; j++) { var secondParam = { type: "UGC", layerName: subLayerParams[j].name, isVisible: true, displayFilter: 'SmID<4', }; layerGroupParams.subLayers.push(secondParam) } params.push(layerGroupParams); } layer.setLayerStatusParameters(params).then(res => { }) 按顺序显示: var provider = new SuperMap3D.SuperMapImageryProvider({ url: 'http/……/maps/……', }); var layer = viewer.imageryLayers.addImageryProvider(provider); provider.setLayerStatusParameters([ // 优先显示ContinentGoogle层 { layerName: "ContinentGoogle@World", isVisible: true }, { layerName: "Capital_P@World", isVisible: true }, { layerName: "Province_L@World", isVisible: true }, { layerName: "Countries@World#1", isVisible: true }, { layerName: "Capital_P@World#2", isVisible: true } ]); -
updateParams(options)
-
Update service request parameters and refresh corresponding image layers
Name Type Description optionsObject Service Request Parameter Object
Name Type Description displayFiltersObject Attribute filtering criteria.
chartSettingChartSetting optional Set the display parameter object for the nautical chart map service