Last updated

API / geotoolkit / map / sources / WMS / WMS

Class: WMS

sources.WMS.WMS

Image source that allows user to get map data as an image using the WMS (Web Map Service) server

Hierarchy

Table of contents

Constructors
Methods
Css Properties
Name Type Description
systemstringInitial data coordinate system
urlstringData server url

Contents

Constructors

new WMS(options)

new WMS(options?)

Creates WMS source

Parameters

Name Type Description
Optional optionsOptionsoptions

Overrides

Image.constructor

Methods

abortGeometryQueries

abortGeometryQueries(): WMS

Aborts all the geometry data queried

Returns

WMS

this


clear

clear(): WMS

Notifies source to remove all data added.

Returns

WMS

this

Inherited from

Image.clear


dispose

dispose(): void

Disposes this source, once disposed it should not be used anymore.

Returns

void

Inherited from

Image.dispose


getClassName

getClassName(): string

Returns

string

Inherited from

Image.getClassName


getCopyright

getCopyright(): string

Returns copyright information.

Returns

string

Inherited from

Image.getCopyright


getDataLoader

Protected getDataLoader(): AbstractLoader

Returns server data loader (if exists)

Returns

AbstractLoader

Inherited from

Image.getDataLoader


getFeatureInfo

getFeatureInfo(geometry, layer): AbstractFeature[]

Queries data by the geometry provided.

Parameters

Name Type Description
geometryPointarea geometry to request
layerWMSlayer for query

Returns

AbstractFeature[]


getImageFormat

getImageFormat(): Image

Returns the image format currently used

Returns

Image


getInflateRatio

getInflateRatio(): number

Returns current inflate ratio

Returns

number

Inherited from

Image.getInflateRatio


getInitialCoordinateSystem

getInitialCoordinateSystem(): AbstractSystem

Gets current data initial coordinate system.

Returns

AbstractSystem

Inherited from

Image.getInitialCoordinateSystem


getLayers

getLayers(): LayerServerData[]

Returns layers JSON data loaded from the server Should be used asynchronically after loadServerData() method is called

Returns

LayerServerData[]

Inherited from

Image.getLayers


getMapCoordinateSystem

getMapCoordinateSystem(): AbstractSystem

Gets current map coordinate system.

Returns

AbstractSystem

Inherited from

Image.getMapCoordinateSystem


getModelLimits

getModelLimits(): Rect

