Skip to content

Commit

Permalink
fixes issue where show page map would error, adds IIIF test, and pend…
Browse files Browse the repository at this point in the history
…ing for bug
  • Loading branch information
mejackreed committed Dec 10, 2014
1 parent f456f23 commit 873b003
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 2 deletions.
3 changes: 3 additions & 0 deletions app/assets/javascripts/geoblacklight/viewers/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ GeoBlacklight.Viewer.Map = GeoBlacklight.Viewer.extend({
overlay: L.layerGroup(),

load: function() {
if (this.data.mapBbox) {
this.options.bbox = L.bboxToBounds(this.data.mapBbox);
}
this.map = L.map(this.element).fitBounds(this.options.bbox);
this.map.addLayer(this.basemap);
this.map.addLayer(this.overlay);
Expand Down
2 changes: 1 addition & 1 deletion lib/geoblacklight/item_viewer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def initialize(references)
end

def viewer_protocol
return 'leaflet' if viewer_preference.nil?
return 'map' if viewer_preference.nil?
viewer_preference.keys.first.to_s
end

Expand Down
8 changes: 8 additions & 0 deletions spec/features/iiif_viewer_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require 'spec_helper'

feature 'iiif reference' do
scenario 'displays leaflet viewer', js: true do
visit catalog_path('princeton-02870w62c')
expect(page).to have_css '.leaflet-control-zoom', visible: true
end
end
8 changes: 8 additions & 0 deletions spec/features/layer_with_no_references_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require 'spec_helper'

feature 'layer with no wms or iiif' do
scenario 'has map with bounding box' do
pending 'waiting on #201, need example metadata record'
fail
end
end
2 changes: 1 addition & 1 deletion spec/lib/geoblacklight/solr_document_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
end
let(:document_attributes) { {} }
it 'returns leaflet protocol' do
expect(document.viewer_protocol).to eq 'leaflet'
expect(document.viewer_protocol).to eq 'map'
end
end
describe 'viewer_endpoint' do
Expand Down

0 comments on commit 873b003

Please sign in to comment.