diff --git a/debug/lvector-ilayer-example.html b/debug/lvector-ilayer-example.html new file mode 100644 index 0000000..0e9de09 --- /dev/null +++ b/debug/lvector-ilayer-example.html @@ -0,0 +1,78 @@ + + +
+ + + + + + + + + + + + + + + + + ++ To see example, toggle the endangered species critical habitat layer on and off. +
+ + + diff --git a/src/layer/Layer.js b/src/layer/Layer.js index d097fff..d0c959f 100644 --- a/src/layer/Layer.js +++ b/src/layer/Layer.js @@ -54,6 +54,15 @@ lvector.Layer = lvector.Class.extend({ getMap: function() { return this.options.map; }, + + onAdd: function(map) { + this.setMap(map) + }, + + onRemove: function(map) { + if (map == this.options.map) + this.setMap(null) + }, setOptions: function(o) { // TODO - Merge new options (o) with current options (this.options)