addad namedLayersAsArray option to Format.SLD.v1. Patch by tschaub and
me, r=tschaub,me (closes #2005) git-svn-id: http://svn.openlayers.org/trunk/openlayers@9140 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -34,6 +34,14 @@ OpenLayers.Format.SLD = OpenLayers.Class(OpenLayers.Format.XML, {
|
||||
*/
|
||||
version: null,
|
||||
|
||||
/**
|
||||
* APIProperty: namedLayersAsArray
|
||||
* {Boolean} Generate a namedLayers array. If false, the namedLayers
|
||||
* property value will be an object keyed by layer name. Default is
|
||||
* false.
|
||||
*/
|
||||
namedLayersAsArray: false,
|
||||
|
||||
/**
|
||||
* Property: parser
|
||||
* {Object} Instance of the versioned parser. Cached for multiple read and
|
||||
@@ -87,11 +95,12 @@ OpenLayers.Format.SLD = OpenLayers.Class(OpenLayers.Format.XML, {
|
||||
*
|
||||
* Parameters:
|
||||
* data - {String | DOMElement} Data to read.
|
||||
* options - {Object} Options for the reader.
|
||||
*
|
||||
* Returns:
|
||||
* {Object} An object representing the SLD.
|
||||
*/
|
||||
read: function(data) {
|
||||
read: function(data, options) {
|
||||
if(typeof data == "string") {
|
||||
data = OpenLayers.Format.XML.prototype.read.apply(this, [data]);
|
||||
}
|
||||
@@ -113,7 +122,7 @@ OpenLayers.Format.SLD = OpenLayers.Class(OpenLayers.Format.XML, {
|
||||
}
|
||||
this.parser = new format(this.options);
|
||||
}
|
||||
var sld = this.parser.read(data);
|
||||
var sld = this.parser.read(data, options);
|
||||
return sld;
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user