new ImageryLayer(imageryProvider)
Image layer class, used to display tile image data provided by image providers.
| Name | Type | Default | Description |
|---|---|---|---|
imageryProvider |
ImageryProvider |
Designated image provider. |
|
options.rectangle |
Rectangle | imageryProvider.rectangle |
optional
The rectangular range of the layer, which limits the visible range of the image. |
options.alpha |
Number | function | 1.0 |
optional
The transparency value of the layer ranges from 0.0 to 1.0. |
options.brightness |
Number | function | 1.0 |
optional
Layer brightness value. A value of 1.0 indicates the use of the original image; When the value is greater than 1.0, the image will become brighter; When the value is less than 1.0, the image will darken. |
options.contrast |
Number | function | 1.0 |
optional
Layer contrast. A value of 1.0 indicates the use of the original image; A value greater than 1.0 indicates an increase in contrast; A value less than 1.0 indicates a decrease in contrast. |
options.hue |
Number | function | 0.0 |
optional
Layer color tone. A value of 0.0 indicates the use of the original image. |
options.saturation |
Number | function | 1.0 |
optional
Layer saturation. A value of 1.0 indicates the use of the original image; A value greater than 1.0 indicates an increase in saturation; A value less than 1.0 indicates a decrease in saturation. |
options.gamma |
Number | function | 1.0 |
optional
Gamma correction of layers. A value of 1.0 indicates the use of the original image. |
options.show |
Boolean | true |
optional
Specify whether the layer should be displayed, true indicates displaying this layer, false indicates not displaying. |
options.splitDirection |
ImagerySplitDirection | function | ImagerySplitDirection.NONE |
optional
Specify the direction of image layer segmentation. |
options.minimumTerrainLevel |
Number |
optional
Minimum level of terrain detail. Level 0 is the minimum level of detail. |
|
options.maximumTerrainLevel |
Number |
optional
Maximum level of terrain detail. |
Example
var imageryProvider = new SuperMap3D.SuperMapImageryProvider({
url : ‘http://localhost:8090/iserver/services/datas/China’
});
// Create an imagery layer from an imagery provider
var imageryLayer = new SuperMap3D.ImageryLayer(imageryProvider);
Members
-
alphaNumber
-
The transparency value of the layer ranges from 0.0 to 1.0. 0.0 represents complete transparency; 1.0 indicates complete opacity.
- Default Value: 1.0
ancestorMaximumLevelNumber
When the target level is not ready, allow the control image to search up to the maximum level for rendering.
- Default Value: undefined 默认不限制向上查找层级
Example
ImageryLayer.ancestorMaximumLevel = 2(建议向上查找2层影像)
brightnessNumber
Layer brightness value. A value of 1.0 indicates the use of the original image; When the value is greater than 1.0, the image will become brighter; When the value is less than 1.0, the image will darken.
colorToAlphaColor
It should be set to a transparent color value.
colorToAlphaThresholdNumber
Normalization threshold from color to alpha (0-1).
contrastNumber
Layer contrast. A value of 1.0 indicates the use of the original image; A value greater than 1.0 indicates an increase in contrast; A value less than 1.0 indicates a decrease in contrast.
cutoutRectangleRectangle
The rectangular cutout in this layer of the image.
filterColorColor
The filter color will be mixed with the image color after setting, and the internal calculation rule is: color=color * filterColor.
gammaNumber
Gamma correction of layers. A value of 1.0 indicates the use of the original image.
hueNumber
Layer color tone. A value of 0.0 indicates the use of the original image.
indexedDBSettingObject
Get or set whether the index edDB tile for the image is enabled (not supported by IE browser)
Example
// Set whether to save image tiles to the browser's IndexedDB database
var imageryLayer = viewer.imageryLayers.get(1);
imageryLayer.indexedDBSetting.isOpen = true;
invertColorEnableBoolean
Whether to invert the color of the image, the internal calculation rule is: color=1.0-color.
- Default Value: false
lodOffsetNumber
Get or set the offset when loading image layers. The offset here refers to the offset at the level of detail. The larger the value, the higher the level of detail, the finer the loaded image layer, and the clearer the image. When the value is negative, the image becomes more blurry. Note: The value here can only be set as an integer. The default value is 0, without offset.
- Default Value: 0
magnificationFilterTextureMagnificationFilter
The TextureMagnification Filter applied to this layer. Possible values include TextureMagnification Filter. LINEAR (default value) and TextureMagnification Filter. NEAREST.
In order for it to take effect, this property must be set immediately after adding the image layer. Once the texture is loaded, the texture filter used cannot be changed.
- Default Value:
ImageryLayer.DEFAULT_MAGNIFICATION_FILTERminificationFilterTextureMinificationFilter
Text Minification Filter applied to this layer. Possible values include TextureMinificationFilter. LINEAR (default) and TextureMinificationFilter. NEREST.
In order for it to take effect, this property must be set immediately after adding the image layer. Once the texture loading is complete, the texture filter used cannot be changed.
- Default Value:
ImageryLayer.DEFAULT_MINIFICATION_FILTERnameString
Retrieve the name of the provider in the image layer.
Example
var name = ImageryLayer.name;
saturationNumber
Layer saturation. A value of 1.0 indicates the use of the original image; A value greater than 1.0 indicates an increase in saturation; A value less than 1.0 indicates a decrease in saturation.
showBoolean
Specify whether the current layer is displayed.
- Default Value: true
splitDirectionImagerySplitDirection
Specify the ImagerySplitDirection for image layer segmentation, which controls the image layer to be displayed only in the left or right area of the segmentation bar.
swipeEnabledBoolean
Gets or sets whether to enable the swipe function.
swipeRegionRectangle
Gets or sets the quadrilateral region for the swipe.
transparentBackColorColor
Set the transparency color of the image.
transparentBackColorToleranceNumber
Set the transparency color tolerance of the image, with a value range of 0.0~1.0. 0.0 indicates opacity.
Methods
-
destroy(){undefined}
-
Release the resources occupied by the object.
Returns:
Type Description undefined Return undefined. Example
imageryLayer = imageryLayer && imageryLayer.destroy(); -
getViewableRectangle(){Promise}
-
Get the visible range of the layer.
Returns:
Type Description Promise A rectangular object representing the visible range of a layer. Example
// Zoom to an imagery layer. imageryLayer.getViewableRectangle().then(function (rectangle) { return camera.flyTo({ destination: rectangle }); }); -
getVisibleInViewport(index){Boolean}
-
Obtain the visibility of the viewport corresponding to the layer
Name Type Description indexNumber Index
Throws:
-
the index is 0~8
- Type
- DeveloperError
Returns:
Type Description Boolean Visible visibility -
-
isBaseLayer(){Boolean}
-
Determine whether the layer is a base layer in the ImageryLayerCollection. The base layer is special and is considered to have a global rectangle.
Returns:
Type Description Boolean True represents the base layer; False indicates a non base layer. Example
var isBaseLayer = imageryLayer.isBaseLayer(); -
isDestroyed(){Boolean}
-
Return whether to release the resources occupied by the object.
- See:
Returns:
Type Description Boolean Whether to release the occupied resources. -
setVisibleInViewport(index, visible)
-
Set layer corresponding viewport visibility
Name Type Description indexNumber Index
visibleBoolean visibility
Throws:
-
the index is 0~8
- Type
- DeveloperError
-