Options
All
  • Public
  • Public/Protected
  • All
Menu

ParameterizedPointPainter allows you to visualize point data sets.

This painter uses the graphics hardware to efficiently switch styling and filtering.

Note that this painter does not allow overriding of paintBody, unlike the usual FeaturePainter. All styling is configured by setting the properties on this painter. This painter can also be combined with regular density painting. Note that in this case, the alpha value of the final color is used as a weight in the density. The color itself is discarded.

This painter supports labels, which take the visibility expression into account. To do so, implement FeaturePainter.paintLabel in your painter in the same way as for other FeaturePainters. However, the labels are evaluated and drawn using the normal cpu-based algorithms.

Limitations:

  • Only numeric attributes are supported.
  • This painter can only be used on a WebGLMap.
  • Any labels are evaluated and drawn using the normal cpu-based algorithms.
  • This painter does not support models that have a above terrain height reference. If you use this painter for such a model, the painter will throw an exception the first time it needs to paint.

Hierarchy

Implements

Overview

Constructors

constructor

  • Creates a new ParameterizedPointPainter.

    Examples

    Specifying filtering and styling based on feature properties

    You can specify expressions to determine the color, icon, scale or visibility of a point. These expressions can be based on feature properties.
    //Create a painter.
    //Use a green color for regular points.
    //Filter points based on the "speed" attribute.  Only show points if their "speed" is greater than 200.
    //The 200 value is the current value of a parameter.
    //Parameters can be updated very efficiently so the threshold can be updated later on very quickly.
    //Specify that we will (at some point) use attributes "speed" and "calculated".
    //The values of the "speed" attribute will correspond to the "velocity" feature property,
    //i.e. to feature.properties["velocity"];
    //The values for the "calculated" attribute will be the values returned by the given function.
    var _ = ExpressionFactory;
    var speedThreshold = _.numberParameter(200);
    var parameterizedPointPainter = new ParameterizedPointPainter({
             regular: {
               colorExpression: color("rgb(0, 255, 0, 1)")
             },
             visibilityExpression: _.gt(_.attribute("speed"), speedThreshold),
             attributes: {
               speed: "velocity",
               calculated: function(feature, shape) {
                 //calculate the attribute value here.
                 return ...;
               }
             }
          });
    
    //At runtime, immediately change styling and filtering.
    parameterizedPointPainter.colorExpression = color("rgb(255, 0, 0, 1)");
    parameterizedPointPainter.visibilityExpression = boolean(false);
    //If you want to update the styling very often, e.g. based on a slider, consider using parameters in your expressions.
    //Changing the values of parameters is more efficient than changing expressions.
    //So, for example, updating the speed threshold:
    speedThreshold.value = 300;
    see

    ExpressionFactory

    Parameters

    Returns ParameterizedPointPainter

Events

on

  • (event: "InvalidateAll", callback: () => void, context?: any): Handle
  • (event: "Invalidate", callback: (feature: Feature) => void, context?: any): Handle
  • (event: "InvalidateById", callback: (id: string | number) => void, context?: any): Handle
  • Registers a callback function for the "InvalidateAll" event, that notifies a listener that the all features are invalidated.

    since

    2020.1

    Parameters

    • event: "InvalidateAll"

      Always set to "InvalidateAll" for this event type.

    • callback: () => void

      The callback function to be executed when the event is emitted

        • (): void
        • Returns void

    • Optional context: any

      The context in which the function should be invoked.

    Returns Handle

  • Registers a callback function for the "Invalidate" event, that notifies a listener that a given feature is invalidated.

    since

    2020.1

    Parameters

    • event: "Invalidate"

      Always set to "Invalidate" for this event type.

    • callback: (feature: Feature) => void

      The callback function to be executed when the event is emitted

    • Optional context: any

      The context in which the function should be invoked.

    Returns Handle

  • Registers a callback function for the "InvalidateById" event, that notifies a listener that a feature with the given id is invalidated.

    since

    2020.1

    Parameters

    • event: "InvalidateById"

      Always set to "InvalidateById" for this event type.

    • callback: (id: string | number) => void

      The callback function to be executed when the event is emitted

        • (id: string | number): void
        • Parameters

          • id: string | number

          Returns void

    • Optional context: any

      The context in which the function should be invoked.

    Returns Handle

Accessors

colorExpression

  • An expression to specify what colors to apply to points.

    To create expressions, you must use ExpressionFactory. The expression must be well-formed and resolve to a color.

    Note that any attribute used in the expressions must be specified in the constructor parameter attributes.

    If you want to update the styling very often, consider using parameters in your expressions. Changing the values of parameters is more efficient than changing expressions.

    default

    rgb(255, 255, 255) (Opaque white)

    Returns Expression<Color>

  • An expression to specify what colors to apply to points.

    To create expressions, you must use ExpressionFactory. The expression must be well-formed and resolve to a color.

    Note that any attribute used in the expressions must be specified in the constructor parameter attributes.

    If you want to update the styling very often, consider using parameters in your expressions. Changing the values of parameters is more efficient than changing expressions.

    default

    rgb(255, 255, 255) (Opaque white)

    Parameters

    Returns any

