add support for the ol:tileSize layer property in WMC, p=fvanderbiest,r=me (Closes #2740)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10491 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -231,6 +231,14 @@ OpenLayers.Format.WMC.v1 = OpenLayers.Class(OpenLayers.Format.XML, {
|
||||
layerContext.singleTile = (this.getChildValue(node) == "true");
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: read_ol_tileSize
|
||||
*/
|
||||
read_ol_tileSize: function(layerContext, node) {
|
||||
var obj = {"width": node.getAttribute("width"), "height": node.getAttribute("height")};
|
||||
layerContext.tileSize = obj;
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: read_ol_isBaseLayer
|
||||
*/
|
||||
@@ -618,6 +626,14 @@ OpenLayers.Format.WMC.v1 = OpenLayers.Class(OpenLayers.Format.XML, {
|
||||
});
|
||||
node.appendChild(maxExtent);
|
||||
|
||||
if (context.tileSize && !context.singleTile) {
|
||||
var size = this.createElementNS(
|
||||
this.namespaces.ol, "ol:tileSize"
|
||||
);
|
||||
this.setAttributes(size, context.tileSize);
|
||||
node.appendChild(size);
|
||||
}
|
||||
|
||||
var properties = [
|
||||
"transparent", "numZoomLevels", "units", "isBaseLayer",
|
||||
"opacity", "displayInLayerSwitcher", "singleTile"
|
||||
|
||||
Reference in New Issue
Block a user