OpenLayers.Format.WMC.v1

Superclass for WMC version 1 parsers.

Inherits from

Summary
OpenLayers.Format.WMC.v1Superclass for WMC version 1 parsers.
Properties and Functions
namespaces{Object} Mapping of namespace aliases to namespace URIs.
schemaLocation{String} Schema location for a particular minor version.
getNamespacePrefixGet the namespace prefix for a given uri from the namespaces object.
defaultPrefix
rootPrefix{String} Prefix on the root node that maps to the context namespace URI.
defaultStyleName{String} Style name used if layer has no style param.
defaultStyleTitle{String} Default style title.
Constructor
OpenLayers.Format.WMC.v1Instances of this class are not created directly.
Functions
readRead capabilities data from a string, and return a list of layers.
runChildNodes
read_wmc_General
read_wmc_BoundingBox
read_wmc_LayerList
read_wmc_Layer
read_wmc_Extension
read_ol_units
read_ol_maxExtent
read_ol_transparent
read_ol_numZoomLevels
read_ol_opacity
read_ol_singleTile
read_ol_tileSize
read_ol_gutter
read_ol_isBaseLayer
read_ol_displayInLayerSwitcher
read_ol_attribution
read_wmc_Server
read_wmc_FormatList
read_wmc_Format
read_wmc_StyleList
read_wmc_Style
read_wmc_SLD
read_sld_StyledLayerDescriptor
read_sld_FeatureTypeStyle
read_wmc_OnlineResource
read_wmc_Name
read_wmc_Title
read_wmc_MetadataURL
read_wmc_KeywordList
read_wmc_Keyword
read_wmc_Abstract
read_wmc_LogoURL
read_wmc_DescriptionURL
read_wmc_ContactInformation
read_wmc_ContactPersonPrimary
read_wmc_ContactPerson
read_wmc_ContactOrganization
read_wmc_ContactPosition
read_wmc_ContactAddress
read_wmc_AddressType
read_wmc_Address
read_wmc_City
read_wmc_StateOrProvince
read_wmc_PostCode
read_wmc_Country
read_wmc_ContactVoiceTelephone
read_wmc_ContactFacsimileTelephone
read_wmc_ContactElectronicMailAddress
read_wmc_DataURL
read_wmc_LegendURL
read_wmc_DimensionList
read_wmc_Dimension
write
createElementDefaultNSShorthand for createElementNS with namespace from defaultPrefix.
setAttributesSet multiple attributes given key value pairs from an object.
write_wmc_GeneralCreate a General node given an context object.
write_wmc_KeywordList
write_wmc_ContactInformation
write_wmc_ContactPersonPrimary
write_wmc_ContactAddress
write_ol_MapExtension
write_wmc_LayerListCreate a LayerList node given an context object.
write_wmc_LayerCreate a Layer node given a layer context object.
write_ol_attributionCreate an attribution node given a layer attribution object.
write_wmc_LayerExtensionAdd OpenLayers specific layer parameters to an Extension element.
createOLPropertyNodeCreate a node representing an OpenLayers property.
write_wmc_ServerCreate a Server node given a layer context object.
write_wmc_URLTypeCreate a LogoURL/DescriptionURL/MetadataURL/DataURL/LegendURL node given a object and elementName.
write_wmc_DimensionList
write_wmc_FormatListCreate a FormatList node given a layer context.
write_wmc_StyleListCreate a StyleList node given a layer context.
write_wmc_OnlineResourceCreate an OnlineResource node given a URL.
getOnlineResource_href

Properties and Functions

namespaces

{Object} Mapping of namespace aliases to namespace URIs.

schemaLocation

{String} Schema location for a particular minor version.

getNamespacePrefix

getNamespacePrefix: function(uri)

Get the namespace prefix for a given uri from the namespaces object.

Returns

{String} A namespace prefix or null if none found.

defaultPrefix

rootPrefix

{String} Prefix on the root node that maps to the context namespace URI.

defaultStyleName

{String} Style name used if layer has no style param.  Default is “”.

defaultStyleTitle

{String} Default style title.  Default is “Default”.

Constructor

OpenLayers.Format.WMC.v1

Instances of this class are not created directly.  Use the OpenLayers.Format.WMC constructor instead.

Parameters

options{Object} An optional object whose properties will be set on this instance.

Functions

read

read: function(data)

Read capabilities data from a string, and return a list of layers.

