From 8435b1bf60e0b4e2de092213ad6965793c6db190 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Sat, 3 Nov 2012 07:53:28 -0600 Subject: [PATCH] Remove OL SimpleLayerSwitcher Consensus was to use the default Leaflet layer switcher and rather than port SimpleLayerSwitcher to Leaflet. --- app/assets/openlayers/SimpleLayerSwitcher.js | 175 ------------------ .../SimpleLayerSwitcher.css.scss | 44 ----- 2 files changed, 219 deletions(-) delete mode 100644 app/assets/openlayers/SimpleLayerSwitcher.js delete mode 100644 app/assets/openlayers/theme/openstreetmap/SimpleLayerSwitcher.css.scss diff --git a/app/assets/openlayers/SimpleLayerSwitcher.js b/app/assets/openlayers/SimpleLayerSwitcher.js deleted file mode 100644 index db3c720bb..000000000 --- a/app/assets/openlayers/SimpleLayerSwitcher.js +++ /dev/null @@ -1,175 +0,0 @@ -var SimpleLayerSwitcher = OpenLayers.Class(OpenLayers.Control, { - layerStates: null, - layersDiv: null, - ascending: true, - - initialize: function(options) { - OpenLayers.Control.prototype.initialize.apply(this, arguments); - this.layerStates = []; - }, - - destroy: function() { - OpenLayers.Event.stopObservingElement(this.div); - - //clear out layers info and unregister their events - this.map.events.un({ - "addlayer": this.redraw, - "changelayer": this.redraw, - "removelayer": this.redraw, - "changebaselayer": this.redraw, - scope: this - }); - OpenLayers.Control.prototype.destroy.apply(this, arguments); - }, - - setMap: function(map) { - OpenLayers.Control.prototype.setMap.apply(this, arguments); - - this.map.events.on({ - "addlayer": this.redraw, - "changelayer": this.redraw, - "removelayer": this.redraw, - "changebaselayer": this.redraw, - scope: this - }); - }, - - draw: function() { - OpenLayers.Control.prototype.draw.apply(this); - this.loadContents(); - this.redraw(); - return this.div; - }, - - checkRedraw: function() { - var redraw = false; - if ( !this.layerStates.length || - (this.map.layers.length != this.layerStates.length) ) { - redraw = true; - } else { - for (var i=0, len=this.layerStates.length; i