- saveBaseLayer: function(data) {
- try {
- store.set('baselayer', data.layer.layerCode);
- } catch(e) {}
- },
-
- createLayerSwitcher: function() {
- var control = new OpenLayers.Control.LayerSwitcher({roundedCorner: false});
- // XXX: we need to "live-patch" LayerSwitcher to use our icons. We use
- // a regexp instead of a string in case OpenLayers is modified and in
- // case browsers modify the function representation
- control.loadContents = eval('(function() { return (' + control.loadContents.toString().replace(
- /\s*=\s*imgLocation\s*\+\s*['"]layer-switcher-maximize\.png['"]\s*;/,
- " = 'icons/layer-switcher-maximize-flipped.png';"
- ) + ')}())');
- var oldMaximizeControl = control.maximizeControl;
- var self = this;
- control.maximizeControl = (function(oldfunc) {
- return function() {
- oldfunc.apply(control, arguments);
- self.messenger.hide();
- };
- }(control.maximizeControl));
-
- return control;
- },
-