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

Export

Hierarchy

Constructors

Properties

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

Memberof

APIScope

CLASS_BREAKS: string = 'class-breaks'
CONTAINER_CENTER: number = ...
CONTAINER_SIZE: number = 32
CONTENT_IMAGE_SIZE: number = 28
CONTENT_PADDING: number = ...
CONTENT_SIZE: number = 24
NONE: string = 'none'
SIMPLE: string = 'simple'
UNIQUE_VALUE: string = 'unique-value'

Accessors

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

  • get $vApp(): ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}>
  • The instance of Vue R4MP application controlled by this InstanceAPI. This is just a shorthand for this.$iApi.$vApp.

    Returns ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}>

    Memberof

    APIScope

Methods

  • Fits svg element in the size specified

    Parameters

    • element: any

      svg element to fit

    • CONTAINER_SIZE: number

      width/height of a container to fit the element into

    Returns void

  • Private

    Generates a placeholder symbology graphic.

    Parameters

    • name: string

      label symbology label

    • colour: string = '#000'

      colour to use in the graphic

    Returns any

    symbology svg code and its label

    Function

    generatePlaceholderSymbology

  • Generates svg symbology for WMS layers.

    Parameters

    • imageUri: string

      url or dataUrl of the legend image

    Returns Promise<Object>

    a promise resolving with symbology svg code and its label

    Function

    generateWMSSymbology

  • Given feature attributes, return the image URL for that feature/graphic object.

    Parameters

    • attributes: Attributes

      object of feature attribute key value pairs

    • renderer: BaseRenderer

      an enhanced renderer (see function enhanceRenderer)

    Returns string

    svgcode Url to the features symbology image

    Method

    getGraphicIcon

  • Given feature attributes, return the symbol for that feature/graphic object.

    Parameters

    • attributes: Object

      object of feature attribute key value pairs

    • renderer: BaseRenderer

      an enhanced renderer (see function enhanceRenderer)

    Returns Symbol

    an ESRI Symbol object in server format

    Method

    getGraphicSymbol

  • Private

    Returns the legend information of an ESRI map service.

    Parameters

    • layerUrl: string

      service url (root service, not indexed endpoint)

    Returns Promise<any>

    resolves in an array of legend data in arcgis server json format

    Function

    getMapServerLegend

  • Private

    Converts a config-supplied list of symbology to the format used by layer records.

    Parameters

    • conversionFunction: Function

      a conversion function to wrap the supplied image into an image or an icon style symbology container

    • list: any[]

      a list of config-supplied symbology items in the form of [ { text: , image: }, ... ] wher image can be dataURL or an actual url

    Returns Object[]

    an array of converted symbology symbols in the form of [ { name: , image: , svgcode: }, ... ]; items will be populated async as conversions are done

    Function

    _listToSymbology

  • Private

    Our symbology engine works off of renderers. When dealing with layers with no renderers, we need to take server-side legend and convert it to a fake renderer, which lets us leverage all the existing symbology code.

    Parameters

    • serverLegend: any

      legend json from an esri map server

    • layerIndex: number

      the index of the layer in the legend we are interested in

    Returns BaseRenderer

    a fake unique value renderer based off the legend

    Function

    mapServerLegendToRenderer

  • Private

    Our symbology engine works off of renderers. When dealing with layers with no renderers, we need to take server-side legend and convert it to a fake renderer, which lets us leverage all the existing symbology code.

    Same as mapServerLegendToRenderer function but combines all layer renderers.

    Parameters

    • serverLegend: any

      legend json from an esri map server

    Returns BaseRenderer

    a fake unique value renderer based off the legend

    Function

    mapServerLegendToRendererAll

  • Orchestrator function that will:

    • Fetch a legend from an esri map server
    • Extract legend for a specific sub layer
    • Convert server legend to a temporary renderer
    • Convert temporary renderer to a viewer-formatted legend (return value)

    Parameters

    • mapServerUrl: string

      service url (root service, not indexed endpoint)

    • Optional layerIndex: string | number = undefined

      the index of the layer in the legend we are interested in. If not provided, all layers will be collapsed into a single legend

    Returns Promise<LegendSymbology[]>

    resolves in a viewer-compatible legend for the given server and layer index

    Function

    mapServerToLocalLegend

  • Renders a supplied image as an icon-style symbology item (fitting an image inside an icon container, usually 32x32 pixels).

    Parameters

    • imageUri: string

      a image dataUrl or a regular url

    • draw: any = null

      [optional=null] an svg container to draw the image on; if not supplied, a new one is created

    Returns Promise<string>

    Function

    renderSymbologyIcon

  • Renders a supplied image as an image-style symbology item (preserving the true image dimensions).

    Parameters

    • imageUri: string

      a image dataUrl or a regular url

    • draw: any = null

      [optional=null] an svg container to draw the image on; if not supplied, a new one is created

    Returns Promise<string>

    Function

    renderSymbologyImage

  • Private

    Renders a specified image on an svg element. This is a helper function that wraps around async draw.image call in the svg library.

    Parameters

    • draw: any

      svg element to render the image onto

    • imageUri: string

      image url or dataURL of the image to render

    • width: number = 0

      [optional = 0] width of the image

    • height: number = 0

      [optional = 0] height of the image

    • crossOrigin: boolean = true

      [optional = true] specifies if the image should be loaded as crossOrigin

    Returns Promise<any>

    promise resolving with the loaded image and its loader object (see svg.js http://documentup.com/wout/svg.js#image for details)

    Function

    svgDrawImage

  • Private

    Generate an SVG string for an ESRI symbol.

    Parameters

    • symbol: any

      an ESRI symbol object in JS API format

    Returns Promise<string>

    resolves to an SVG string representing the symbol

Generated using TypeDoc