Read and write Web Map Context documents.
OpenLayers. | 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. | 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. |
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. |
mapToContext | Create a context object given a map. |
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. |
{OpenLayers.Map} A map based on the context.
contextToMap: function( context, id )
Create a map given a context object.
context | {Object} The context object. |
id | {String | Element} The dom element or element id that will contain the map. |
{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.
mapToContext: function( map )
Create a context object given a map.
map | {OpenLayers.Map} The map. |
{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 )
Create a map given a context object.
contextToMap: function( context, id )
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 context object given a map.
mapToContext: function( map )