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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user