Class: WMSCapabilities

ol.control. WMSCapabilities

WMSCapabilities


new WMSCapabilities(options)

Parameters:
Name Type Description
options *
Properties
Name Type Argument Default Description
target string | Element <optional>

the target to set the dialog, use document.body to have fullwindow dialog

proxy string <optional>

proxy to use when requesting Getcapabilites, default none (suppose the service use CORS)

placeholder string <optional>
'service url...'

input placeholder, default 'service url...'

title string <optional>
WMS

dialog title, default 'WMS'

searchLabel string <optional>
'search'

Label for search button, default 'search'

loadLabel string <optional>
'load'

Label for load button, default 'load'

srs Array.<string> <optional>

an array of supported srs, default map projection code or 'EPSG:3857'

timeout number <optional>
1000

Timeout for getCapabilities request, default 1000

cors boolean <optional>
false

Use CORS, default false

optional string <optional>

a list of optional url properties (when set in the request url), separated with ','

trace boolean <optional>
false

Log layer info, default false

services * <optional>

a key/url object of services for quick access in a menu

Fires:
  • event:load
  • event:capabilities

Extends

Members


error

Error list: a key/value list of error to display in the dialog Overwrite it to handle internationalization


labels

Form labels: a key/value list of form labels to display in the dialog Overwrite it to handle internationalization

Methods


_getParser()

Get service parser


clearForm()

Clear form


getButtonElement()

Get the button element

Inherited From:
Overrides:
Returns:
Type
Element

getCapabilities(url, options)

Get WMS capabilities for a server

Parameters:
Name Type Description
url string

service url

options *
Properties
Name Type Argument Default Description
map string

WMS map or get map in url?map=xxx

version string <optional>
1.3.0

WMS version (yet only 1.3.0 is implemented), default 1.3.0

timeout number <optional>
10000

timout to get the capabilities, default 10000

onload function <optional>

callback function


getDialog()

Get the dialog

Returns:
Type
ol.control.Dialog

getLayerFromOptions(options)

Create a new layer using options received by getOptionsFromCap method

Parameters:
Name Type Description
options *

getOptionsFromCap(caps, parent)

Return a WMS ol.layer.Tile for the given capabilities

Parameters:
Name Type Description
caps *

layer capabilities (read from the capabilities)

parent *

capabilities

Returns:

options

Type
*

getRequestParam(options)

Get Capabilities request parameters

Parameters:
Name Type Description
options *

loadLayer(url, layername [, onload])

Load a layer using service

Parameters:
Name Type Argument Description
url string

service url

layername string
onload function <optional>

callback function (or listen to 'load' event)


setHtml(html)

Set the button html

Parameters:
Name Type Description
html string
Inherited From:
Overrides:

setMap(map)

Set the map instance the control is associated with and add its controls associated to this map.

Parameters:
Name Type Description
map _ol_Map_

The map instance.


setTitle(title)

Set the button title

Parameters:
Name Type Description
title string
Inherited From:
Overrides:

setVisible(b)

Set the control visibility

Parameters:
Name Type Description
b boolean
Inherited From:
Overrides:

showCapabilities(caps)

Display capabilities in the dialog

Parameters:
Name Type Description
caps *

JSON capabilities


showDialog( [url], options)

Show dialog for url

Parameters:
Name Type Argument Description
url string <optional>

service url, default ask for an url

options *

capabilities options

Properties
Name Type Description
map string

WMS map or get map in url?map=xxx

version string

WMS version (yet only 1.3.0 is implemented), default 1.3.0

timeout number

timout to get the capabilities, default 10000


showError(error)

Display error

Parameters:
Name Type Description
error *

event


testUrl(url)

Test url and return true if it is a valid url string

Parameters:
Name Type Description
url string
Returns:
Type
bolean