[Commits] r1046 - apps/opengeo/geoexplorer/branches/0.1.x/lib
commits at geoext.org
commits at geoext.org
Thu Jun 11 22:28:01 CEST 2009
Author: tschaub
Date: 2009-06-11 22:28:00 +0200 (Thu, 11 Jun 2009)
New Revision: 1046
Modified:
apps/opengeo/geoexplorer/branches/0.1.x/lib/GeoExplorer.js
Log:
Take care to deactivate controls before removing them from the map. In addition, newly added controls need to be activated.
Modified: apps/opengeo/geoexplorer/branches/0.1.x/lib/GeoExplorer.js
===================================================================
--- apps/opengeo/geoexplorer/branches/0.1.x/lib/GeoExplorer.js 2009-06-11 18:10:24 UTC (rev 1045)
+++ apps/opengeo/geoexplorer/branches/0.1.x/lib/GeoExplorer.js 2009-06-11 20:28:00 UTC (rev 1046)
@@ -645,10 +645,11 @@
});
var map = this.mapPanel.map;
- var gx = this;
-
+ var control;
for (var i = 0, len = info.controls.length; i < len; i++){
- map.removeControl(info.controls[i]);
+ control = info.controls[i];
+ control.deactivate(); // TODO: remove when http://trac.openlayers.org/ticket/2130 is closed
+ control.destroy();
}
info.controls = [];
@@ -659,14 +660,17 @@
layers: [x.get("layer")],
eventListeners: {
getfeatureinfo: function(evt) {
- gx.displayPopup(evt, x.get("title"));
+ this.displayPopup(evt, x.get("title") || x.get("name"));
},
- scope: gx
+ scope: this
}
});
map.addControl(control);
info.controls.push(control);
- });
+ if(infoButton.pressed) {
+ control.activate();
+ }
+ }, this);
};
this.mapPanel.layers.on("update", updateInfo, this);
More information about the Commits
mailing list