Returns the current data model limits (presumably loaded from the server if it's settled)

Returns

Rect

Inherited from

Image.getModelLimits


getProperties

getProperties(): OptionsOut

Returns properties

Returns

OptionsOut

properties

Inherited from

Image.getProperties


getServerData

getServerData(): JSONObject | XMLDocument

Returns server data loaded from the server Should be used asynchronically after loadServerData() method is called

Returns

JSONObject | XMLDocument

Inherited from

Image.getServerData


getServerURL

getServerURL(): string | string[]

Gets the server url that is currently used for requests

Returns

string | string[]

server url

Inherited from

Image.getServerURL


getSourceTimeout

getSourceTimeout(): number

Returns timeout

Returns

number

Inherited from

Image.getSourceTimeout


getTransformerFromMap

getTransformerFromMap(): Transformer

Gets transformer to transform data from map coordinate system

Returns

Transformer

Inherited from

Image.getTransformerFromMap


getTransformerToMap

getTransformerToMap(): Transformer

Gets transformer to transform data to map coordinate system

Returns

Transformer

Inherited from

Image.getTransformerToMap


getTransparent

getTransparent(): boolean

Returns the image current transparency

Returns

boolean


getVersion

getVersion(): string

Returns WMS version currently used

Returns

string


getVisibleLayers

getVisibleLayers(): (string | number)[]

Returns the server layer ids that are requested.

Returns

(string | number)[]

layers

Inherited from

Image.getVisibleLayers


hasEventListener

hasEventListener(type, callback?): boolean

Check if a list of event listeners for this type contains this listener

Parameters

Name Type Description
typestringtype of event or property
Optional callbackFunctionto be called, if null, check if any callback is registered

Returns

boolean

Inherited from

Image.hasEventListener


hideLayers

hideLayers(id?): WMS

Adds the passed in ID's to the list of layers to hide

Parameters

Name Type Description
Optional idstring | number | (string | number)[]ID(s) for the layers to show

Returns

WMS

this

Inherited from

Image.hideLayers


initLoader

Protected initLoader(loader?): WMS

Initializes the loader provided

Parameters

Name Type Description
Optional loaderAbstractLoaderloader to use

Returns

WMS

this

Inherited from

Image.initLoader


isDataLoaded

isDataLoaded(): boolean

Returns true if server data is already loaded (or no loader provided)

Returns

boolean

Inherited from

Image.isDataLoaded


isDataReady

isDataReady(): boolean

Checks if source (current visible) data is loaded and ready to be rendered

Returns

boolean

Inherited from

Image.isDataReady


isDisposed

isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

Image.isDisposed


isLoading

isLoading(): boolean

Checks if some of the requests haven't been finished yet. Returns true if some data is loading, false otherwise.

Returns

boolean

Inherited from

Image.isLoading


isSilent

isSilent(): boolean

Return true if the event dispatcher doesn't notify any events

Returns

boolean

Inherited from

Image.isSilent


loadServerData

loadServerData(): Promise<WMS>

Returns promise that is loaded when server settings are ready to process

Returns

Promise<WMS>

Inherited from

Image.loadServerData


loadSourceData

loadSourceData(): Promise<AbstractSource>

Returns promise that is resolving when data are ready to process

Returns

Promise<AbstractSource>

Inherited from

Image.loadSourceData


notify

notify<E>(type, source, args?): WMS

Notify listeners

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEevent types
sourceWMSof the event
Optional argsEventMap[E]arguments of the event

Returns

WMS

this

Overrides

Image.notify


off

off<E>(type?, callback?): WMS

Detach listener on event. Calling .off() with no arguments removes all attached listeners. Calling .off(type) with no callback removes all attached listeners for specific type.

Type parameters

NameType
Eextends string

Parameters

Name Type Description
Optional typeEtype of the event
Optional callback(eventType: E, sender: WMS, args: EventMap[E]) => voidfunction to be called

Returns

WMS

this

Overrides

Image.off


on

on<E>(type, callback): WMS

Attach listener on event that will be called whenever the specified event is delivered to the target

If the callback function is already in the list of event listeners for this target, the function is not added a second time.

If a particular anonymous function is in the list of event listeners registered for a certain target, and then later in the code, an identical anonymous function is given in an "on" call, the second function will also be added to the list of event listeners for that target.

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEtype of event or property
callback(eventType: E, sender: WMS, args: EventMap[E]) => voidto be called

Returns

WMS

this

Overrides

Image.on


resetLastQueryParams

Protected resetLastQueryParams(): WMS

Resets saved last queried limits and layer

Returns

WMS

this

Inherited from

Image.resetLastQueryParams


setDataReady

Protected setDataReady(isReady, err?): WMS

Sets source (current visible) data ready/not ready, changes the corresponding promise

Parameters

Name Type Description
isReadybooleantrue if source data was loaded, false if it needs to be reset
Optional errErrordata loading error (if exists)

Returns

WMS

this

Inherited from

Image.setDataReady


setImageFormat

setImageFormat(format): WMS

Sets the image format to be used

Parameters

Name Type Description
formatImageimage format to use (e.g. 'png')

Returns

WMS

this


setInflateRatio

setInflateRatio(ratio): WMS

Sets image inflate ratio to use

Parameters

Name Type Description
rationumberimage inflate ratio (e.g. 0.2 means the 20% inflation)

Returns

WMS

this

Inherited from

Image.setInflateRatio


setInitialCoordinateSystem

setInitialCoordinateSystem(system): WMS

Sets the data initial coordinate system.

Parameters

Name Type Description
systemstring | AbstractSysteminitial coordinate system

Returns

WMS

this

Inherited from

Image.setInitialCoordinateSystem


setMapCoordinateSystem

setMapCoordinateSystem(system): WMS

Sets map coordinate system.

Parameters

Name Type Description
systemstring | AbstractSystemmap coordinate system

Returns

WMS

this

Inherited from

Image.setMapCoordinateSystem


setProperties

setProperties(properties?): WMS

Sets properties

Parameters

Name Type Description
Optional propertiesOptionsproperties

Returns

WMS

this

Inherited from

Image.setProperties


setQueryParameter

setQueryParameter(param, value?): WMS

Sets custom query parameter to add to the data requests

Parameters

Name Type Description
paramstring | Record<string, string | number>parameter name or custom parameters object (in name -> value format)
Optional valuestring | numberparameter value

Returns

WMS

this

Inherited from

Image.setQueryParameter


setServerURL

setServerURL(url): WMS

Sets the server url to use for requesting

Parameters

Name Type Description
urlstring | string[]server url

Returns

WMS

this

Inherited from

Image.setServerURL


setSilent

setSilent(bool): WMS

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

WMS

this

Inherited from

Image.setSilent


setSourceTimeout

setSourceTimeout(timeout): WMS

Sets timeout

Parameters

Name Type Description
timeoutnumbertimeout

Returns

WMS

this

Inherited from

Image.setSourceTimeout


setTooltipLayers

setTooltipLayers(layers): WMS

Sets layers to show as the tooltip info (in .getFeatureInfo method)

Parameters

Name Type Description
layersnumber | number[]layers to show tooltip

Returns

WMS

this


setTransparent

setTransparent(transparent): WMS

Sets the image transparency

Parameters

Name Type Description
transparentbooleanimage transparency

Returns

WMS

this


setVersion

setVersion(version): WMS

Sets WMS version to use

Parameters

Name Type Description
versionstringversion to use (in '1.3.0' format)

Returns

WMS

this


showLayers

showLayers(layers): WMS

Sets the server layer name(s) to be shown on the layer

Parameters

Name Type Description
layersstring | number | (string | number)[]layer id(s) to be shown

Returns

WMS

this

Inherited from

Image.showLayers


update

update(): WMS

Aborts all the sent requests, resends the last one

Returns

WMS

this

Inherited from

Image.update


getClassName

Static getClassName(): string

Returns

string

Inherited from

Image.getClassName