Index: tools/cc-frame-viewer/src/model/layer_tree_impl.js |
diff --git a/tools/cc-frame-viewer/src/model/layer_tree_impl.js b/tools/cc-frame-viewer/src/model/layer_tree_impl.js |
index 2b66553dc689c102b8b2a8078e00d1be17691e89..e59e1bdb0d67c95a508a32587aa58bb10c29cee7 100644 |
--- a/tools/cc-frame-viewer/src/model/layer_tree_impl.js |
+++ b/tools/cc-frame-viewer/src/model/layer_tree_impl.js |
@@ -6,6 +6,7 @@ |
base.require('base.bbox2'); |
base.require('model.constants'); |
+base.require('model.layer_impl'); |
base.exportTo('ccfv.model', function() { |
@@ -14,18 +15,33 @@ base.exportTo('ccfv.model', function() { |
* |
* @constructor |
*/ |
- function LayerTreeImpl(which_tree) { |
+ function LayerTreeImpl(lthi, which_tree) { |
+ this.lthi = lthi; |
this.which_tree = which_tree; |
- this.tiles = []; |
+ this.tiles_ = []; |
+ this.allLayers = []; |
this.tileBBox_ = undefined; |
}; |
LayerTreeImpl.prototype = { |
- resetTiles: function() { |
- this.tilse = []; |
+ setTilesDirty: function() { |
+ this.tiles_ = undefined; |
this.tileBBox_ = undefined; |
}, |
+ get tiles() { |
+ if (!this.tiles_) |
+ this.tiles_ = this.lthi.getTilesForTree(this.which_tree); |
+ return this.tiles_; |
+ }, |
+ |
+ getOrCreateLayerImpl: function(layerID) { |
+ var layerHistory = this.lthi.history.getOrCreateLayerImplHistory(layerID); |
+ var layer = layerHistory.getOrCreateLayerImplForLTHI(this); |
+ this.allLayers.push(layer); |
+ return layer; |
+ }, |
+ |
get tileBBox() { |
if (!this.tileBBox_) { |
var bbox = new base.BBox2(); |