Parameters

data{String} or {DOMElement} data to read/parse.

Returns

{Array} List of named layers.

runChildNodes

runChildNodes: function(obj,
node)

read_wmc_General

read_wmc_General: function(context,
node)

read_wmc_BoundingBox

read_wmc_BoundingBox: function(context,
node)

read_wmc_LayerList

read_wmc_LayerList: function(context,
node)

read_wmc_Layer

read_wmc_Layer: function(context,
node)

read_wmc_Extension

read_wmc_Extension: function(obj,
node)

read_ol_units

read_ol_units: function(layerContext,
node)

read_ol_maxExtent

read_ol_maxExtent: function(obj,
node)

read_ol_transparent

read_ol_transparent: function(layerContext,
node)

read_ol_numZoomLevels

read_ol_numZoomLevels: function(layerContext,
node)

read_ol_opacity

read_ol_opacity: function(layerContext,
node)

read_ol_singleTile

read_ol_singleTile: function(layerContext,
node)

read_ol_tileSize

read_ol_tileSize: function(layerContext,
node)

read_ol_gutter

read_ol_gutter: function(layerContext,
node)

read_ol_isBaseLayer

read_ol_isBaseLayer: function(layerContext,
node)

read_ol_displayInLayerSwitcher

read_ol_displayInLayerSwitcher: function(layerContext,
node)

read_ol_attribution

read_ol_attribution: function(obj,
node)

read_wmc_Server

read_wmc_Server: function(layerContext,
node)

read_wmc_FormatList

read_wmc_FormatList: function(layerContext,
node)

read_wmc_Format

read_wmc_Format: function(layerContext,
node)

read_wmc_StyleList

read_wmc_StyleList: function(layerContext,
node)

read_wmc_Style

read_wmc_Style: function(layerContext,
node)

read_wmc_SLD

read_wmc_SLD: function(style,
node)

read_sld_StyledLayerDescriptor

read_sld_StyledLayerDescriptor: function(sld,
node)

read_sld_FeatureTypeStyle

read_sld_FeatureTypeStyle: function(sld,
node)

read_wmc_OnlineResource

read_wmc_OnlineResource: function(obj,
node)

read_wmc_Name

read_wmc_Name: function(obj,
node)

read_wmc_Title

read_wmc_Title: function(obj,
node)

read_wmc_MetadataURL

read_wmc_MetadataURL: function(layerContext,
node)

read_wmc_KeywordList

read_wmc_KeywordList: function(context,
node)

read_wmc_Keyword

read_wmc_Keyword: function(keywords,
node)

read_wmc_Abstract

read_wmc_Abstract: function(obj,
node)

read_wmc_LogoURL

read_wmc_LogoURL: function(context,
node)

read_wmc_DescriptionURL

read_wmc_DescriptionURL: function(context,
node)

read_wmc_ContactInformation

read_wmc_ContactInformation: function(obj,
node)

read_wmc_ContactPersonPrimary

read_wmc_ContactPersonPrimary: function(contact,
node)

read_wmc_ContactPerson

read_wmc_ContactPerson: function(primaryPerson,
node)

read_wmc_ContactOrganization

read_wmc_ContactOrganization: function(primaryPerson,
node)

read_wmc_ContactPosition

read_wmc_ContactPosition: function(contact,
node)

read_wmc_ContactAddress

read_wmc_ContactAddress: function(contact,
node)

read_wmc_AddressType

read_wmc_AddressType: function(contactAddress,
node)

read_wmc_Address

read_wmc_Address: function(contactAddress,
node)

read_wmc_City

read_wmc_City: function(contactAddress,
node)

read_wmc_StateOrProvince

read_wmc_StateOrProvince: function(contactAddress,
node)

read_wmc_PostCode

read_wmc_PostCode: function(contactAddress,
node)

read_wmc_Country

read_wmc_Country: function(contactAddress,
node)

read_wmc_ContactVoiceTelephone

read_wmc_ContactVoiceTelephone: function(contact,
node)

read_wmc_ContactFacsimileTelephone

read_wmc_ContactFacsimileTelephone: function(contact,
node)

read_wmc_ContactElectronicMailAddress

read_wmc_ContactElectronicMailAddress: function(contact,
node)

read_wmc_DataURL

read_wmc_DataURL: function(layerContext,
node)

read_wmc_LegendURL

