A base class for Fixture subclasses. It provides some utility functions to Fixtures and also gives access to $iApi and $vApp globals.

FixtureInstance

Hierarchy (view full)

Constructors

Properties

The instance of RampMap API scoped to a single Vue R4MP application.

APIScope

id: string

ID of this fixture.

FixtureInstance

persist: boolean

Indicates whether to keep the fixture when the language changes. Defaults to true. If only one config is provided for all languages, the fixture will be kept on language change, regardless of the value of the flag.

Fixture

Accessors

  • get $element(): App<Element>
  • Returns App<Element>

  • get $vApp(): ComponentPublicInstance
  • The instance of Vue R4MP application controlled by this InstanceAPI. This is just a shorthand for this.$iApi.$vApp.

    Returns ComponentPublicInstance

    APIScope

Methods

  • Parses the legend config JSON snippet from the config file and save resulting objects to the fixture store.

    Parameters

    Returns void

  • Add a legend item given the legend config, or legend item instance

    Parameters

    • item: any

      the config for the legend item or a legend item instance

    • Optionalparent: LegendItem

      optional parent item to create this item under

    Returns LegendItem

    the added legend item

    LegendAPI

  • Set the expanded state of legend items to expanded

    Parameters

    • expanded: boolean

      the expanded state the items will be set to

    • Optionalroot: LegendItem

      the root item to start updating the expanded state from

    Returns void

    LegendAPI

  • A helper function to create a "subclass" of the base Vue constructor

    Parameters

    • vueComponent: Record<string, any>
    • Optionaloptions: ComponentOptions = {}

    Returns any

    FixtureInstance

  • Get all legend items with the given expanded state. Not specifying the expanded state will return all items with expanded set to true

    Parameters

    • Optionalexpanded: boolean

      the expanded state to check for

    Returns LegendItem[]

    the items with the given expanded state

    LegendAPI

  • Get all legend items with the given visibility state. Not specifying the visibility state will return all items with visibility set to true

    Parameters

    • Optionalvisibility: boolean

      the visibility state to check for

    Returns LegendItem[]

    the items with the given expanded state

    LegendAPI

  • Get a legend item given its uid.

    Parameters

    • uid: string

      the uid of the legend item

    Returns undefined | LegendItem

    return legend item with given uid. returns undefined if item is not found.

    LegendAPI

  • Return every legend block bound to a registered layer. Parent-child layer types will return everything tied to the entire layer (parent & children)

    Parameters

    • layer: string | LayerInstance

      a layer instance, layer id, or layer uid

    Returns LayerItem[]

    all legend items bound to the layer

  • Get this fixture's config from the layer config with the given layer id Will return undefined if layer config did not specify a config for this fixture

    Parameters

    • layerId: string

      The layer's id

    Returns any

    This fixture's config for the given layer

  • Combines this fixtures configs from layer configs into an indexed-dictionary

    Returns {
        [layerId: string]: any;
    }

    Dictionary where key is the layer id and the value is this fixture's config for that layer

    • [layerId: string]: any
  • Get the first found layer item connected to the layer with the given id/uid or the given layer instance.

    Parameters

    • layer: string | LayerInstance

      the id/uid of the layer or layer instance

    Returns undefined | LayerItem

    return layer item tied to the found layer. returns undefined if no such item is found.

    LegendAPI

  • Maps the current legend tree into a legend config snippet.

    In addition to legend config schema properties, this snippet will also include properties such as the item type, item's uid, layer uid etc.

    Returns any

    returns the legend config

    LegendAPI

  • If the panelTeleport property is provided, handle specified panelTeleport for the given fixture.

    Parameters

    • panels: string[]

      list of panel names for the calling fixture

    Returns void

  • If the panelWidth property is provided, handle default and specified panel widths for the given fixture.

    Parameters

    • panels: string[]

      list of panel names for the calling fixture

    Returns void

  • [Optional] Called after the core map logic has executed. If the fixture is added after the map initialization, this is called immediately.

    At this point, any custom content (panels, on-map components, etc.) can be added to R4MP. Custom content can also be added throughout the life of the [module].

    Returns void

    Fixture

  • Helper with programatically creating a component in Vue 3 (replaces the deprecated Vue.extend)

    Parameters

    • component: Component
    • __namedParameters: any = {}

    Returns {
        destroy: (() => void);
        el: any;
        vNode: any;
    }

    • destroy: (() => void)
        • (): void
        • Returns void

    • el: any
    • vNode: any

    FixtureInstance

  • Reload the all legend items connected to the given layer. This preps the items for the reload. It does not reload the actual layer. Parent-child layer types will prep all items related to the layer (both parent and sublayers)

    Parameters

    • layer: string | LayerInstance

      a layer instance, layer id, or layer uid referencing the reloaded layer

    Returns boolean

    returns true if item was successfully reloaded, false otherwise

    LegendAPI

  • Removes the specified fixture from R4MP instance. This is a proxy to rInstance.fixture.remove(...).

    Returns this

    FixtureInstance

  • Removes the legend item with the given uid, or the item instance.

    Parameters

    • item: string | LegendItem

      the uid of item or legend item instance to be removed

    Returns boolean

    returns true if item was removed, false otherwise

    LegendAPI

  • Remove the layer item connected to the layer with the given id/uid or the given layer instance.

    Parameters

    • layer: string | LayerInstance

      the id/uid of the layer or layer instance

    Returns boolean

    returns true if item was removed, false otherwise

    LegendAPI

  • Search for all legend items that satisfy the predicate, starting from the given root item.

    Parameters

    • root: LegendItem

      the root item to start searching from

    • predicate: ((item: LegendItem) => boolean)

      predicate boolean predicate to test each item

        • (item): boolean
        • Parameters

          Returns boolean

    Returns LegendItem[]

    return all items that satisfies the given predicate.

  • Search for the first legend item that satisfies the predicate, starting from the given root item.

    Parameters

    • root: LegendItem

      the root item to start searching from

    • predicate: ((item: LegendItem) => boolean)

      boolean predicate to test each item

        • (item): boolean
        • Parameters

          Returns boolean

    Returns undefined | LegendItem

    return the first item that satisfies the given predicate. returns undefined if item is not found.

  • Set the visibility state of legend items to visibility

    Parameters

    • visibility: boolean

      the visibility state the items will be set to

    • Optionalroot: LegendItem

      the root item to start updating the visibility state from

    Returns void

    LegendAPI

  • Update all layer items bound to the given layer. Does nothing if no layer items are found

    Parameters

    Returns void

    LegendAPI

  • Adds missing functions and properties to the object implementing FixtureBase interface. This is only needed for external fixtures as they can't inherit from FixtureInstance.

    TODO: If you know a better way to deep-mixin props/getters/functions from a class into another class instance, please tell me. I honestly don't know 🤷‍♂️.

    Parameters

    Returns FixtureInstance

    FixtureInstance