//= require geoblacklight/viewers/map GeoBlacklight.Viewer.Wms = GeoBlacklight.Viewer.Map.extend({ load: function() { this.options.bbox = L.geoJSONToBounds(this.data.mapGeom); 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.loadControls(); } else { this.addBoundsOverlay(this.options.bbox); } }, addPreviewLayer: function() { var _this = this; var wmsLayer = L.tileLayer.wms(this.data.url, { layers: this.data.layerId, format: 'image/png', transparent: true, tiled: true, CRS: 'EPSG:3857', opacity: this.options.opacity, detectRetina: _this.detectRetina() }); this.overlay.addLayer(wmsLayer); this.setupInspection(); }, setupInspection: function() { var _this = this; this.map.on('click', function(e) { spinner = '