Ticket #2251 (closed feature: fixed)
Update WMC format to support params that are not OL Layer properties
| Reported by: | bbinet | Owned by: | tschaub |
|---|---|---|---|
| Priority: | minor | Milestone: | 2.9 Release |
| Component: | Format.WMC | Version: | 2.8 |
| Keywords: | Cc: | ||
| State: | Complete |
Description
The WMC specification is supporting some params that are not stored in an OpenLayers.Layer object. For example I had to build a WMC to save also the list of styles and formats supported by a WMS layer, but the OpenLayers WMC format does not currently handle these informations.
The attached patch is trying to address this missing feature. (still needs more work, tests)
Here is a small explanation of the patch :
WMC format is now working with a "context": it can generate a WMC given a context, or generate a context given a WMC. A context is javascript object designed to store all params that the WMC specs describes, not only those supported by an OpenLayers layer. So if we fill the context object with styles and formats informations, then they will be stored in the wmc.
The patch is preserving the api compatibility by being able to generate a WMC given a OpenLayers.Map and to generate a OpenLayers.Map given an WMC (in WMS.js, functions are now dedicated to translate OpenLayers map/layers into a context object and vice versa).

