A base class for anything requiring access to the InstanceApi and instance of Vue app controlled by it.

APIScope

Hierarchy (view full)

Constructors

Properties

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

APIScope

caption: MapCaptionAPI
created: boolean = false

Indicates if the map has been created

esriView: undefined | MapView

The internal esri map view. Changes from outside of RAMP may break the instance. Use caution.

labelsDefault: RampLabelsConfig = ...

Any map labels defaulting

layerDefaultTimes: LayerTimes = ...

Map wide defaults for layer times. Layers can override.

maptip: MaptipAPI

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

  • get keysActive(): boolean
  • Returns if keys are active on map

    Returns boolean

    • true if any pan/zoom keys are active

    MapAPI

  • get mouseFocus(): boolean
  • Returns if map focus is caused by mouse click

    Returns boolean

    MapAPI

  • get viewPromise(): Promise<void>
  • A promise that resolves when the map view has been created

    Returns Promise<void>

Methods

  • Registers a layer with the instance and attempts to add it to the the map. The return value provides an async indicator if the map add was successful, but the layer is registered regardless. Optionally can specify the layer order index for map layers.

    Parameters

    • layer: LayerInstance

      the Ramp layer to add

    • index: undefined | number = undefined

      optional order index to add the layer to

    Returns Promise<void>

    a promise that resolves when the layer has been added to the map

  • Protected

    Sets the basemap to the basemap with the given id or the basemap object Throws error if basemap could not be found

    Parameters

    • basemap: string | Basemap

      the basemap id or object

    Returns void

  • Will generate the actual Map control objects and construct it on the page

    Parameters

    • config: RampMapConfig

      the config for the map

    • targetDiv: string | HTMLDivElement

      the div to be used for the map view

    Returns void

  • Protected

    Will generate a ESRI map view and add it to the page Can optionally provide the basemap or basemap id to be used when creating the map view

    Parameters

    • Optionalbasemap: string | Basemap

      the id of the basemap that should be used when creating the map view

    Returns void

  • Finds the tile scale (level of detail) closest to the provided scale. If using a map with no scale levels, will return the given scale.

    Parameters

    • scale: number

      scale value to search for in the levels of detail

    Returns number

    the level of detail scale closest to the input

    findClosestScale

  • Get the top-most graphic at the given screen point Returns undefined if there is no graphic

    Parameters

    • screenPoint: ScreenPoint

      The screen coordinates to inspect

    Returns Promise<undefined | GraphicHitResult>

    resolves with topmost graphic or undefined

  • Utility method to insert a Map Layer into the ESRI map. The position in ESRI map is derived from global order and what layers are currently in the map.

    Parameters

    • layer: LayerInstance

      the RAMP layer to insert. Must be a Map layer

    Returns void

  • Processes keydown event on map and initiates panning/zooming

    Parameters

    • payload: KeyboardEvent

    Returns void

    MapAPI

  • Processes keyup event on map and deactivates key

    Parameters

    • payload: KeyboardEvent

    Returns void

    MapAPI

  • Will attempt to change to another basemap if the very first basemap failed. If nothing is defined, will do nothing but manage our watching state.

    Parameters

    • basemapSchemaId: string

      the basemap schema id (where the fallback is defined)

    Returns void

  • Removes a layer from the map and fires the layer remove event. This will also unregister the layer from the Ramp instance.

    Parameters

    • layer: string | LayerInstance

      the Ramp layer or layer id/uid to remove

    Returns void

    a promise that resolves when the layer has been removed from the map

  • Removes a sublayer from the map

    Parameters

    Returns void

    a promise that resolves when the layer has been removed from the map

  • Reorders a layer on the map. The position is based on the instance layer order state maintained by the LayerAPI. If ignoreCosmetic is set, the index changes to a different basis. Essentially the as if cosmetic layers did not exists in the layer order state.

    Parameters

    • layer: LayerInstance

      the RAMP layer to be moved. If a sublayer is passed, the parent will be reordered.

    • index: number

      the RAMP layer index where the layer will be moved to

    • ignoreCosmetic: boolean = false

      indicates if the index should ignore cosmetic layers

    Returns void

  • Get a point in map co-ordinates corresponding to a pixel in screen co-ordinates.

    Parameters

    • screenPoint: ScreenPoint

      pixel screen co-ord of the point on the map

    Returns Point

    the map point analagous to the screen point

  • Set the map's basemap to the basemap with the given id. If the new basemap's tile schema differs from the current one, the map view will be refreshed

    The returned boolean indicates if the schema has changed.

    Parameters

    • basemapId: string

      the basemap id

    Returns boolean

    indicates if the schema has changed

  • Set's the map's mapMouseThrottle value to newThrottle. If newThrottle is not a positive number, a console error is thrown.

    The returned boolean indicates if the value has been successfully set.

    Parameters

    • newThrottle: number

      the new mapMouseThrottle value, which must be a positive number

    Returns boolean

    indicates if the value was set successfully

  • Set's the map's pointZoomScale value to newScale. If newScale is not a positive number, a console error is thrown.

    The returned boolean indicates if the value has been successfully set.

    Parameters

    • newScale: number

      the new pointZoomScale value, which must be a positive number

    Returns boolean

    indicates if the value was set successfully

  • Zooms the map to the next zoom level in towards the earth. The center point will not change. In the rare case where there is no basemap, this will likely do nothing

    Returns Promise<void>

    A promise that resolves when the map has finished zooming

  • Zooms the map to a given geometry.

    Parameters

    • geom: BaseGeometry

      A RAMP API geometry to zoom the map to

    • Optionalscale: number

      An optional scale value of the map. Is ignored for non-Point geometries

    • Optionalanimate: boolean = true

      Option to turn off the zoom animation. On by default

    • Optionalduration: number = 200

      Option to change animation duration (in milliseconds). Default of 200. Ignored if animate is off.

    • Optionaleasing: ZoomEasing = 'ease'

      Option to change animation easing function. Default of 'ease'. Ignored if animate is off.

    Returns Promise<void>

    A promise that resolves when the map has finished zooming

  • Zooms the map to the next zoom level out away from the earth. The center point will not change. In the rare case where there is no basemap, this will likely do nothing

    Returns Promise<void>

    A promise that resolves when the map has finished zooming

  • Zooms the map to a given zoom level. The center point will not change. In the rare case where there is no basemap, this will likely do nothing

    Parameters

    • zoomLevel: number

      An integer matching the level of detail / zoom level the map should adjust to

    Returns Promise<void>

    A promise that resolves when the map has finished zooming

  • Zooms the map to the closest zoom level that will be visible for a given scale set. Does nothing if scale set is already visible for the map.

    Parameters

    Returns Promise<void>

    A promise that resolves when the map has finished zooming