Version : 0.3
Last Change : 2003-10-27
File Name : WMSlayer.js
layerWMS Image-type class that makes a single request and OGC WMS server with one or more layers.
create method: function layerWMS(parent, url, layer, caption, version)
Creates the layerWMS class that defines the WMS layer properties and methods according to the OpenGIS specification,
where the parameters are:
- parent - class defining the control where the layer will be integrated can be null or an instant of mapWMS and its descendents
- url - server url (without the http)
- layer - layer name or names
- caption - optional parameter for future use on legends and display box
- version - optional parameter defining the wms version (default value is "1.1")
Methods
- url = function (BBox)
returns the OGC WMS compliant url for this request.
The BBox is optional parameter. When null and this class parent is a mapWMS (or any of its descendents)
his own BBox value will be used
- writeDOM = function (name, left, top, width, height, style)
Writes the necessary DHTML for this class (to-do still needs implement the style tag)
- refresh = function (BBox)
Updates the image HTML element with a new request (updating any changes made to the class)
- show = function () - not fully implemented
- hide = function () - not fully implemented
- isVisible = function () - not fully implemented
Properties
- parent : class defining the control where the layer will be integrated can be null or an instant of mapWMS and its descendents
- srs : defines the spatial reference system of the request (default value is "EPSG:4326" or the parent's value if different than null)
- wmsUrl : Url of the server (without the http)
- wmsLayers : string defining the layer name or names;
- caption : string defining the caption to be used in future implementations for the legend and configuration object
- format : (default value is "GIF")
- opacity : not fully implemented
- styles : string defining the layer(s) style(s) (default value is "")
- additionalParam : additional or vendor specific parameters to add to the url (default value is "")
- visible : boolean value defining the objects visibility (default value is "true")
- version : WMS version to be used to this request
- request : string that defines the url parameters of the WMS that are version-dependent (e.g. WMTVER and REQUEST)
- DOMref : reference to the image DOM object that is created on the writeDOM method.
- directLoading :
Added the option to select direct loading without using the transport image
by default is false in all browsers except in IE 6 (because this browsers will always recall the image even if it has an object in memory)
Events
- onError = function ( wmsLayer ) : event launched when a http connection error occurs
Examples
- single layer request example [view]
Change Log
- 2003-10-27 : When in directLoading mode the image source is first cleared using the
empty_img and only then goes to the wms url (once again thanks to Bart)
- 2003-10-24 : Added the option to select direct loading without using the transport image
by default is false in all browsers except in IE 6 (because this browsers will always recall the image even if it has a object in memory)
- 2003-10-10 : In url function forces the use of the BBox input parameter if exists
- 2003-09-09 : Change the add layer method so that accepts relative urls (*)
- 2003-06-25 : Documentation added
- 2003-04-28 : writeDOM method added to layerWMS
added the onerror event
|