Merge pull request #149 from mapbox/layer-status

Add ability to enable/disable layers
This commit is contained in:
Tom MacWright 2012-06-25 09:51:10 -07:00
commit 6132d82359

View File

@ -2,6 +2,7 @@
tree.Layer = function Layer(obj) { tree.Layer = function Layer(obj) {
this.name = obj.name; this.name = obj.name;
this.status = obj.status;
this.styles = obj.styles; this.styles = obj.styles;
this.properties = obj.properties || {}; this.properties = obj.properties || {};
this.srs = obj.srs; this.srs = obj.srs;
@ -23,6 +24,7 @@ tree.Layer.prototype.toXML = function() {
return '<Layer' + return '<Layer' +
' name="' + this.name + '"\n' + ' name="' + this.name + '"\n' +
prop_string + prop_string +
' status="' + this.status + '"\n' +
' srs="' + this.srs + '">\n ' + ' srs="' + this.srs + '">\n ' +
this.styles.reverse().map(function(s) { this.styles.reverse().map(function(s) {
return '<StyleName>' + s + '</StyleName>'; return '<StyleName>' + s + '</StyleName>';