[Commits] r2728 - sandbox/gxm/geoext/gxm/lib
commits at geoext.org
commits at geoext.org
Thu Jun 9 19:20:02 CEST 2011
Author: chrismayer
Date: 2011-06-09 19:20:02 +0200 (Thu, 09 Jun 2011)
New Revision: 2728
Modified:
sandbox/gxm/geoext/gxm/lib/MapPanel.js
Log:
- added functionality to refresh the internal layer store of the mapPanel if layer is added or removed from map
- TODO: refactor by adding the events to the store
Modified: sandbox/gxm/geoext/gxm/lib/MapPanel.js
===================================================================
--- sandbox/gxm/geoext/gxm/lib/MapPanel.js 2011-06-08 21:05:18 UTC (rev 2727)
+++ sandbox/gxm/geoext/gxm/lib/MapPanel.js 2011-06-09 17:20:02 UTC (rev 2728)
@@ -149,12 +149,30 @@
/** private: method[onAddlayer]
*/
onAddlayer: function() {
+
+ //CM
+ // update the layerstore by creating a new one
+ // with the current maps layers
+ //TODO: sync?
+ this.layers = new GXM.data.LayerStore({
+ data: this.map.layers
+ });
+
this.fireEvent("afterlayeradd");
},
/** private: method[onRemovelayer]
*/
onRemovelayer: function() {
+
+ //CM
+ // update the layerstore by creating a new one
+ // with the current maps layers
+ //TODO: sync?
+ this.layers = new GXM.data.LayerStore({
+ data: this.map.layers
+ });
+
this.fireEvent("afterlayerremove");
},
More information about the Commits
mailing list