read_wmc_LegendURL: function(style,
node)

read_wmc_DimensionList

read_wmc_DimensionList: function(layerContext,
node)

read_wmc_Dimension

read_wmc_Dimension: function(dimensions,
node)

write

write: function(context,
options)

Parameters

context{Object} An object representing the map context.
options{Object} Optional object.

Returns

{String} A WMC document string.

createElementDefaultNS

createElementDefaultNS: function(name,
childValue,
attributes)

Shorthand for createElementNS with namespace from defaultPrefix.  Can optionally be used to set attributes and a text child value.

Parameters

name{String} The qualified node name.
childValue{String} Optional value for text child node.
attributes{Object} Optional object representing attributes.

Returns

{Element} An element node.

setAttributes

setAttributes: function(node,
obj)

Set multiple attributes given key value pairs from an object.

Parameters

node{Element} An element node.
obj{Object} An object whose properties represent attribute names and values represent attribute values.

write_wmc_General

write_wmc_General: function(context)

Create a General node given an context object.

Parameters

context{Object} Context object.

Returns

{Element} A WMC General element node.

write_wmc_KeywordList

write_wmc_KeywordList: function(keywords)

write_wmc_ContactInformation

write_wmc_ContactInformation: function(contact)

write_wmc_ContactPersonPrimary

write_wmc_ContactPersonPrimary: function(personPrimary)

write_wmc_ContactAddress

write_wmc_ContactAddress: function(contactAddress)

write_ol_MapExtension

write_ol_MapExtension: function(context)

write_wmc_LayerList

write_wmc_LayerList: function(context)

Create a LayerList node given an context object.

Parameters

context{Object} Context object.

Returns

{Element} A WMC LayerList element node.

write_wmc_Layer

write_wmc_Layer: function(context)

Create a Layer node given a layer context object.

Parameters

context{Object} A layer context object.}

Returns

{Element} A WMC Layer element node.

write_ol_attribution

write_ol_attribution: function(attribution)

Create an attribution node given a layer attribution object.

Parameters

attribution{<Object>} or {String} A layer attribution object or string

Returns

{Element} A ol:attribution element node.

write_wmc_LayerExtension

write_wmc_LayerExtension: function(context)

Add OpenLayers specific layer parameters to an Extension element.

Parameters

context{Object} A layer context object.

Returns

{Element} A WMC Extension element (for a layer).

createOLPropertyNode

createOLPropertyNode: function(obj,
prop)

Create a node representing an OpenLayers property.  If the property is null or undefined, null will be returned.

Parameters

obj{Object} An object.
prop{String} A property.

Returns

{Element} A property node.

write_wmc_Server

write_wmc_Server: function(context)

Create a Server node given a layer context object.

Parameters

context{Object} Layer context object.

Returns

{Element} A WMC Server element node.

write_wmc_URLType

write_wmc_URLType: function(elName,
url,
attr)

Create a LogoURL/DescriptionURL/MetadataURL/DataURL/LegendURL node given a object and elementName.

Parameters

elName{String} Name of element (LogoURL/DescriptionURL/MetadataURL/LegendURL)
url{String} URL string value
attr{Object} Optional attributes (width, height, format)

Returns

{Element} A WMC element node.

write_wmc_DimensionList

write_wmc_DimensionList: function(context)

write_wmc_FormatList

write_wmc_FormatList: function(context)

Create a FormatList node given a layer context.

Parameters

context{Object} Layer context object.

Returns

{Element} A WMC FormatList element node.

write_wmc_StyleList

write_wmc_StyleList: function(layer)

Create a StyleList node given a layer context.

Parameters

layer{Object} Layer context object.

Returns

{Element} A WMC StyleList element node.

write_wmc_OnlineResource

write_wmc_OnlineResource: function(href)

Create an OnlineResource node given a URL.

Parameters

href{String} URL for the resource.

Returns

{Element} A WMC OnlineResource element node.

getOnlineResource_href

