Factory to create new Highlighter instances. It can be injected as a component via "highlights.HighlighterFactory".

interface HighlighterFactory {
    forMapWidgetModel(
        mapWidgetModel: MapWidgetModel,
        options?: HighlighterFactoryOptions,
    ): Highlighter;
}

Methods

  • Returns a new Highlighter instance for the given map widget model.

    Parameters

    Returns Highlighter

    // inject factory as `highlights.HighlighterFactory`
    // inject model as `map-widget.MapWidgetModel`
    const highlighter = factory.forMapWidgetModel(model);
    highlighter.highlight(graphic);
    // later clean up
    highlighter.destroy();
    const graphicsLayer = new GraphicsLayer();
    const graphics = graphicsLayer.graphics;
    const highlighter = factory.forMapWidgetModel(model, { graphicsCollectionResolver: (model) => graphics });
    // now highlights are added to the custom GraphicsLayer.