Returns an array of map scales that define when to switch between levels of detail.
This method allows the painter to support multiple visual representations (levels-of-detail, or LOD)
for the same feature depending on the map's current scale. The map determines the active level
and passes it to the painter via the paintState.level
property during rendering.
If the level changes due to map navigation (such as zooming, panning, or fitting), the map will call the paintBody and paintLabel methods with the corresponding level.
By default, this method returns null
, indicating that level-of-detail is not used.
Override this method to enable scale-based LOD behavior.
Optional
layer: FeatureLayerThe feature layer for which level-of-detail scales are requested.
Optional
map: MapThe map instance for which the scales apply.
An array of scales at which to switch to the next detail level, or null
if LOD is not used.
Invalidates this painter for a specific feature. Call this method when any state that affects the rendering of the given feature has changed. This method refreshes the associated FeatureLayer layer and ensures that FeaturePainter.paintBody and FeaturePainter.paintLabel will be called for the specified feature during the next map render.
Note: If the layer is currently invisible, the invalidation is deferred and will be applied when the layer becomes visible again.
the model feature whose representation has changed
Invalidates this painter for all features. Call this method when any state that affects the rendering of features has changed. This method refreshes the associated FeatureLayer layer and ensures that FeaturePainter.paintBody and FeaturePainter.paintLabel will be called for all features in the layer during the next map render.
Note: If the layer is currently invisible, the invalidation is deferred and will be applied when the layer becomes visible again.
Note that this is called automatically whenever Map.displayScale changes.
Invalidates this painter for a specific feature identified by its id. Call this method when any state that affects the rendering of the given feature has changed. This method refreshes the associated FeatureLayer layer and ensures that FeaturePainter.paintBody and FeaturePainter.paintLabel will be called for the specified feature during the next map render.
Note: If the layer is currently invisible, the invalidation is deferred and will be applied when the layer becomes visible again.
The id of the feature. It corresponds to Feature.id.
Renders a model object on the map.
This method is called by the map for each (feature, paintState)
combination.
The result of the rendering is cached by the system, so this method is
called only once per combination unless it is explicitly invalidated.
To invalidate a cached result, call one of the invalidate
methods on the painter instance.
Rendering can vary depending on the paintState
, which includes:
Note For quick dataset visualization, you can use BasicFeaturePainter. If you need more advanced or customized styling logic, implement this method yourself. The default implementation will throw an error.
The rendering target.
The feature to be rendered.
The shape of the feature. This shape may be provided by a ShapeProvider
associated with the layer.
The current state describing how the feature should be rendered.
Optional
paintThe method to describe how a model object has to be visualized in bottom and left border of the vertical view map. The map must first be configured with axis.
Only the bottom border decorations are painted by default. The Left border decorations must be enabled explicitly on the layer using LEFT_BORDER_BODY PaintRepresentation paint representation.
This is an optional method.
the render target
the feature that is being rendered
the shape to render
the layer containing the given feature
the map containing the layer
an object describing the current paint state
Optional
paintThe method to describe how a model object has to be labeled on the bottom and left border of the vertical view map.
Only the bottom border labels are painted by default. The Left border labels must be enabled explicitly on the layer using LEFT_BORDER_LABEL PaintRepresentation paint representation.
This is an optional method.
the render target
the feature that is being rendered
the shape to render
the layer containing the given feature
the map containing the layer
an object describing the current paint state
Optional
paintRenders a label for a model object on the map.
This method is invoked by the map for each (feature, paintState)
combination.
The result is cached by the system, so the method is called only once per combination
unless explicitly invalidated.
To invalidate a cached result, call one of the invalidate
methods on the painter instance.
Rendering can vary depending on the paintState
, which includes
Note: This method is not implemented by default. If label rendering is required, you must provide a custom implementation.
the render target
the feature that is being rendered
the shape to render
the layer containing the given feature
the map containing the layer
an object describing the current paint state
Registers a callback function for the "InvalidateAll" event, that notifies a listener that the all features are invalidated.
Always set to "InvalidateAll" for this event type.
The callback function to be executed when the event is emitted
Optional
context: anyThe context in which the function should be invoked.
"InvalidateAll"
Registers a callback function for the "Invalidate" event, that notifies a listener that a given feature is invalidated.
Always set to "Invalidate" for this event type.
The callback function to be executed when the event is emitted
Optional
context: anyThe context in which the function should be invoked.
"Invalidate"
Registers a callback function for the "InvalidateById" event, that notifies a listener that a feature with the given id is invalidated.
Always set to "InvalidateById" for this event type.
The callback function to be executed when the event is emitted
Optional
context: anyThe context in which the function should be invoked.
"InvalidateById"
Set or get the density painting settings on this painter. Use
The setting affects all features in the layer associated with this painter. The density settings object has one property:null
to disable density painting.colorMap
, the ColorMap color map used to map density values to color. The density at a particular location is the sum of the value of alpha channel for all overlapping objects. So for a single opaque object you would get a density value of 1.0, for 2 opaque objects 2.0, etc.Example: Notes when using density painting: