Options
All
  • Public
  • Public/Protected
  • All
Menu

A RasterImageModel that can access an OGC WMS Server. Use this model instead of the WMSTileSetModel if you want to visualize WMS images at an arbitrary scale and with arbitrary extents. For example, if the WMS images contain text, the text may appear smaller on the map than intended when using a WMSTileSetModel. You can avoid this by using this WMSImageModel instead.

Typically, you don't need to call the constructor yourself. Instead, use the factory methods createFromURL or createFromCapabilities to create an instance of this model. The following example demonstrates how to set up a WMSImageModel to retrieve WMS image data for a given service url and layer name:

WMSImageModel.createFromURL("http://sampleservices.luciad.com/wms", [{layer: "rivers"}])
    .then(function(model) {
      //Create a layer for the WMS model
      const layer = new RasterImageLayer(model);
      //Add the layer to the map
      map.layerTree.addChild(layer);
    });

If you want to access the WMS server's capabilities and explore the service metadata and available data sets, you first have to create a WMSCapabilities instance. This instance can also be to create a WMSImageModel afterwards:

const capabilitiesPromise = WMSCapabilities.fromURL("http://sampleservices.luciad.com/wms");
capabilitiesPromise.then(function(capabilities) {
  //Create a model using the capabilities
  const model = WMSImageModel.createFromCapabilities(capabilities, [{layer: "rivers"}]);
  //Create a layer for the WMS model
  const layer = new RasterImageLayer(model);
  //Add the layer to the map
  map.layerTree.addChild(layer);
});

Supported versions

LuciadRIA supports consuming WMS services that support version 1.1.1 and 1.3.0 of the OGC WMS specification.

since

2015.0

Hierarchy

Implements

Overview

Constructors

constructor

Events

on

  • (event: "Invalidated", callback: (...args: any[]) => void, context?: object): Handle
  • An event indicating that this Controller is invalidated. Invalidated means that data has changed and the visualization needs to be refreshed. This event fires when #invalidate is called.

    Parameters

    • event: "Invalidated"
    • callback: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional context: object

    Returns Handle

Accessors

backgroundColor

  • get backgroundColor(): string | null
  • set backgroundColor(val: string | null): void
  • The background color the WMS server must use when generating the WMS image. Note that this option is only considered by the server when the WMSImageModel.transparent property is false. The backgroundColor is a string that must be formatted as "0xRRGGBB", where RGB values are represented as hexadecimal values. If you try to assign a string that does not adhere to this format an exception will be thrown.

    Returns string | null

  • The background color the WMS server must use when generating the WMS image. Note that this option is only considered by the server when the WMSImageModel.transparent property is false. The backgroundColor is a string that must be formatted as "0xRRGGBB", where RGB values are represented as hexadecimal values. If you try to assign a string that does not adhere to this format an exception will be thrown.

    Parameters

    • val: string | null

    Returns any

bounds

coordinateType

credentials

  • get credentials(): boolean
  • set credentials(value: boolean): void
  • Indicates whether or not credentials should be included with HTTP requests.

    See GoogleImageModel.credentials for more information.

    The default value is false.

    Returns boolean

  • Indicates whether or not credentials should be included with HTTP requests.

    See GoogleImageModel.credentials for more information.

    The default value is false.

    Parameters

    • value: boolean

    Returns any

dimensions

  • get dimensions(): object | null
  • set dimensions(value: object | null): void
  • Dimension parameters to send along with WMS GetMap and GetFeatureInfo request. Typical dimensions are TIME and ELEVATION.

    The object literal can contain simple key/value pairs. Dimension names will be prefixed with "DIM_" in the WMS requests, if this is not already the case. The dimension names TIME and ELEVATION will never be prefixed. Accepted values are strings, numbers, booleans. A ProgrammingError will be thrown if values of another type are used. Values must not be URL encoded. Assigning other values than object literals to dimensions will throw a ProgrammingError.

    Assigning to this property will automatically trigger a refresh of the visualization on the map.

    The example below configures a WMSImageModel to request temperature data on the 1st of july 2016, at ground level.

    wmsImageModel.dimensions = {
      TIME: "2016-07-01T12:00:00.000Z",
      ELEVATION: 0
    };
    since

    2016.1

    Returns object | null

  • Dimension parameters to send along with WMS GetMap and GetFeatureInfo request. Typical dimensions are TIME and ELEVATION.

    The object literal can contain simple key/value pairs. Dimension names will be prefixed with "DIM_" in the WMS requests, if this is not already the case. The dimension names TIME and ELEVATION will never be prefixed. Accepted values are strings, numbers, booleans. A ProgrammingError will be thrown if values of another type are used. Values must not be URL encoded. Assigning other values than object literals to dimensions will throw a ProgrammingError.

    Assigning to this property will automatically trigger a refresh of the visualization on the map.

    The example below configures a WMSImageModel to request temperature data on the 1st of july 2016, at ground level.

    wmsImageModel.dimensions = {
      TIME: "2016-07-01T12:00:00.000Z",
      ELEVATION: 0
    };
    since

    2016.1

    Parameters

    • value: object | null

    Returns any

