Enhancements to the WMC parser for better contact information, SRS, and style support. p=trondmm, r=me (closes #3236)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@11871 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2011-04-04 17:15:14 +00:00
parent a7d1cc9134
commit 7a5e837c9b
7 changed files with 824 additions and 62 deletions

View File

@@ -122,7 +122,11 @@ OpenLayers.Format.Context = OpenLayers.Class({
visibility: layerContext.visibility,
maxExtent: layerContext.maxExtent,
metadata: OpenLayers.Util.applyDefaults(layerContext.metadata,
{styles: layerContext.styles}),
{styles: layerContext.styles,
formats: layerContext.formats,
"abstract": layerContext["abstract"],
dataURL: layerContext.dataURL
}),
numZoomLevels: layerContext.numZoomLevels,
units: layerContext.units,
isBaseLayer: layerContext.isBaseLayer,
@@ -135,7 +139,10 @@ OpenLayers.Format.Context = OpenLayers.Class({
layerContext.tileSize.height
) : undefined,
minScale: layerContext.minScale || layerContext.maxScaleDenominator,
maxScale: layerContext.maxScale || layerContext.minScaleDenominator
maxScale: layerContext.maxScale || layerContext.minScaleDenominator,
srs: layerContext.srs,
dimensions: layerContext.dimensions,
metadataURL: layerContext.metadataURL
};
if (this.layerOptions) {
OpenLayers.Util.applyDefaults(options, this.layerOptions);
@@ -273,10 +280,22 @@ OpenLayers.Format.Context = OpenLayers.Class({
projection: context.projection,
units: context.units
}, options);
if (options.maxExtent) {
options.maxResolution =
options.maxExtent.getWidth() / OpenLayers.Map.TILE_WIDTH;
}
var metadata = {
contactInformation: context.contactInformation,
"abstract": context["abstract"],
keywords: context.keywords,
logo: context.logo,
descriptionURL: context.descriptionURL
}
options.metadata = metadata;
var map = new OpenLayers.Map(options);
map.addLayers(this.getLayersFromContext(context.layersContext));
map.setCenter(