BitmapLayer Class
Represents a layer set which caches the visualization of its sub-layers as a bitmap.
NuGet/Assembly: Carmenta.Engine.5.16.2.nupkg (in the CECore assembly)
Syntax
public class BitmapLayer : LayerSet
Remarks
This type has been deprecated, and may be removed in future a version. Use TileLayer or OrdinaryLayer with dynamic caching instead.
A BitmapLayer makes its sub-layers draw themselves on a bitmap, and then copies the bitmap to the drawable connected to the view. The bitmap will only be regenerated when the visible area changes or an application explicitly flushes the cached bitmap. This makes it efficient to use a BitmapLayer for the background layers that seldom change. When the view is panned, the part of the bitmap that is still visible can be reused, which makes small pans very efficient.
It is also efficient to use a BitmapLayer when objects should be moved on the map and when there is interaction on the map. Then put the layers with the static background in a BitmapLayer and draw the layers with moving objects on top of this.
BitmapLayer instances can be transparent, this means that they can be stacked on top of other layers, including other bitmap layers.
![]() |
This image of a configuration is from an application displaying flying objects every second - the view is updated by a timer each second.
BitmapLayer0 is a BitmapLayer that contains an OrdinaryLayer with a typical static background map which almost never needs a re-reading (unless when you are moving to a new area).
BitmapLayer1 is a BitmapLayer that contains data from the defence staff describing the current fronts that change every hour or so.
BitmapLayer2 is a BitmapLayer that contains data from the defence staff describing the current troop movements that change every 10th second or so.
The layers called Airplanes and Cars are for the dynamic objects - they are always re-read.
Why should you do like this? Well, if you have really fast maps with update time less than 100 ms or so it is no problem - then you should not use bitmap layers at all but usually background maps and other data is more demanding than so. By using bitmap layers we make a snapshot of the presentation in the bitmap layers and thus avoiding the need to re-read and re-render data for every update (and a bitmap is really fast to draw) as long as we stay on the same area.
But what happens if we have new troop movements? Then the snapshot (bitmap) in BitmapLayer2 is out of date and must be re-read and re-rendered with the new data - then we call FlushCache on BitmapLayer2 to delete the bitmap and force it to update itself the next time the view is updated.
A BitmapLayer automatically detects when sub-layers are being added or removed, turned on or off or flushed, or the MinScale or MaxScale properties of a sub-layer are changed. In these cases, there is no need for an application to explicitly call FlushCache.
Inheritance Hierarchy
System.Object (not available in C#)
EngineObject
Layer
LayerSet
BitmapLayer
Platforms
Windows, Linux, Android
BitmapLayer Members
The BitmapLayer type has the following members.
Constructors
Name | Description |
---|---|
BitmapLayer | Initializes a new instance of the BitmapLayer class. |
Properties
Name | Description |
---|---|
BlendMode | Gets or sets the blend mode that determines how the layer is combined with previously rendered layers. Inherited from Layer |
Condition | Gets or sets the Condition that determines whether the BitmapLayer is drawn or not. Inherited from Layer |
CoverageHint | Gets or sets a value that can assert that the visualization is fully opaque within the data extent. Inherited from Layer |
Description | Gets or sets a short description of the layer. Inherited from Layer |
DisableOnError | Gets or sets a value specifying if an error within the layer should automatically disable the layer, or throw an exception. Inherited from Layer |
DisplayName | Gets or sets a display name for the layer. Inherited from Layer |
Effects | List of effects Inherited from Layer |
Enabled | Determines whether the BitmapLayer is enabled or not. Inherited from Layer |
EnabledDuringQuickUpdates | Determines whether the BitmapLayer is temporarily turned off during mouse interactions. Inherited from Layer |
IsDisposed | Gets a value that tells whether the current BitmapLayer has been disposed. Inherited from EngineObject |
IsoMetadataDocument | Gets or sets the path or URL to an ISO 19139 metadata document for the layer. Inherited from Layer |
Layers | Gets the child layers of this BitmapLayer. Inherited from LayerSet |
Legend | Gets or sets a map legend associated with this layer. Inherited from Layer |
MaxScale | Gets or sets the highest inverted nominal scale in a 2D view, or the furthest distance in a 3D globe view, at which objects from this BitmapLayer should be drawn. Inherited from Layer |
MinScale | Gets or sets the lowest inverted nominal scale this BitmapLayer should be drawn at. Inherited from Layer |
Name | Gets or sets the name of the layer. Inherited from Layer |
NamedStyles | Gets the list of named styles that can be enabled for the layer. Inherited from Layer |
NativeHandle | Gets the native Carmenta Engine kernel object the current BitmapLayer represents. Inherited from EngineObject |
Opacity | Gets or sets a value that specifies the opacity of the layer. Inherited from Layer |
Scrollable | Gets or sets a boolean value indicating if valid areas of the bitmap should be reused during pans. |
Selectable | Gets or sets a value that determines whether features in this BitmapLayer can be selected. Inherited from Layer |
Transparent | Gets or sets a value that indicates whether the layer has a transparent background. |
IUserProperties.UserProperties | Gets the AttributeSet that contains the user properties. Inherited from IUserProperties |
Methods
Name | Description |
---|---|
Clone | Creates a copy of an object. Inherited from EngineObject |
Dispose | Releases the reference to the native Carmenta Engine kernel instance the EngineObject represents. Inherited from EngineObject |
EnableStyle | Enables or disables a named style for the layer. Inherited from Layer |
Equals | Determines whether this instance is equal to another. Inherited from EngineObject |
FindChildObject | Overloaded. Finds the child object with the specified name. Inherited from Layer |
FlushCache | Marks the layer as flushed which will release cached resources during the next update. Inherited from Layer |
GetChildObjects | Overloaded. Gets the child objects of the current object. Inherited from Layer |
GetDataBounds | Calculates the bounds of all dataset coverages in the layer. Inherited from Layer |
GetFeatureAttributes | Gets information about all attributes that may be present on features in this layer. Inherited from Layer |
GetFeatures | Overloaded. Gets features from the layer and any child layers. Inherited from Layer |
GetLastError | Gets the error message for the last error that occurred within the layer. Inherited from Layer |
GetLocalizedDescription | Gets a localized version of the layer description in a specific language. Inherited from Layer |
GetLocalizedDisplayName | Gets a localized version of the layer display name in a specific language. Inherited from Layer |
GetLocalizedIsoMetadataDocument | Gets the path to an ISO 19139 metadata document for a specific language. Inherited from Layer |
HasLocalizedDescription | Checks if a localized version of the layer description is available in a specific language. Inherited from Layer |
HasLocalizedDisplayName | Checks if a localized version of the layer display name is available in a specific language. Inherited from Layer |
HasLocalizedIsoMetadataDocument | Checks if an ISO 19139 metadata document is available for a specific language. Inherited from Layer |
IsStyleEnabled | Checks if a certain style is enabled for the layer or not. Inherited from Layer |
MoveLayer | Moves a child layer to a new position. Inherited from LayerSet |
SetLocalizedDescription | Sets a layer description in a specific language. Inherited from Layer |
SetLocalizedDisplayName | Sets a layer display name in a specific language. Inherited from Layer |
SetLocalizedIsoMetadataDocument | Sets the path to an ISO 19139 metadata document for the layer, for a specific language. Inherited from Layer |
Events
Name | Description |
---|---|
EnabledChanged | Occurs when the value of the Enabled property has changed. Inherited from Layer |