layers

  • get layers(): string[]
  • set layers(layers: string[]): void
  • The WMS layers, specified as an array of strings. Each string is a layer name identifier.

    These layers are not the same as a Layer. They are the layers exposed by the WMS server and which are listed in the capabilities document of the WMS server.

    This layers array must be considered as an immutable property. This means that to add or to remove layers, you will need to reassign this property again. Directly removing elements from the array, or directly adding elements to the array, without resetting the property will have no effect.

    The order of the layers in the array corresponds to the rendering order of the layers by the WMS server.

    Assigning to this property will automatically trigger a refresh of the visualization on the map.

    Returns string[]

  • The WMS layers, specified as an array of strings. Each string is a layer name identifier.

    These layers are not the same as a Layer. They are the layers exposed by the WMS server and which are listed in the capabilities document of the WMS server.

    This layers array must be considered as an immutable property. This means that to add or to remove layers, you will need to reassign this property again. Directly removing elements from the array, or directly adding elements to the array, without resetting the property will have no effect.

    The order of the layers in the array corresponds to the rendering order of the layers by the WMS server.

    Assigning to this property will automatically trigger a refresh of the visualization on the map.

    Parameters

    • layers: string[]

    Returns any

modelDescriptor

queryLayers

  • get queryLayers(): string[]
  • set queryLayers(queryLayers: string[]): void
  • The WMS layers that will be queried. These are the layers that will be used in the GetFeatureInfo requests performed by the WMSImageLayer.getFeatureInfo method.

    The query layers are specified as an array of strings. Each string is a layer name identifier.

    This queryLayers array must be considered as an immutable property. This means that to add or to remove layers, you will need to reassign this property again. Directly removing elements from the array, or directly adding elements to the array, without resetting the property will have no effect.

    Assigning to this property will automatically trigger a refresh of the visualization on the map.

    Returns string[]

  • The WMS layers that will be queried. These are the layers that will be used in the GetFeatureInfo requests performed by the WMSImageLayer.getFeatureInfo method.

    The query layers are specified as an array of strings. Each string is a layer name identifier.

    This queryLayers array must be considered as an immutable property. This means that to add or to remove layers, you will need to reassign this property again. Directly removing elements from the array, or directly adding elements to the array, without resetting the property will have no effect.

    Assigning to this property will automatically trigger a refresh of the visualization on the map.

    Parameters

    • queryLayers: string[]

    Returns any

queryable

  • get queryable(): boolean
  • Reports whether this model supports GetFeatureInfo requests. This is only true if the queryLayers property is filled in.

    Returns boolean

reference

requestHeaders

  • get requestHeaders(): {} | null
  • set requestHeaders(value: {} | null): void
  • Headers to send with every HTTP request.

    See GoogleImageModel.requestHeaders for more information.

    The default value is null.

    Returns {} | null

  • Headers to send with every HTTP request.

    See GoogleImageModel.requestHeaders for more information.

    The default value is null.

    Parameters

    • value: {} | null

    Returns any

requestParameters

  • get requestParameters(): object | null
  • set requestParameters(value: object | null): void
  • Custom request parameters to send along with WMS GetMap and GetFeatureInfo request. The object literal can contain simple key/value pairs. If you try to configure request parameters that are part of the WMS standard, a ProgrammingError will be thrown. For example, adding a "layers" request parameter is not allowed. Accepted values are strings, numbers and booleans. A ProgrammingError will be thrown if values of another type are used. Values must not be URL encoded.

    Assignments of other values than object literals to requestParameters will throw an Error. Clearing the parameters can be done by assigning null or an empty object literal to requestParameters. Assigning to this property will automatically trigger a refresh of the visualization on the map.

    since

    2016.1

    Returns object | null

  • Custom request parameters to send along with WMS GetMap and GetFeatureInfo request. The object literal can contain simple key/value pairs. If you try to configure request parameters that are part of the WMS standard, a ProgrammingError will be thrown. For example, adding a "layers" request parameter is not allowed. Accepted values are strings, numbers and booleans. A ProgrammingError will be thrown if values of another type are used. Values must not be URL encoded.

    Assignments of other values than object literals to requestParameters will throw an Error. Clearing the parameters can be done by assigning null or an empty object literal to requestParameters. Assigning to this property will automatically trigger a refresh of the visualization on the map.

    since

    2016.1

    Parameters

    • value: object | null

    Returns any