density

iconExpression

  • An expression to define icons.

    To create expressions, you must use ExpressionFactory. The expression must be well-formed and resolve to an icon expression.

    Note that any attribute used in the expressions must be specified in the constructor parameter attributes.

    If you want to update the styling very often, consider using parameters in your expressions. Changing the values of parameters is more efficient than changing expressions.

    Returns Expression<ParameterizedPointStyle>

  • An expression to define icons.

    To create expressions, you must use ExpressionFactory. The expression must be well-formed and resolve to an icon expression.

    Note that any attribute used in the expressions must be specified in the constructor parameter attributes.

    If you want to update the styling very often, consider using parameters in your expressions. Changing the values of parameters is more efficient than changing expressions.

    Parameters

    Returns any

scaleExpression

  • get scaleExpression(): Expression<number>
  • set scaleExpression(scaleExpression: Expression<number>): void
  • The expression that determines the scale factor to apply to the icons.

    • Scale 1 corresponds to the original size of the icon.
    • Scale <1 will shrink the icon.
    • Scale >1 will enlarge the icon.

    If not set, icons are never re-scaled.

    To create expressions, you must use ExpressionFactory. The expression must be well-formed and resolve to a number.

    Note that any attribute used in the expressions must be specified in the constructor parameter attributes.

    If you want to update the styling very often, consider using parameters in your expressions. Changing the values of parameters is more efficient than changing expressions.

    default

    1

    Returns Expression<number>

  • The expression that determines the scale factor to apply to the icons.

    • Scale 1 corresponds to the original size of the icon.
    • Scale <1 will shrink the icon.
    • Scale >1 will enlarge the icon.

    If not set, icons are never re-scaled.

    To create expressions, you must use ExpressionFactory. The expression must be well-formed and resolve to a number.

    Note that any attribute used in the expressions must be specified in the constructor parameter attributes.

    If you want to update the styling very often, consider using parameters in your expressions. Changing the values of parameters is more efficient than changing expressions.

    default

    1

    Parameters

    Returns any

selectedColorExpression

  • An expression to specify what colors to apply to selected points.

    To create expressions, you must use ExpressionFactory. The expression must be well-formed and resolve to a color.

    Note that any attribute used in the expressions must be specified in the constructor parameter attributes.

    If you want to update the styling very often, consider using parameters in your expressions. Changing the values of parameters is more efficient than changing expressions.

    default

    rgb(0, 0, 255) (Opaque blue)

    Returns Expression<Color>

  • An expression to specify what colors to apply to selected points.

    To create expressions, you must use ExpressionFactory. The expression must be well-formed and resolve to a color.

    Note that any attribute used in the expressions must be specified in the constructor parameter attributes.

    If you want to update the styling very often, consider using parameters in your expressions. Changing the values of parameters is more efficient than changing expressions.

    default

    rgb(0, 0, 255) (Opaque blue)

    Parameters

    Returns any

selectedIconExpression

  • An expression to define selected icons.

    To create expressions, you must use ExpressionFactory. The expression must be well-formed and resolve to an icon expression.

    Note that any attribute used in the expressions must be specified in the constructor parameter attributes.

    If you want to update the styling very often, consider using parameters in your expressions. Changing the values of parameters is more efficient than changing expressions.

    Returns Expression<ParameterizedPointStyle>

  • An expression to define selected icons.

    To create expressions, you must use ExpressionFactory. The expression must be well-formed and resolve to an icon expression.

    Note that any attribute used in the expressions must be specified in the constructor parameter attributes.

    If you want to update the styling very often, consider using parameters in your expressions. Changing the values of parameters is more efficient than changing expressions.

    Parameters

    Returns any

selectedScaleExpression

  • get selectedScaleExpression(): Expression<number>
  • set selectedScaleExpression(scaleExpression: Expression<number>): void
  • The expression that determines the scale factor to apply to the selected icons.

    • Scale 1 corresponds to the original size of the icon.
    • Scale <1 will shrink the icon.
    • Scale >1 will enlarge the icon.

    If not set, icons are never re-scaled.

    To create expressions, you must use ExpressionFactory. The expression must be well-formed and resolve to a number.

    Note that any attribute used in the expressions must be specified in the constructor parameter attributes.

    If you want to update the styling very often, consider using parameters in your expressions. Changing the values of parameters is more efficient than changing expressions.

    default

    1

    Returns Expression<number>

  • The expression that determines the scale factor to apply to the selected icons.

    • Scale 1 corresponds to the original size of the icon.
    • Scale <1 will shrink the icon.
    • Scale >1 will enlarge the icon.

    If not set, icons are never re-scaled.

    To create expressions, you must use ExpressionFactory. The expression must be well-formed and resolve to a number.

    Note that any attribute used in the expressions must be specified in the constructor parameter attributes.

    If you want to update the styling very often, consider using parameters in your expressions. Changing the values of parameters is more efficient than changing expressions.

    default

    1

    Parameters

    Returns any

