//= require geoblacklight/viewers/map GeoBlacklight.Viewer.Wms = GeoBlacklight.Viewer.Map.extend({ load: function() { this.options.bbox = L.bboxToBounds(this.data.mapBbox); this.map = L.map(this.element).fitBounds(this.options.bbox); this.map.addLayer(this.selectBasemap()); this.map.addLayer(this.overlay); if (this.data.available) { this.addPreviewLayer(); this.addOpacityControl(); } else { this.addBoundsOverlay(this.options.bbox); } }, addPreviewLayer: function() { var wmsLayer = L.tileLayer.wms(this.data.url, { layers: this.data.layerId, format: 'image/png', transparent: true, tiled: true, CRS: 'EPSG:900913', opacity: 0.75 }); this.overlay.addLayer(wmsLayer); this.setupInspection(); }, addOpacityControl: function() { this.map.addControl(new L.Control.LayerOpacity(this.overlay)); }, setupInspection: function() { var _this = this; this.map.on('click', function(e) { spinner = '