Rename attributes to properties.

This commit is contained in:
Will White 2011-09-06 12:49:50 -04:00
parent 80b88d4ba8
commit db733702e9
4 changed files with 7 additions and 7 deletions

View File

@ -3,7 +3,7 @@
tree.Layer = function Layer(obj) {
this.name = obj.name;
this.styles = obj.styles;
this.attributes = obj.attributes || {};
this.properties = obj.properties || {};
this.srs = obj.srs;
this.datasource = obj.Datasource;
};
@ -15,14 +15,14 @@ tree.Layer.prototype.toXML = function() {
this.datasource[i] + ']]></Parameter>');
}
var attr_string = '';
for (var i in this.attributes) {
attr_string += ' ' + i + '="' + this.attributes[i] + '"\n';
var prop_string = '';
for (var i in this.properties) {
prop_string += ' ' + i + '="' + this.properties[i] + '"\n';
}
return '<Layer' +
' name="' + this.name + '"\n' +
attr_string +
prop_string +
' srs="' + this.srs + '">\n ' +
this.styles.reverse().map(function(s) {
return '<StyleName>' + s + '</StyleName>';

View File

@ -1,12 +1,12 @@
{
"srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over",
"Stylesheet": [
"layer_attributes.mss"
"layer_properties.mss"
],
"Layer": [{
"name": "world",
"srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over",
"attributes": {
"properties": {
"cache-features": "true"
},
"Datasource": {