geoblacklight 4.0.0.pre.alpha.1 → 4.0.0.pre.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE.md +1 -1
- data/.github/workflows/ruby.yml +32 -64
- data/.gitignore +1 -0
- data/.rubocop.yml +6 -6
- data/.rubocop_todo.yml +0 -3
- data/.solr_wrapper +1 -0
- data/README.md +1 -4
- data/Rakefile +0 -1
- data/app/assets/images/blacklight/child-item.svg +3 -0
- data/app/assets/images/blacklight/collections.svg +4 -0
- data/app/assets/images/blacklight/datasets.svg +7 -0
- data/app/assets/images/blacklight/geoblacklight-icons.json +363 -332
- data/app/assets/images/blacklight/imagery.svg +4 -0
- data/app/assets/images/blacklight/maps.svg +4 -0
- data/app/assets/images/blacklight/michigan-state-university.svg +0 -1
- data/app/assets/images/blacklight/parent-item.svg +3 -0
- data/app/assets/images/blacklight/pennsylvania-state-university.svg +0 -1
- data/app/assets/images/blacklight/purdue-university.svg +0 -1
- data/app/assets/images/blacklight/the-ohio-state-university.svg +0 -1
- data/app/assets/images/blacklight/university-of-chicago.svg +0 -1
- data/app/assets/images/blacklight/university-of-colorado-boulder.svg +6 -0
- data/app/assets/images/blacklight/university-of-illinois-urbana-champaign.svg +0 -1
- data/app/assets/images/blacklight/university-of-iowa.svg +0 -1
- data/app/assets/images/blacklight/university-of-maryland.svg +0 -1
- data/app/assets/images/blacklight/university-of-michigan.svg +0 -1
- data/app/assets/images/blacklight/university-of-minnesota.svg +0 -1
- data/app/assets/images/blacklight/university-of-nebraska-lincoln.svg +0 -1
- data/app/assets/images/blacklight/university-of-wisconsin-madison.svg +0 -1
- data/app/assets/images/blacklight/websites.svg +4 -0
- data/app/assets/javascripts/geoblacklight/controls/fullscreen.js +8 -0
- data/app/assets/javascripts/geoblacklight/geoblacklight.js +2 -1
- data/app/assets/javascripts/geoblacklight/viewers/esri.js +1 -0
- data/app/assets/javascripts/geoblacklight/viewers/index_map.js +1 -0
- data/app/assets/javascripts/geoblacklight/viewers/tilejson.js +33 -0
- data/app/assets/javascripts/geoblacklight/viewers/tms.js +2 -2
- data/app/assets/javascripts/geoblacklight/viewers/viewer.js +3 -0
- data/app/assets/javascripts/geoblacklight/viewers/wms.js +2 -2
- data/app/assets/javascripts/geoblacklight/viewers/wmts.js +85 -0
- data/app/assets/javascripts/geoblacklight/viewers/xyz.js +10 -0
- data/app/assets/stylesheets/geoblacklight/geoblacklight.scss +1 -0
- data/app/assets/stylesheets/geoblacklight/modules/_base.scss +0 -1
- data/app/assets/stylesheets/geoblacklight/modules/_styles.scss +5 -1
- data/app/assets/stylesheets/geoblacklight/modules/downloads.scss +20 -47
- data/app/assets/stylesheets/geoblacklight/modules/index_maps.scss +68 -0
- data/app/assets/stylesheets/geoblacklight/modules/item.scss +16 -0
- data/app/assets/stylesheets/geoblacklight/modules/modal.scss +6 -0
- data/app/assets/stylesheets/geoblacklight/modules/sidebar.scss +4 -0
- data/app/components/geoblacklight/icon_facet_item_component.rb +33 -0
- data/app/helpers/geoblacklight_helper.rb +6 -45
- data/app/models/concerns/geoblacklight/bbox_filter_field.rb +45 -0
- data/app/models/concerns/geoblacklight/bbox_filter_query.rb +50 -0
- data/app/models/concerns/geoblacklight/solr_document.rb +1 -1
- data/app/models/concerns/geoblacklight/suppressed_records_search_behavior.rb +26 -0
- data/app/presenters/geoblacklight/bbox_item_presenter.rb +9 -0
- data/app/views/catalog/_downloads_collapse.html.erb +27 -0
- data/app/views/catalog/_header_icons.html.erb +2 -2
- data/app/views/catalog/_index_split_default.html.erb +2 -2
- data/app/views/catalog/_show_default_viewer_container.html.erb +17 -0
- data/app/views/catalog/_show_downloads.html.erb +10 -21
- data/app/views/catalog/_show_sidebar.html.erb +3 -0
- data/app/views/catalog/_show_web_services.html.erb +11 -0
- data/app/views/catalog/_web_services.html.erb +3 -2
- data/app/views/catalog/web_services.html.erb +1 -1
- data/app/views/relation/_relations.html.erb +1 -1
- data/app/views/relation/index.html.erb +1 -1
- data/config/locales/geoblacklight.en.yml +4 -1
- data/geoblacklight.gemspec +6 -6
- data/lib/generators/geoblacklight/install_generator.rb +1 -1
- data/lib/generators/geoblacklight/templates/assets/_customizations.scss +5 -4
- data/lib/generators/geoblacklight/templates/assets/application.scss +0 -3
- data/lib/generators/geoblacklight/templates/catalog_controller.rb +74 -56
- data/lib/generators/geoblacklight/templates/settings.gbl_v1.yml +5 -5
- data/lib/generators/geoblacklight/templates/settings.yml +36 -23
- data/lib/geoblacklight/bounding_box.rb +4 -0
- data/lib/geoblacklight/constants.rb +3 -0
- data/lib/geoblacklight/engine.rb +3 -2
- data/lib/geoblacklight/faraday_middleware/follow_redirects.rb +176 -0
- data/lib/geoblacklight/item_viewer.rb +13 -1
- data/lib/geoblacklight/metadata/base.rb +2 -1
- data/lib/geoblacklight/version.rb +1 -1
- data/lib/geoblacklight/view_helper_override.rb +2 -28
- data/lib/geoblacklight.rb +0 -10
- data/lib/tasks/geoblacklight.rake +1 -1
- data/schema/geoblacklight-schema-aardvark.json +3 -23
- data/solr/conf/schema.xml +37 -43
- data/solr/conf/solrconfig.xml +17 -17
- data/spec/components/geoblacklight/icon_facet_item_component_spec.rb +17 -0
- data/spec/controllers/catalog_controller_spec.rb +1 -1
- data/spec/features/download_layer_spec.rb +31 -14
- data/spec/features/esri_viewer_spec.rb +5 -1
- data/spec/features/full_screen_controll_spec.rb +15 -0
- data/spec/features/home_page_spec.rb +2 -2
- data/spec/features/index_map_spec.rb +2 -2
- data/spec/features/missing_metadata_spec.rb +1 -1
- data/spec/features/multiple_downloads_spec.rb +2 -1
- data/spec/features/relations_spec.rb +1 -1
- data/spec/features/saved_searches_spec.rb +1 -1
- data/spec/features/search_results_complex_geometry_spec.rb +24 -0
- data/spec/features/search_results_icons_spec.rb +16 -0
- data/spec/features/search_results_map_spec.rb +2 -2
- data/spec/features/search_spec.rb +22 -0
- data/spec/features/show_page_download_spec.rb +29 -0
- data/spec/features/show_page_metadata_spec.rb +2 -2
- data/spec/features/split_view.html.erb_spec.rb +12 -1
- data/spec/features/tilejson_spec.rb +22 -0
- data/spec/features/tms_spec.rb +2 -2
- data/spec/features/web_services_modal_spec.rb +35 -2
- data/spec/features/wmts_spec.rb +34 -0
- data/spec/features/xyz_spec.rb +10 -0
- data/spec/fixtures/manifests/tilejson.json +21 -0
- data/spec/fixtures/manifests/wmts-multiple.xml +813 -0
- data/spec/fixtures/manifests/wmts-single.xml +126 -0
- data/spec/fixtures/solr_documents/README.md +46 -43
- data/spec/fixtures/solr_documents/actual-papermap1.json +2 -1
- data/spec/fixtures/solr_documents/actual-point1.json +2 -1
- data/spec/fixtures/solr_documents/actual-polygon1.json +2 -1
- data/spec/fixtures/solr_documents/actual-raster1.json +3 -2
- data/spec/fixtures/solr_documents/baruch_ancestor1.json +2 -1
- data/spec/fixtures/solr_documents/baruch_ancestor2.json +2 -1
- data/spec/fixtures/solr_documents/baruch_documentation_download.json +1 -1
- data/spec/fixtures/solr_documents/bbox-spans-180.json +2 -1
- data/spec/fixtures/solr_documents/cornell_html_metadata.json +4 -3
- data/spec/fixtures/solr_documents/esri-dynamic-layer-all-layers.json +3 -2
- data/spec/fixtures/solr_documents/esri-dynamic-layer-single-layer.json +3 -2
- data/spec/fixtures/solr_documents/esri-feature-layer.json +2 -1
- data/spec/fixtures/solr_documents/esri-image-map-layer.json +3 -2
- data/spec/fixtures/solr_documents/esri-tiled_map_layer.json +2 -1
- data/spec/fixtures/solr_documents/esri-wms-layer.json +2 -1
- data/spec/fixtures/solr_documents/harvard_raster.json +3 -2
- data/spec/fixtures/solr_documents/iiif-eastern-hemisphere.json +3 -2
- data/spec/fixtures/solr_documents/index-map-polygon-no-downloadurl.json +2 -1
- data/spec/fixtures/solr_documents/index-map-polygon.json +2 -1
- data/spec/fixtures/solr_documents/index-map-stanford.json +2 -1
- data/spec/fixtures/solr_documents/index_map_point.json +3 -2
- data/spec/fixtures/solr_documents/metadata_no_provider.json +2 -1
- data/spec/fixtures/solr_documents/multiple-downloads.json +3 -2
- data/spec/fixtures/solr_documents/no_spatial.json +1 -4
- data/spec/fixtures/solr_documents/oembed.json +2 -1
- data/spec/fixtures/solr_documents/princeton-child1.json +3 -2
- data/spec/fixtures/solr_documents/princeton-child2.json +3 -2
- data/spec/fixtures/solr_documents/princeton-child3.json +2 -1
- data/spec/fixtures/solr_documents/princeton-child4.json +3 -2
- data/spec/fixtures/solr_documents/princeton-parent.json +5 -3
- data/spec/fixtures/solr_documents/public_direct_download.json +2 -1
- data/spec/fixtures/solr_documents/public_iiif_princeton.json +3 -2
- data/spec/fixtures/solr_documents/public_polygon_mit.json +2 -1
- data/spec/fixtures/solr_documents/restricted-line.json +2 -1
- data/spec/fixtures/solr_documents/tilejson.json +48 -0
- data/spec/fixtures/solr_documents/tms.json +15 -18
- data/spec/fixtures/solr_documents/umn_metro_result1.json +5 -3
- data/spec/fixtures/solr_documents/umn_state_result1.json +3 -2
- data/spec/fixtures/solr_documents/umn_state_result2.json +3 -5
- data/spec/fixtures/solr_documents/uva_slug_colon.json +2 -1
- data/spec/fixtures/solr_documents/wmts-multiple.json +41 -0
- data/spec/fixtures/solr_documents/wmts-single-layer.json +48 -0
- data/spec/fixtures/solr_documents/xyz.json +46 -0
- data/spec/helpers/geoblacklight_helper_spec.rb +12 -35
- data/spec/lib/geoblacklight/document_presenter_spec.rb +3 -3
- data/spec/lib/geoblacklight/download/geojson_download_spec.rb +1 -1
- data/spec/lib/geoblacklight/download/geotiff_download_spec.rb +1 -1
- data/spec/lib/geoblacklight/download/kmz_download_spec.rb +1 -1
- data/spec/lib/geoblacklight/download/shapefile_download_spec.rb +1 -1
- data/spec/lib/geoblacklight/download_spec.rb +2 -2
- data/spec/lib/geoblacklight/metadata/base_spec.rb +19 -1
- data/spec/lib/geoblacklight/references_spec.rb +1 -1
- data/spec/lib/geoblacklight/relation/relation_response_spec.rb +5 -0
- data/spec/lib/geoblacklight/view_helper_override_spec.rb +0 -10
- data/spec/models/concerns/geoblacklight/bbox_filter_field_spec.rb +77 -0
- data/spec/models/concerns/geoblacklight/bbox_filter_query_spec.rb +105 -0
- data/spec/models/concerns/geoblacklight/solr_document/inspection_spec.rb +2 -1
- data/spec/models/concerns/geoblacklight/suppressed_records_search_behavior_spec.rb +31 -0
- data/spec/presenters/geoblacklight/bbox_item_presenter_spec.rb +36 -0
- data/spec/spec_helper.rb +6 -1
- data/spec/test_app_templates/Gemfile.extra +1 -0
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +4 -4
- data/spec/views/catalog/_show_downloads.html.erb_spec.rb +5 -5
- data/template.rb +2 -4
- data/vendor/assets/images/fullscreen.png +0 -0
- data/vendor/assets/images/fullscreen@2x.png +0 -0
- data/vendor/assets/javascripts/Leaflet.fullscreen.js +152 -0
- data/vendor/assets/javascripts/esri-leaflet.js +10 -3
- data/vendor/assets/javascripts/esri-leaflet.js.map +1 -1
- data/vendor/assets/javascripts/leaflet-iiif.js +39 -18
- data/vendor/assets/javascripts/leaflet-src.js.erb +14062 -0
- data/vendor/assets/javascripts/leaflet-src.js.map +1 -1
- data/vendor/assets/stylesheets/leaflet.css +640 -634
- data/vendor/assets/stylesheets/leaflet.fullscreen.css +40 -0
- metadata +91 -46
- data/app/models/concerns/geoblacklight/spatial_search_behavior.rb +0 -71
- data/app/views/catalog/_download_generated_link.html.erb +0 -4
- data/app/views/catalog/_download_link.html.erb +0 -3
- data/app/views/catalog/_downloads_generated.html.erb +0 -6
- data/app/views/catalog/_downloads_primary.html.erb +0 -21
- data/app/views/catalog/_downloads_secondary.html.erb +0 -39
- data/app/views/catalog/_icon_facet.html.erb +0 -16
- data/bin/coverage.rb +0 -36
- data/lib/generators/geoblacklight/templates/Procfile +0 -3
- data/lib/generators/geoblacklight/templates/package.json +0 -14
- data/lib/generators/geoblacklight/templates/webpacker.yml +0 -67
- data/lib/generators/geoblacklight/webpacker_generator.rb +0 -36
- data/lib/geoblacklight/catalog_helper_override.rb +0 -14
- data/spec/models/concerns/geoblacklight/spatial_search_behavior_spec.rb +0 -97
- data/vendor/assets/javascripts/leaflet.js.erb +0 -13922
- data/vendor/assets/stylesheets/leaflet-label.css +0 -54
@@ -6,8 +6,8 @@ feature 'search results map', js: true do
|
|
6
6
|
visit search_catalog_path(q: 'Minnesota')
|
7
7
|
expect(page).to have_css '#map'
|
8
8
|
end
|
9
|
-
|
10
|
-
pending 'Minnesota fixtures have changed.'
|
9
|
+
xscenario 'view is scoped to Minnesota' do
|
10
|
+
# pending 'Minnesota fixtures have changed.'
|
11
11
|
visit root_path
|
12
12
|
click_link 'Minnesota, United States'
|
13
13
|
expect(page).to have_css '#map'
|
@@ -9,7 +9,29 @@ feature 'Search' do
|
|
9
9
|
|
10
10
|
scenario 'When searching child records from a parent record, supressed records are not hidden', js: true do
|
11
11
|
visit '/catalog/princeton-1r66j405w'
|
12
|
+
|
13
|
+
within('.card.relations.relationship-source_descendants') do
|
14
|
+
expect(page).to have_link(href: /f%5Bdct_source_sm%5D/)
|
15
|
+
end
|
16
|
+
|
12
17
|
click_link 'Browse all 4 records...'
|
13
18
|
expect(page).to have_css '.document', count: 4
|
14
19
|
end
|
20
|
+
|
21
|
+
scenario 'When sorting by year desc, highest value sorts first' do
|
22
|
+
visit '/?f%5Bschema_provider_s%5D%5B%5D=University+of+Minnesota&sort=gbl_indexYear_im+desc%2C+dct_title_sort+asc'
|
23
|
+
|
24
|
+
first_doc = find('.document', match: :first)
|
25
|
+
|
26
|
+
# Doc with gbl_indexYear_im value: [2014, 2030]
|
27
|
+
expect(first_doc['data-document-id']).to eq('02236876-9c21-42f6-9870-d2562da8e44f')
|
28
|
+
end
|
29
|
+
|
30
|
+
scenario 'When sorting by year, missing values sort last' do
|
31
|
+
visit '/?f%5Bschema_provider_s%5D%5B%5D=University+of+Minnesota&sort=gbl_indexYear_im+desc%2C+dct_title_sort+asc'
|
32
|
+
last_doc = find_all('.document').last
|
33
|
+
|
34
|
+
# Doc without gbl_indexYear_im value
|
35
|
+
expect(last_doc['data-document-id']).to eq('05d-03-nogeomtype')
|
36
|
+
end
|
15
37
|
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
feature 'Download display on show page' do
|
5
|
+
scenario 'with download String' do
|
6
|
+
visit solr_document_path '2eddde2f-c222-41ca-bd07-2fd74a21f4de'
|
7
|
+
find('#downloads-button').click
|
8
|
+
within '#downloads-collapse' do
|
9
|
+
expect(page).to have_selector(:css, 'a[href="ftp://gdrs.dnr.state.mn.us/gdrs/data/pub/us_mn_state_dnr/fgdb_base_usgs_scanned_topo_100k_drg.zip"]')
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
scenario 'with download Array' do
|
14
|
+
visit solr_document_path 'princeton-sx61dn82p'
|
15
|
+
find('#downloads-button').click
|
16
|
+
within '#downloads-collapse' do
|
17
|
+
expect(page).to have_selector(:css, 'a[href="https://figgy.princeton.edu/downloads/a990e1b4-7f0e-44b8-ae2a-de7e93cdd74a/file/36a2274c-e0c6-4901-a14f-7c422d15e194"]')
|
18
|
+
expect(page).to have_selector(:css, 'a[href="https://libimages1.princeton.edu/loris/figgy_prod/2e%2Fa9%2F43%2F2ea943b0bd4348fc9954b299f1b359f6%2Fintermediate_file.jp2/full/full/0/default.jpg"]')
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
scenario 'with Harvard hgl_download' do
|
23
|
+
visit solr_document_path 'harvard-g7064-s2-1834-k3'
|
24
|
+
find('#downloads-button').click
|
25
|
+
within '#downloads-collapse' do
|
26
|
+
expect(page).to have_selector(:css, 'a[href="/download/hgl/harvard-g7064-s2-1834-k3"][data-download-type="harvard-hgl"]')
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -5,8 +5,8 @@ feature 'Metadata display on show page' do
|
|
5
5
|
scenario 'with default CatalogController specified fields' do
|
6
6
|
visit solr_document_path 'stanford-dp018hs9766'
|
7
7
|
within '.document-metadata' do
|
8
|
-
expect(page).to have_css 'dt', count:
|
9
|
-
expect(page).to have_css 'dd', count:
|
8
|
+
expect(page).to have_css 'dt', count: 16
|
9
|
+
expect(page).to have_css 'dd', count: 16
|
10
10
|
expect(page).to have_css 'div.truncate-abstract', count: 1
|
11
11
|
end
|
12
12
|
end
|
@@ -40,7 +40,7 @@ feature 'Index view', js: true do
|
|
40
40
|
expect(page).to have_css('a.facet-select', text: 'University of Minnesota', visible: true)
|
41
41
|
expect(page).to have_css('a.facet-select', text: 'MIT', visible: true)
|
42
42
|
expect(page).to have_css('a.facet-select', text: 'Stanford', visible: true)
|
43
|
-
expect(page).to have_css('a
|
43
|
+
expect(page).to have_css('.more_facets a', text: /more\sProvider\s»/, visible: true)
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
@@ -77,4 +77,15 @@ feature 'Index view', js: true do
|
|
77
77
|
expect(page).to have_css 'span.filter-name', text: 'Bounding Box'
|
78
78
|
end
|
79
79
|
end
|
80
|
+
|
81
|
+
scenario 'should have schema.org props listed' do
|
82
|
+
visit search_catalog_path(f: { Settings.FIELDS.PROVIDER => ['Stanford'] })
|
83
|
+
within('.documentHeader', match: :first) do
|
84
|
+
expect(page).to have_css("a[itemprop='name']")
|
85
|
+
find('.caret-toggle').click
|
86
|
+
end
|
87
|
+
within('.more-info-area', match: :first) do
|
88
|
+
expect(page).to have_css("small[itemprop='description']")
|
89
|
+
end
|
90
|
+
end
|
80
91
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
feature 'tilejson layer' do
|
5
|
+
before do
|
6
|
+
WebMock.disable_net_connect!(allow_localhost: true, allow: 'chromedriver.storage.googleapis.com')
|
7
|
+
end
|
8
|
+
|
9
|
+
after do
|
10
|
+
WebMock.allow_net_connect!
|
11
|
+
end
|
12
|
+
|
13
|
+
scenario 'displays tilejson layer', js: true do
|
14
|
+
# Mock tilejson manifest url
|
15
|
+
stub_request(:get, 'https://map-tiles-staging.princeton.edu/mosaicjson/tilejson.json?id=2a91d82c541c426cb787cc62afe8f248')
|
16
|
+
.to_return(status: 200, body: read_fixture('manifests/tilejson.json'))
|
17
|
+
|
18
|
+
visit solr_document_path('princeton-fk4544658v-tilejson')
|
19
|
+
expect(page).to have_css '.leaflet-control-zoom', visible: :visible
|
20
|
+
expect(page).to have_css "img[src*='https://map-tiles-staging.princeton.edu/mosaicjson/tiles/WebMercatorQuad']"
|
21
|
+
end
|
22
|
+
end
|
data/spec/features/tms_spec.rb
CHANGED
@@ -3,8 +3,8 @@ require 'spec_helper'
|
|
3
3
|
|
4
4
|
feature 'tms layer' do
|
5
5
|
scenario 'displays tms layer', js: true do
|
6
|
-
visit solr_document_path('
|
6
|
+
visit solr_document_path('cugir-007957')
|
7
7
|
expect(page).to have_css '.leaflet-control-zoom', visible: true
|
8
|
-
expect(page).to have_css "img[src*='
|
8
|
+
expect(page).to have_css "img[src*='cugir.library.cornell.edu']"
|
9
9
|
end
|
10
10
|
end
|
@@ -5,7 +5,7 @@ feature 'web services tools' do
|
|
5
5
|
feature 'when wms/wfs are provided', js: true do
|
6
6
|
scenario 'shows up in tools' do
|
7
7
|
visit solr_document_path 'stanford-cg357zz0321'
|
8
|
-
expect(page).to have_css '
|
8
|
+
expect(page).to have_css 'div.web-services-sidebar a', text: 'Web services'
|
9
9
|
click_link 'Web services'
|
10
10
|
within '.modal-body' do
|
11
11
|
expect(page).to have_css 'input', count: 4
|
@@ -20,7 +20,40 @@ feature 'web services tools' do
|
|
20
20
|
feature 'no wms or wfs provided' do
|
21
21
|
scenario 'does not show up in tools' do
|
22
22
|
visit solr_document_path 'mit-001145244'
|
23
|
-
expect(page).not_to have_css '
|
23
|
+
expect(page).not_to have_css 'div.web-services-sidebar a', text: 'Web services'
|
24
|
+
end
|
25
|
+
end
|
26
|
+
feature 'when xyz tile reference is provided', js: true do
|
27
|
+
scenario 'shows up in tools' do
|
28
|
+
visit solr_document_path '6f47b103-9955-4bbe-a364-387039623106-xyz'
|
29
|
+
expect(page).to have_css 'div.web-services-sidebar a', text: 'Web services'
|
30
|
+
click_link 'Web services'
|
31
|
+
within '.modal-body' do
|
32
|
+
expect(page).to have_css 'label', text: 'XYZ Tiles'
|
33
|
+
expect(page).to have_css 'input[value="https://earthquake.usgs.gov/basemap/tiles/faults/{z}/{x}/{y}.png"]'
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
feature 'when wmts tile reference is provided', js: true do
|
38
|
+
scenario 'shows up in tools' do
|
39
|
+
visit solr_document_path 'princeton-fk4544658v-wmts'
|
40
|
+
expect(page).to have_css 'div.web-services-sidebar a', text: 'Web services'
|
41
|
+
click_link 'Web services'
|
42
|
+
within '.modal-body' do
|
43
|
+
expect(page).to have_css 'label', text: 'Web Map Tile Service'
|
44
|
+
expect(page).to have_css 'input[value="https://map-tiles-staging.princeton.edu/mosaicjson/WMTSCapabilities.xml?id=2a91d82c541c426cb787cc62afe8f248"]'
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
feature 'when tilejson reference is provided', js: true do
|
49
|
+
scenario 'shows up in tools' do
|
50
|
+
visit solr_document_path 'princeton-fk4544658v-tilejson'
|
51
|
+
expect(page).to have_css 'div.web-services-sidebar a', text: 'Web services'
|
52
|
+
click_link 'Web services'
|
53
|
+
within '.modal-body' do
|
54
|
+
expect(page).to have_css 'label', text: 'TileJSON Document'
|
55
|
+
expect(page).to have_css 'input[value="https://map-tiles-staging.princeton.edu/mosaicjson/tilejson.json?id=2a91d82c541c426cb787cc62afe8f248"]'
|
56
|
+
end
|
24
57
|
end
|
25
58
|
end
|
26
59
|
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
feature 'wmts layer' do
|
5
|
+
before do
|
6
|
+
WebMock.disable_net_connect!(allow_localhost: true, allow: 'chromedriver.storage.googleapis.com')
|
7
|
+
end
|
8
|
+
|
9
|
+
after do
|
10
|
+
WebMock.allow_net_connect!
|
11
|
+
end
|
12
|
+
|
13
|
+
context 'when referencing a WMTSCapabilities document with a single layer' do
|
14
|
+
scenario 'displays the layer', js: true do
|
15
|
+
# Mock wmts manifest url
|
16
|
+
stub_request(:get, 'https://map-tiles-staging.princeton.edu/mosaicjson/WMTSCapabilities.xml?id=2a91d82c541c426cb787cc62afe8f248')
|
17
|
+
.to_return(status: 200, body: read_fixture('manifests/wmts-single.xml'))
|
18
|
+
|
19
|
+
visit solr_document_path('princeton-fk4544658v-wmts')
|
20
|
+
expect(page).to have_css '.leaflet-control-zoom', visible: :visible
|
21
|
+
expect(page).to have_css "img[src*='map-tiles-staging.princeton.edu/mosaicjson/tiles/WebMercatorQuad']"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
context 'when referencing a WMTSCapabilities document with a multiple layers' do
|
25
|
+
scenario 'displays the layer referenced in the layer_id field', js: true do
|
26
|
+
# Mock wmts manifest url
|
27
|
+
stub_request(:get, 'https://maps.wien.gv.at/wmts/1.0.0/WMTSCapabilities.xml')
|
28
|
+
.to_return(status: 200, body: read_fixture('manifests/wmts-multiple.xml'))
|
29
|
+
visit solr_document_path('princeton-fk4db9hn29')
|
30
|
+
expect(page).to have_css '.leaflet-control-zoom', visible: :visible
|
31
|
+
expect(page).to have_css "img[src*='http://maps1.wien.gv.at/wmts/lb2016/farbe/google3857']"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
feature 'xyz layer' do
|
5
|
+
scenario 'displays tms layer', js: true do
|
6
|
+
visit solr_document_path('6f47b103-9955-4bbe-a364-387039623106-xyz')
|
7
|
+
expect(page).to have_css '.leaflet-control-zoom', visible: :visible
|
8
|
+
expect(page).to have_css "img[src*='earthquake.usgs.gov']"
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
{
|
2
|
+
"tilejson": "2.2.0",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"scheme": "xyz",
|
5
|
+
"tiles": [
|
6
|
+
"https://map-tiles-staging.princeton.edu/mosaicjson/tiles/WebMercatorQuad/{z}/{x}/{y}@1x?url=s3%3A%2F%2Ffiggy-geo-staging%2F2a%2F91%2Fd8%2F2a91d82c541c426cb787cc62afe8f248%2Fmosaic-6c5b32bfe4cb8e4fb07d32cd6656d024.json&rescale=0%2C255"
|
7
|
+
],
|
8
|
+
"minzoom": 8,
|
9
|
+
"maxzoom": 13,
|
10
|
+
"bounds": [
|
11
|
+
19.22222222200001,
|
12
|
+
39.74997750505241,
|
13
|
+
29.356941715411907,
|
14
|
+
43.083333000050004
|
15
|
+
],
|
16
|
+
"center": [
|
17
|
+
24.28958196870596,
|
18
|
+
41.41665525255121,
|
19
|
+
8
|
20
|
+
]
|
21
|
+
}
|