From: John Firebaugh Date: Sat, 3 Nov 2012 13:53:28 +0000 (-0600) Subject: Remove OL SimpleLayerSwitcher X-Git-Tag: live~5743^2~26 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/8435b1bf60e0b4e2de092213ad6965793c6db190 Remove OL SimpleLayerSwitcher Consensus was to use the default Leaflet layer switcher and rather than port SimpleLayerSwitcher to Leaflet. --- 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