Read and write Web Map Context documents.
OpenLayers. Format.WMC | Read and write Web Map Context documents. |
Properties | |
defaultVersion | {String} Version number to assume if none found. |
version | {String} Specify a version string if one is known. |
layerOptions | {Object} Default options for layers created by the parser. |
layerParams | {Object} Default parameters for layers created by the parser. |
parser | {Object} Instance of the versioned parser. |
Constructor | |
OpenLayers. Format.WMC | Create a new parser for WMC docs. |
Functions | |
read | Read WMC data from a string, and return an object with map properties and a list of layers. |
getParser | Get the WMC parser given a version. |
getLayerFromContext | Create a WMS layer from a layerContext object. |
getLayersFromContext | Create an array of WMS layers from an array of layerContext objects. |
contextToMap | Create a map given a context object. |
mergeContextToMap | Add layers from a context object to a map. |
write | Write a WMC document given a map. |
layerToContext | Create a layer context object given a wms layer object. |
toContext | Create a context object free from layer given a map or a context object. |
read: function( data, options )
Read WMC data from a string, and return an object with map properties and a list of layers.
data | {String} or {DOMElement} data to read/parse. |
options | {Object} The options object must contain a map property. If the map property is a string, it must be the id of a dom element where the new map will be placed. If the map property is an OpenLayers.Map, the layers from the context document will be added to the map. If the map property is an object, this will be considered as options to create the map with, in most cases, it would have a div property. |
{OpenLayers.Map} A map based on the context.
getParser: function( version )
Get the WMC parser given a version. Create a new parser if it does not already exist.
version | {String} The version of the parser. |
{OpenLayers.Format.WMC.v1} A WMC parser.
getLayerFromContext: function( layerContext )
Create a WMS layer from a layerContext object.
layerContext | {Object} An object representing a WMS layer. |
{OpenLayers.Layer.WMS} A WMS layer.
getLayersFromContext: function( layersContext )
Create an array of WMS layers from an array of layerContext objects.
layersContext | {Array(Object)} An array of objects representing WMS layers. |
{Array(OpenLayers.Layer.WMS)} An array of WMS layers.
contextToMap: function( context, options )
Create a map given a context object.
context | {Object} The context object. |
options | {Object} Default map options. |
{OpenLayers.Map} A map based on the context object.
mergeContextToMap: function( context, map )
Add layers from a context object to a map.
context | {Object} The context object. |
map | {OpenLayers.Map} The map. |
{OpenLayers.Map} The same map with layers added.
write: function( obj, options )
Write a WMC document given a map.
obj | {OpenLayers.Map | Object} A map or context object. |
options | {Object} Optional configuration object. |
{String} A WMC document string.
layerToContext: function( layer )
Create a layer context object given a wms layer object.
obj | {OpenLayers.Layer.WMS} The layer. |
{Object} A layer context object.
toContext: function( obj )
Create a context object free from layer given a map or a context object.
obj | {OpenLayers.Map | Object} The map or context. |
{Object} A context object.
Read WMC data from a string, and return an object with map properties and a list of layers.
read: function( data, options )
Get the WMC parser given a version.
getParser: function( version )
Create a WMS layer from a layerContext object.
getLayerFromContext: function( layerContext )
Create an array of WMS layers from an array of layerContext objects.
getLayersFromContext: function( layersContext )
Create a map given a context object.
contextToMap: function( context, options )
Add layers from a context object to a map.
mergeContextToMap: function( context, map )
Write a WMC document given a map.
write: function( obj, options )
Create a layer context object given a wms layer object.
layerToContext: function( layer )
Create a context object free from layer given a map or a context object.
toContext: function( obj )