TranslucentMapLayerGroup class abstract

A translucent layer group that can be the target for MapLayerPriorityBuilder.inGroup.

Currently, only custom line layers can be added to a translucent layer group. Custom line layers in a translucent layer group are rendered in an offscreen translucent pass so that overlapping translucent line geometry is not alpha blended with itself. At creation, the layer group gets added to a map. The layer group gets removed from the map upon instance destruction and any layer (categories) still in the group are not rendered anymore, therefore it is recommended to keep a group alive as long as layers using the group are alive and in use.

Conceptual example to place line layers into a translucent group:

 // Create a translucent group with a unique name and a render priority
 final groupPriority = MapLayerPriorityBuilder().renderedLast().build();
 final group = TranslucentMapLayerGroup(name: "TranslucentGroupName", map, groupPriority);

 // Create a line layer to be rendered as part of the translucent group
 final lineLayerPriority = MapLayerPriorityBuilder()
     .inGroup("TranslucentGroupName") // places the line layer into the group
     .renderedFirst()                 // to be rendered first when the group is rendered
     .withCategory("SomeCategory")    // places the line layer category 'SomeCategory'
     .inGroup("TranslucentGroupName") // into the group
     .renderedLast()                  // to be rendered last when the group is rendered
     .build();

 final lineLayer = MapLayerBuilder()
     .withDataSource("DataSourceName", MapContentType.line)
     .forMap(map)
     .withName("LineLayerName")
     .withPriority(lineLayerPriority)
     .withStyle(translucentLineStyle) // E.g. "technique": "line" ... "color": "#FFFFFF80"
     .build();

 // Create a second line layer to be rendered as part of the translucent group
 final secondLineLayerPriority = MapLayerPriorityBuilder()
     .inGroup("TranslucentGroupName")      // places the second line layer into the group
     .renderedBeforeLayer("LineLayerName") // to be rendered before first layer
                                           // when the group is rendered
     .build();

 final secondLineLayer = MapLayerBuilder()
     .withDataSource("SecondDataSourceName", MapContentType.line)
     .forMap(map)
     .withName("SecondLineLayerName")
     .withPriority(secondLineLayerPriority)
     .withStyle(secondTranslucentLineStyle) // E.g. "technique": "line" ... "color": "#FFFFFF80"
     .build();

Note: This is a beta release of this feature, so there could be a few bugs and unexpected behavior. Related APIs may change for new releases without a deprecation process.

Constructors

TranslucentMapLayerGroup.create(String name, HereMapControllerCore aMap)
Creates an instance of the group.
factory
TranslucentMapLayerGroup.withPriority(String name, HereMapControllerCore aMap, MapLayerPriority priority)
Creates an instance of the group.
factory

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

destroy() → void
Frees all internally used resources.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setPriority(MapLayerPriority priority) → void
Sets the render priority for the layer group which replaces any previously defined priority.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited