map.apps Bundle APIs 4.20.0
    Preparing search index...

    Interface Highlighter

    The Highlighter class can be used to create highlights on a MapWidgetModel. You should use either the HighlightService or the HighlighterFactory to obtain an instance of this type:

    • The HighlightService provides a Highlighter instance that operates on the default MapWidgetModel. This should be sufficient for most use cases.
    • The HighlighterFactory can create Highlighter instances for custom MapWidgetModel instances. This can be useful, for example, to support multiple map views.
    interface Highlighter {
        clear(): void;
        destroy(): void;
        getDefaultSymbol(
            geometryType: string,
            viewmode?: ViewMode,
        ): undefined | SymbolProperties;
        highlight(
            graphicObject: Partial<HighlightGraphic> | Partial<HighlightGraphic>[],
            options?: HighlightOptions,
        ): Highlight;
    }
    Index

    Methods

    • Removes all existing highlights.

      Returns void

    • This function must be called to release resources used by this object when it is no longer needed.

      Returns void

    • Returns the default symbol for the given geometry.

      Parameters

      • geometryType: string

        The geometry type to highlight (as used in the esri API).

      • Optionalviewmode: ViewMode

        The viewmode must be either "2D" (the default) or "3D". The function will fall back to 2D symbols if 3D symbols are requested but unavailable.

      Returns undefined | SymbolProperties

    • Highlights the given object. The returned object represents the new highlight on the map. Calling the Highlight.remove function on that object will manually remove the highlight.

      Parameters

      • graphicObject: Partial<HighlightGraphic> | Partial<HighlightGraphic>[]

        The object to be highlighted. This can be either an esri Graphic object, a plain javascript Object, or an Array of such objects.

        If plain objects are passed to this function, they will be used as templates to create a new Graphic object for each of them.

        The object must have a valid geometry. All other properties are optional. A default symbol will be chosen if not specified.

        Use the optional symbol3D property to specify a 3D symbol. If the map widget is in 3D mode at the time the highlight is created, the 3D symbol will be used to render the highlight.

      • Optionaloptions: HighlightOptions

        Additional highlight options.

      Returns Highlight

      A new Highlight instance. Returns undefined if the given graphics are not of type object.