getOnlineResource_href: function(node)
getNamespacePrefix: function(uri)
Get the namespace prefix for a given uri from the namespaces object.
{Object} Mapping of namespace aliases to namespace URIs.
read: function(data)
Read capabilities data from a string, and return a list of layers.
runChildNodes: function(obj,
node)
read_wmc_General: function(context,
node)
read_wmc_BoundingBox: function(context,
node)
read_wmc_LayerList: function(context,
node)
read_wmc_Layer: function(context,
node)
read_wmc_Extension: function(obj,
node)
read_ol_units: function(layerContext,
node)
read_ol_maxExtent: function(obj,
node)
read_ol_transparent: function(layerContext,
node)
read_ol_numZoomLevels: function(layerContext,
node)
read_ol_opacity: function(layerContext,
node)
read_ol_singleTile: function(layerContext,
node)
read_ol_tileSize: function(layerContext,
node)
read_ol_gutter: function(layerContext,
node)
read_ol_isBaseLayer: function(layerContext,
node)
read_ol_displayInLayerSwitcher: function(layerContext,
node)
read_ol_attribution: function(obj,
node)
read_wmc_Server: function(layerContext,
node)
read_wmc_FormatList: function(layerContext,
node)
read_wmc_Format: function(layerContext,
node)
read_wmc_StyleList: function(layerContext,
node)
read_wmc_Style: function(layerContext,
node)
read_wmc_SLD: function(style,
node)
read_sld_StyledLayerDescriptor: function(sld,
node)
read_sld_FeatureTypeStyle: function(sld,
node)
read_wmc_OnlineResource: function(obj,
node)
read_wmc_Name: function(obj,
node)
read_wmc_Title: function(obj,
node)
read_wmc_MetadataURL: function(layerContext,
node)
read_wmc_KeywordList: function(context,
node)
read_wmc_Keyword: function(keywords,
node)
read_wmc_Abstract: function(obj,
node)
read_wmc_LogoURL: function(context,
node)
read_wmc_DescriptionURL: function(context,
node)
read_wmc_ContactInformation: function(obj,
node)
read_wmc_ContactPersonPrimary: function(contact,
node)
read_wmc_ContactPerson: function(primaryPerson,
node)
read_wmc_ContactOrganization: function(primaryPerson,
node)
read_wmc_ContactPosition: function(contact,
node)
read_wmc_ContactAddress: function(contact,
node)
read_wmc_AddressType: function(contactAddress,
node)
read_wmc_Address: function(contactAddress,
node)
read_wmc_City: function(contactAddress,
node)
read_wmc_StateOrProvince: function(contactAddress,
node)
read_wmc_PostCode: function(contactAddress,
node)
read_wmc_Country: function(contactAddress,
node)
read_wmc_ContactVoiceTelephone: function(contact,
node)
read_wmc_ContactFacsimileTelephone: function(contact,
node)
read_wmc_ContactElectronicMailAddress: function(contact,
node)
read_wmc_DataURL: function(layerContext,
node)
read_wmc_LegendURL: function(style,
node)
read_wmc_DimensionList: function(layerContext,
node)
read_wmc_Dimension: function(dimensions,
node)
write: function(context,
options)
createElementDefaultNS: function(name,
childValue,
attributes)
Shorthand for createElementNS with namespace from defaultPrefix.
setAttributes: function(node,
obj)
Set multiple attributes given key value pairs from an object.
write_wmc_General: function(context)
Create a General node given an context object.
write_wmc_KeywordList: function(keywords)
write_wmc_ContactInformation: function(contact)
write_wmc_ContactPersonPrimary: function(personPrimary)
write_wmc_ContactAddress: function(contactAddress)
write_ol_MapExtension: function(context)
write_wmc_LayerList: function(context)
Create a LayerList node given an context object.
write_wmc_Layer: function(context)
Create a Layer node given a layer context object.
write_ol_attribution: function(attribution)
Create an attribution node given a layer attribution object.
write_wmc_LayerExtension: function(context)
Add OpenLayers specific layer parameters to an Extension element.
createOLPropertyNode: function(obj,
prop)
Create a node representing an OpenLayers property.
write_wmc_Server: function(context)
Create a Server node given a layer context object.
write_wmc_URLType: function(elName,
url,
attr)
Create a LogoURL/DescriptionURL/MetadataURL/DataURL/LegendURL node given a object and elementName.
write_wmc_DimensionList: function(context)
write_wmc_FormatList: function(context)
Create a FormatList node given a layer context.
write_wmc_StyleList: function(layer)
Create a StyleList node given a layer context.
write_wmc_OnlineResource: function(href)
Create an OnlineResource node given a URL.
getOnlineResource_href: function(node)
Read and write XML.
Read and write Web Map Context documents.
Contains convenience functions for string manipulation.
Close