sld

  • get sld(): string | null
  • set sld(value: string | null): void
  • A url to a Styled Layer Descriptor that must be passed when making a request. This corresponds to the SLD request parameter in the GetMap request. If you assign to this value, the value of the sldBody property, if any, will be reset to null.

    Assigning to this property will automatically trigger a refresh of the visualization on the map.

    since

    2016.1

    Returns string | null

  • A url to a Styled Layer Descriptor that must be passed when making a request. This corresponds to the SLD request parameter in the GetMap request. If you assign to this value, the value of the sldBody property, if any, will be reset to null.

    Assigning to this property will automatically trigger a refresh of the visualization on the map.

    since

    2016.1

    Parameters

    • value: string | null

    Returns any

sldBody

  • get sldBody(): string | null
  • set sldBody(value: string | null): void
  • the Styled Layer Descriptor to pass when making a request. This corresponds to the SLD_BODY request parameter in the GetMap request. The SLD must not be URL encoded.

    If you assign to this value, the value of the sldBody property, if any, will be reset to null.

    Assigning to this property will automatically trigger a refresh of the visualization on the map.

    since

    2016.1

    Returns string | null

  • the Styled Layer Descriptor to pass when making a request. This corresponds to the SLD_BODY request parameter in the GetMap request. The SLD must not be URL encoded.

    If you assign to this value, the value of the sldBody property, if any, will be reset to null.

    Assigning to this property will automatically trigger a refresh of the visualization on the map.

    since

    2016.1

    Parameters

    • value: string | null

    Returns any

styles

  • get styles(): string[]
  • set styles(value: string[]): void
  • The named styles to apply on the server when making a request. The style names in the array apply to the respective layers. Specifying a style name for a layer is optional; if you do not wish to specify a style name for a particular layer, you can omit the entry for that layer or pass an empty string in the styles array. The STYLES request parameter is mandatory in a WMS request, but can be empty in case no styles are defined.

    Assigning to this property will automatically trigger a refresh of the visualization on the map.

    since

    2016.1

    Returns string[]

  • The named styles to apply on the server when making a request. The style names in the array apply to the respective layers. Specifying a style name for a layer is optional; if you do not wish to specify a style name for a particular layer, you can omit the entry for that layer or pass an empty string in the styles array. The STYLES request parameter is mandatory in a WMS request, but can be empty in case no styles are defined.

    Assigning to this property will automatically trigger a refresh of the visualization on the map.

    since

    2016.1

    Parameters

    • value: string[]

    Returns any

transparent

  • get transparent(): boolean
  • set transparent(val: boolean): void
  • Indicates whether the ImageModel will request transparent tiles from the server or not

    Returns boolean

  • Indicates whether the ImageModel will request transparent tiles from the server or not

    Parameters

    • val: boolean

    Returns any

Methods

invalidate

  • (): void

Static createFromCapabilities

  • Creates a WMS image model for the given layers and options. This is the recommended method to create a model based on information provided by WMSCapabilities.

    since

    2019.1

    throws

    ProgrammingError if any of the following cases occurs:

    • The reference and bounds in the options are both passed and the references do not match.
    • both sld and sldBody are specified in the options.

    Parameters

    • wmsCapabilities: WMSCapabilities

      The capabilities of the WMS server.

    • wmsLayers: WMSCapabilitiesLayerConfig[]

      An array of object literals that defines the desired WMS layers and (optionally) their layer styles. Each object literal has a mandatory layer property and an optional style property, both of type String.

    • Optional options: WMSImageModelCreateOptions

      the options for the WMS model

    Returns WMSImageModel

    a WMSImageModel for the given parameters.

Static createFromURL

  • Creates a WMS image model for the given layers and options. This is the recommended method to create a model based on a given WMS server URL and layer name(s).

    since

    2019.1

    Parameters

    • url: string

      The URL of the WMS server.

    • wmsLayers: WMSCapabilitiesLayerConfig[]

      An array of object literals that defines the desired WMS layers and (optionally) their layer styles. Each object literal has a mandatory layer property and an optional style property, both of type String.

    • Optional options: WMSImageModelCreateOptions

      the options for the WMS model

    Returns Promise<WMSImageModel>

    a promise for a WMSImageModel for the given parameters. The promise is rejected if the model creation fails.

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method