Creates a mask layer.
It should be added in a Map to be displayed in the instance.
See the example for more information on layer creation.
The layer options.
ReadonlycolorThe colormap of this layer
ReadonlycomputeReadonlyextentThe extent of this layer
Disables automatic updates of this layer. Useful for debugging purposes.
ReadonlyidThe unique identifier of this layer.
ReadonlyinterpretationReadonlyisRead-only flag to check if a given object is of type ColorLayer.
ReadonlyisRead-only flag to check if a given object is of type Layer.
ReadonlyisRead-only flag to check if a given object is of type MaskLayer.
ReadonlyisReadonly flag to indicate that his object implements MemoryUsage.
ReadonlyisReadonlynameOptional name of this layer.
ReadonlynoReadonlyresolutionThe resolution factor applied to the textures generated by this layer.
ReadonlyshowReadonlyshowReadonlysourceThe source of this layer
ReadonlyuserAn object that can be used to store custom data about the Layer.
Gets or sets the blending mode of this layer.
Gets or sets the brightness of this layer.
Gets the colorimetry parameters of this layer.
Gets or sets the contrast of this layer.
Gets the elevation range of this layer, if any.
Sets the elevation range of this layer. Setting it to null removes the elevation range.
ProtectedinstanceGets whether the object is currently performing an asynchronous operation.
Gets or sets the opacity of this layer.
Returns the percentage of progress, in normalized value (i.e in the [0, 1] range), of the asynchronous operations that are scheduled to run on this object. 1 means that all operations have finished.
Gets or sets the saturation of this layer.
Gets or sets the visibility of this layer.
ProtectedadjustProtectedadjustAdjusts the extent to avoid visual artifacts.
The original extent.
The width, in pixels, of the original extent.
The height, in pixels, of the original extent.
And object containing the adjusted extent, as well as adjusted pixel size.
ProtectedapplyImmediately applies a temporary texture to the target while the actual texture is being asynchronously processed, to avoid displaying a black texture.
ProtectedapplyResets all render targets to a blank state and repaint all the targets.
Optionalextent: ExtentAn optional extent to limit the region to clear.
The extent to test.
true if this layer contains the specified extent, false otherwise.
Disposes the layer. This releases all resources held by this layer.
Returns the final extent of this layer. If this layer has its own extent defined, this will be used. Otherwise, will return the source extent (if any). May return undefined if not pre-processed yet.
The layer final extent.
Returns an approximation of the memory used by this object, in bytes.
The graphics context.
Get the pixels colors of this layer at coordinate. This will samples all pixel colors within a square region of specified size, centered at the given coordinate. Returns undefined if no non-transparent (colored) pixels are found, or if no texture is available for this coordinate.
Note: only 8-bit layers are supported. If the layer has non 8-bit pixels, returns undefined.
The coordinate to sample.
Optionalsize?: numberThe size, in pixels, of the square to sample
The colors
Returns all features at some coordinates, with an optional hit tolerance radius.
Array of features at coordinates (can be empty)
Get all features whose bounding box intersects the provided extent. Note that this returns an array of all features intersecting the given extent in random order (so it may include features whose geometries do not intersect the extent).
Array of features intersecting the extent (can be empty)
Returns true if this layer has loaded data for this node.
ProtectedonCalled when the layer has finished initializing.
Called when the rendering context has been lost.
Called when the rendering context has been restored.
ProtectedonGiven a PickResult, returns and assigns its features.
Implementations must set pickedResult.features to the returned result.
Picked result
Optionaloptions: PickOptionsOptions
Features
Protectedupdate
A ColorLayer that can be used to mask parts of a map. The source can be any source supported by the color layers.