Registers map-related components as OSGi services.

Use the service map-widget.MapWidgetRegistration to inject an instance of this interface.

interface MapWidgetRegistration {
    register(
        params: {
            map?: any;
            mapWidget: MapWidget;
            mapWidgetModel?: MapWidgetModel;
        },
    ): void;
    unregister(keepInstances: boolean): void;
}

Methods

  • Register the new default map widget. If one was previously registered, then it is unregistered.

    The following services are registered:

    • map-widget.MapWidgetModel
      • the map widget model provided to interact with the main map
    • map-widget.Map
      • the esri/Map part of the MapWidgetModel, provided if only the layer tree should change
    • map-widget.MapWidget
      • the map widget, do not use it directly

    Parameters

    • params: { map?: any; mapWidget: MapWidget; mapWidgetModel?: MapWidgetModel }

      components to register { map, mapWidgetModel, mapWidget }

    Returns void

    import { InjectedReference } from "apprt-core/InjectedReference";
    import { MapWidgetRegistration } from "map-widget/MapWidgetRegistration";
    import MapWidgetFactory from "map-widget/MapWidgetFactory";

    class MyComponent {
    private _mapregistration: InjectedReference<MapWidgetRegistration>;
    private _mapfactory: InjectedReference<MapWidgetFactory>;

    activate() {
    const mapregistration = this._mapregistration!;
    const mapfactory = this._mapfactory!;
    const map = mapfactory.createMap({...});
    const model = mapfactory.createWidgetModel({map, ...});
    const widget = mapfactory.createWidget({model});
    mapregistration.register({
    map: map,
    mapWidgetModel: model,
    mapWidget: widget
    });
    }
    }
  • Unregister all services.

    Parameters

    • keepInstances: boolean

      suppress the destruction of widgets.

    Returns void