visibilityExpression

  • get visibilityExpression(): Expression<boolean>
  • set visibilityExpression(visibilityExpression: Expression<boolean>): void
  • An expression to filter points.

    To create expressions, you must use ExpressionFactory. The expression must be well-formed and resolve to a boolean.

    Note that any attribute used in the expressions must be specified in the constructor parameter attributes.

    If you want to update the styling very often, consider using parameters in your expressions. Changing the values of parameters is more efficient than changing expressions.

    default

    true

    Returns Expression<boolean>

  • An expression to filter points.

    To create expressions, you must use ExpressionFactory. The expression must be well-formed and resolve to a boolean.

    Note that any attribute used in the expressions must be specified in the constructor parameter attributes.

    If you want to update the styling very often, consider using parameters in your expressions. Changing the values of parameters is more efficient than changing expressions.

    default

    true

    Parameters

    Returns any

Methods

getDetailLevelScales

  • Returns an array of map scales that determine when this painter should switch from one level-of-detail to the next. This can be used to advertise that this painter supports multiple level-of-details for a given object. The current level-of-detail that is used is determined by the map and is passed back to this FeaturePainter via the state.level property that is passed to the paint methods. The default implementation of this method returns null indicating the level-of-detail is not supported.

    see

    FeaturePainter#paintBody

    see

    FeaturePainter#paintLabel

    Parameters

    • Optional layer: FeatureLayer

      the layer for which the detail level scales are being requested

    • Optional map: Map

      the map for which the detail level scales are being requested

    Returns number[] | null

    the switch scales for each level of detail

invalidate

  • Invalidates this painter for a specific feature. Call this method when any state that determines the rendering of a specific feature has been changed. Calling this method refreshes this FeaturePainter's layer and guarantees that paintBody() and paintLabel() will be called for the given feature during the next map render.

    Parameters

    • feature: Feature

      the model feature whose representation has changed

    Returns void

invalidateAll

  • (): void
  • Invalidates this painter for all objects. Call this method when any state that determines the rendering of objects has been changed. Calling this method refreshes the FeaturePainter's layer and guarantees that paintBody() and paintLabel() will be called for all objects in the layer during the next map render.

    Returns void

invalidateById

  • (featureId: string | number): void
  • Invalidates this painter for a specific object by id. Call this method when any state that determines the rendering of a specific object has been changed. Calling this method refreshes this FeaturePainter's layer and guarantees that paintBody() and paintLabel() will be called for the given object during the next map render.

    Parameters

    • featureId: string | number

      The id of the feature. It corresponds to Feature.id.

    Returns void

paintBody

Optional paintBorderBody

  • The 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 paint representation.

    This is an optional method.

    Parameters

    • borderGeoCanvas: BorderGeoCanvas

      the render target

    • feature: Feature

      the feature that is being rendered

    • shape: Shape

      the shape to render

    • layer: Layer

      the layer containing the given feature

    • map: Map

      the map containing the layer

    • paintState: BorderPaintState

      an object describing the current paint state

    Returns void

Optional paintBorderLabel

  • The 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 paint representation.

    This is an optional method.

    Parameters

    • borderLabelCanvas: BorderLabelCanvas

      the render target

    • feature: Feature

      the feature that is being rendered

    • shape: Shape

      the shape to render

    • layer: Layer

      the layer containing the given feature

    • map: Map

      the map containing the layer

    • paintState: BorderPaintState

      an object describing the current paint state

    Returns void

Optional paintLabel

  • The method which allows you to describe how a model object should be labeled on the map.

    The paintLabel method will be invoked by the map once for every (feature,paintState) tuple. The results of the paint method may be cached which will result in the paint method being called only once. If the results of a paint method become invalid, implementation must invoke one of the invalidate methods on themselves.

    paintLabel method is allowed to render differently depending on the values of the paintState parameter. Currently the following state is supported:

    • selected: a boolean indicating if the object is being rendered in selected mode or in default mode.
    • level: a non-negative integer value indicating the current level-of-detail; zero being the least detailed level.

    Parameters

    • labelCanvas: LabelCanvas

      the render target

    • feature: Feature

      the feature that is being rendered

    • shape: Shape

      the shape to render

    • layer: Layer

      the layer containing the given feature

    • map: Map

      the map containing the layer

    • paintState: PaintState

      an object describing the current paint state

    Returns void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method