geoblacklight 4.0.0.pre.alpha.2 → 4.0.0.pre.rc2
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 +27 -103
- data/.gitignore +1 -0
- data/.rubocop.yml +6 -6
- data/.rubocop_todo.yml +0 -3
- data/.solr_wrapper +2 -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/parent-item.svg +3 -0
- data/app/assets/images/blacklight/university-of-colorado-boulder.svg +6 -0
- 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 +64 -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 +31 -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/shared/_header_navbar.html.erb +13 -3
- data/config/locales/geoblacklight.en.yml +5 -1
- data/geoblacklight.gemspec +7 -7
- 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 +86 -57
- data/lib/generators/geoblacklight/templates/settings.gbl_v1.yml +5 -5
- data/lib/generators/geoblacklight/templates/settings.yml +43 -25
- data/lib/geoblacklight/bounding_box.rb +5 -1
- 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/config/initializers/rails_config_spec.rb +1 -1
- data/spec/controllers/catalog_controller_spec.rb +1 -1
- data/spec/controllers/wms_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 +12 -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 +17 -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/b1g_wabash_child_15.json +62 -0
- data/spec/fixtures/solr_documents/b1g_wabash_child_16.json +64 -0
- data/spec/fixtures/solr_documents/b1g_wabash_child_17.json +62 -0
- data/spec/fixtures/solr_documents/b1g_wabash_child_18.json +62 -0
- data/spec/fixtures/solr_documents/b1g_wabash_parent.json +59 -0
- 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/metadata_transformer/fgdc_spec.rb +1 -1
- data/spec/lib/geoblacklight/metadata_transformer/iso19139_spec.rb +1 -1
- data/spec/lib/geoblacklight/references_spec.rb +5 -3
- data/spec/lib/geoblacklight/relation/relation_response_spec.rb +5 -0
- data/spec/lib/geoblacklight/view_helper_override_spec.rb +0 -10
- data/spec/lib/geoblacklight/wms_layer_spec.rb +1 -1
- data/spec/models/concerns/geoblacklight/bbox_filter_field_spec.rb +96 -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 +8 -3
- 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 +14126 -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 +108 -53
- 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
@@ -0,0 +1,4 @@
|
|
1
|
+
<!-- Generated by IcoMoon.io -->
|
2
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="34" height="32" viewBox="0 0 34 32">
|
3
|
+
<path fill="#6c757d" d="M11.429 10.286c0 1.894-1.535 3.429-3.429 3.429s-3.429-1.535-3.429-3.429v0c0-1.894 1.535-3.429 3.429-3.429s3.429 1.535 3.429 3.429v0zM29.714 17.143v8h-25.143v-3.429l5.714-5.714 2.857 2.857 9.143-9.143zM31.429 4.571h-28.571c-0.309 0-0.571 0.263-0.571 0.571v21.714c0 0.309 0.263 0.571 0.571 0.571h28.571c0.309 0 0.571-0.263 0.571-0.571v-21.714c0-0.309-0.263-0.571-0.571-0.571zM34.286 5.143v21.714c0 1.578-1.279 2.857-2.857 2.857v0h-28.571c-1.578 0-2.857-1.279-2.857-2.857v0-21.714c0-1.578 1.279-2.857 2.857-2.857v0h28.571c1.578 0 2.857 1.279 2.857 2.857v0z"></path>
|
4
|
+
</svg>
|
@@ -0,0 +1,4 @@
|
|
1
|
+
<!-- Generated by IcoMoon.io -->
|
2
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
3
|
+
<path fill="#6c757d" d="M9.143 0c0.309 0 0.571 0.263 0.571 0.571v26.286c-0.002 0.218-0.125 0.406-0.305 0.501l-0.003 0.002-8.571 4.571c-0.073 0.043-0.16 0.069-0.254 0.069-0.003 0-0.006-0-0.010-0h0c-0.313-0.006-0.565-0.258-0.571-0.571v-26.286c0-0.217 0.114-0.411 0.309-0.503l8.571-4.571c0.073-0.043 0.16-0.069 0.254-0.069 0.003 0 0.006 0 0.010 0h-0zM31.429 0c0.309 0 0.571 0.263 0.571 0.571v26.286c-0.002 0.218-0.125 0.406-0.305 0.501l-0.003 0.002-8.571 4.571c-0.073 0.043-0.16 0.069-0.254 0.069-0.003 0-0.006-0-0.010-0h0c-0.313-0.006-0.565-0.258-0.571-0.571v-26.286c0-0.217 0.114-0.411 0.309-0.503l8.571-4.571c0.073-0.043 0.16-0.069 0.254-0.069 0.003 0 0.006 0 0.010 0h-0zM11.429 0c0.001 0 0.002 0 0.002 0 0.091 0 0.176 0.021 0.252 0.059l-0.003-0.002 9.143 4.571c0.194 0.114 0.32 0.297 0.32 0.514v26.286c0 0 0 0.001 0 0.001 0 0.316-0.256 0.571-0.571 0.571-0.092 0-0.178-0.022-0.255-0.060l0.003 0.002-9.143-4.571c-0.188-0.099-0.315-0.291-0.32-0.514v-26.286c0-0.309 0.263-0.571 0.571-0.571z"></path>
|
4
|
+
</svg>
|
@@ -0,0 +1,3 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 32">
|
2
|
+
<path fill="#6c757d" d="M24 19.54c-3.44 8.55-11.7 3.38-11.7 3.38-2.53 5.11-6.7 8.4-11.53 8.42-1 0-1.04-1.53 0-1.53 4.02-.02 7.53-2.67 9.82-6.88-2.57 1-7.4 1.75-10.1-5.13 6.82-2.81 9.95.7 11.15 2.84a22.68 22.68 0 0 0 1.35-4.98s-8.73 1.37-9.35-6.13c7.45-3 9.54 4.8 9.54 4.8.1-1.05.2-3.3.2-3.35 0 0-6.64-4.6-2.37-10.32 7.78 2.69 3.83 10.15 3.83 10.15.03.1.03 1.49 0 2.09 0 0 2.83-5.57 8.53-3.6-.26 8.38-8.87 6.65-8.87 6.65-.28 1.71-.7 3.34-1.25 4.85 0 0 5.19-5.74 10.75-1.25z"/>
|
3
|
+
</svg>
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 59.6 57.6">
|
2
|
+
<path fill="#6c757d" d="M47.4,57.6H24.4l-8.2-8.1v-6.1H8.1L0,35.3V8.1L8.1,0h27.2l8.1,8.1v6.1h16.2v15h-4v20.3L47.4,57.6z M24.9,56.3
|
3
|
+
h22l7.4-7.3V28h4V15.5H42.1V8.6l-7.3-7.3H8.6L1.3,8.6v26.1l7.4,7.3h8.8V49L24.9,56.3z M44,17.6V46H27.8v-6.1h6.1l6.1-6.1v-8.1h-8.1
|
4
|
+
v6h-4V17.6H15.6v8.1h4v6h-8.1V11.5h20.3v6.1H40V9.5l-6.1-6.1H9.5L3.4,9.5v24.3l6.1,6.1h10.1V48l6.2,6.1H46l6.2-6.1V25.8h4v-8.1
|
5
|
+
C56.1,17.6,44,17.6,44,17.6z"/>
|
6
|
+
</svg>
|
@@ -0,0 +1,4 @@
|
|
1
|
+
<!-- Generated by IcoMoon.io -->
|
2
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
3
|
+
<path fill="#6c757d" d="M25.143 16.571v5.714c0 2.84-2.303 5.143-5.143 5.143v0h-14.857c-2.84 0-5.143-2.303-5.143-5.143v0-14.857c0-2.84 2.303-5.143 5.143-5.143v0h12.571c0.32 0 0.571 0.251 0.571 0.571v1.143c0 0.316-0.256 0.571-0.571 0.571v0h-12.571c-1.578 0-2.857 1.279-2.857 2.857v0 14.857c0 1.578 1.279 2.857 2.857 2.857v0h14.857c1.578 0 2.857-1.279 2.857-2.857v0-5.714c0-0.32 0.251-0.571 0.571-0.571h1.143c0.32 0 0.571 0.251 0.571 0.571zM32 1.143v9.143c0 0.631-0.512 1.143-1.143 1.143v0c-0.314-0.003-0.597-0.134-0.8-0.343l-3.143-3.143-11.646 11.646c-0.114 0.114-0.263 0.183-0.411 0.183s-0.297-0.080-0.411-0.183l-2.034-2.034c-0.114-0.114-0.171-0.263-0.171-0.411s0.069-0.309 0.171-0.411l11.646-11.646-3.143-3.143c-0.208-0.204-0.338-0.486-0.343-0.799v-0.001c0-0.631 0.512-1.143 1.143-1.143v0h9.143c0.631 0 1.143 0.512 1.143 1.143v0z"></path>
|
4
|
+
</svg>
|
@@ -20,6 +20,7 @@ GeoBlacklight.Viewer.Esri = GeoBlacklight.Viewer.Map.extend({
|
|
20
20
|
|
21
21
|
// remove any trailing slash from endpoint url
|
22
22
|
_this.data.url = _this.data.url.replace(/\/$/, '');
|
23
|
+
|
23
24
|
L.esri.get(_this.data.url, {}, function(error, response){
|
24
25
|
if(!error) {
|
25
26
|
_this.layerInfo = response;
|
@@ -0,0 +1,33 @@
|
|
1
|
+
//= require geoblacklight/viewers/wms
|
2
|
+
|
3
|
+
GeoBlacklight.Viewer.Tilejson = GeoBlacklight.Viewer.Wms.extend({
|
4
|
+
|
5
|
+
addPreviewLayer: function() {
|
6
|
+
var _this = this;
|
7
|
+
fetch(this.data.url).then(function(response) {
|
8
|
+
if (!response.ok) {
|
9
|
+
throw new Error("Unable to fetch tile.json document");
|
10
|
+
}
|
11
|
+
return response.json();
|
12
|
+
}).then(function(tilejson) {
|
13
|
+
var bounds = _this.getBounds(tilejson),
|
14
|
+
options = bounds ? { bounds: bounds } : {},
|
15
|
+
url = tilejson.tiles[0],
|
16
|
+
tileJsonLayer = L.tileLayer(url, options);
|
17
|
+
_this.overlay.addLayer(tileJsonLayer);
|
18
|
+
}).catch(function(error) {
|
19
|
+
console.debug(error);
|
20
|
+
});
|
21
|
+
},
|
22
|
+
|
23
|
+
getBounds: function(doc) {
|
24
|
+
// Get the bounds from the document, if they exist, and
|
25
|
+
// convert to a Leaflet latlngBounds object
|
26
|
+
var bounds = doc.bounds;
|
27
|
+
if(bounds) {
|
28
|
+
var corner1 = L.latLng(bounds[1], bounds[0]),
|
29
|
+
corner2 = L.latLng(bounds[3], bounds[2]);
|
30
|
+
return L.latLngBounds(corner1, corner2);
|
31
|
+
}
|
32
|
+
}
|
33
|
+
});
|
@@ -4,7 +4,7 @@ GeoBlacklight.Viewer.Tms = GeoBlacklight.Viewer.Wms.extend({
|
|
4
4
|
|
5
5
|
addPreviewLayer: function() {
|
6
6
|
var _this = this;
|
7
|
-
var
|
8
|
-
this.overlay.addLayer(
|
7
|
+
var tmsLayer = L.tileLayer(this.data.url, { tms: true });
|
8
|
+
this.overlay.addLayer(tmsLayer);
|
9
9
|
}
|
10
10
|
});
|
@@ -40,8 +40,8 @@ GeoBlacklight.Viewer.Wms = GeoBlacklight.Viewer.Map.extend({
|
|
40
40
|
URL: _this.data.url,
|
41
41
|
LAYERS: _this.data.layerId,
|
42
42
|
BBOX: _this.map.getBounds().toBBoxString(),
|
43
|
-
WIDTH: $('#map').width(),
|
44
|
-
HEIGHT: $('#map').height(),
|
43
|
+
WIDTH: Math.round($('#map').width()),
|
44
|
+
HEIGHT: Math.round($('#map').height()),
|
45
45
|
QUERY_LAYERS: _this.data.layerId,
|
46
46
|
X: Math.round(e.containerPoint.x),
|
47
47
|
Y: Math.round(e.containerPoint.y)
|
@@ -0,0 +1,85 @@
|
|
1
|
+
//= require geoblacklight/viewers/wms
|
2
|
+
|
3
|
+
GeoBlacklight.Viewer.Wmts = GeoBlacklight.Viewer.Wms.extend({
|
4
|
+
|
5
|
+
addPreviewLayer: function() {
|
6
|
+
var _this = this;
|
7
|
+
fetch(this.data.url).then(function(response) {
|
8
|
+
if (!response.ok) {
|
9
|
+
throw new Error("Unable to fetch WMTSCapabilities document");
|
10
|
+
}
|
11
|
+
return response.text();
|
12
|
+
}).then(function(wmtsCapabilities) {
|
13
|
+
var tileInfo = _this.parseCapabilities(wmtsCapabilities),
|
14
|
+
options = tileInfo.bounds ? { bounds: tileInfo.bounds } : {},
|
15
|
+
tileLayer = L.tileLayer(tileInfo.url, options);
|
16
|
+
_this.overlay.addLayer(tileLayer);
|
17
|
+
}).catch(function(error) {
|
18
|
+
console.debug(error);
|
19
|
+
});
|
20
|
+
},
|
21
|
+
|
22
|
+
parseCapabilities: function(wmtsCapabilities) {
|
23
|
+
var parser = new DOMParser(),
|
24
|
+
doc = parser.parseFromString(wmtsCapabilities, "application/xml"),
|
25
|
+
layers = doc.getElementsByTagName("Layer"),
|
26
|
+
selectedLayer = this.findLayer(layers),
|
27
|
+
resourceElement = selectedLayer.getElementsByTagName("ResourceURL")[0];
|
28
|
+
|
29
|
+
// Generate URL with Leaflet.TileLayer URL template formatting
|
30
|
+
var tileURL = resourceElement.getAttribute("template")
|
31
|
+
.replace("{Style}", this.getStyle(selectedLayer))
|
32
|
+
.replace("{TileMatrixSet}", this.getTileMatrixSet(selectedLayer))
|
33
|
+
.replace("TileMatrix", "z")
|
34
|
+
.replace("TileCol","x")
|
35
|
+
.replace("TileRow","y");
|
36
|
+
|
37
|
+
return { url: tileURL, bounds: this.getBounds(selectedLayer) };
|
38
|
+
},
|
39
|
+
|
40
|
+
findLayer: function(layers) {
|
41
|
+
if (layers.length === 1) {
|
42
|
+
// If there is only one layer in the document, return it
|
43
|
+
return layers[0];
|
44
|
+
} else {
|
45
|
+
// Search each layer for an identifier that matches the
|
46
|
+
// layerId and return it
|
47
|
+
for (i = 0; i < layers.length; i++) {
|
48
|
+
var ids = layers[i].getElementsByTagName("ows:Identifier");
|
49
|
+
for(x = 0; x < ids.length; x++) {
|
50
|
+
if (ids[x].textContent === this.data.layerId) {
|
51
|
+
return layers[i];
|
52
|
+
}
|
53
|
+
}
|
54
|
+
}
|
55
|
+
}
|
56
|
+
},
|
57
|
+
|
58
|
+
getStyle: function(layer) {
|
59
|
+
var styleElement = layer.getElementsByTagName("Style")[0];
|
60
|
+
if(styleElement) {
|
61
|
+
return styleElement.getElementsByTagName("ows:Identifier")[0].textContent;
|
62
|
+
}
|
63
|
+
},
|
64
|
+
|
65
|
+
getTileMatrixSet: function(layer) {
|
66
|
+
var tileMatrixElement = layer.getElementsByTagName("TileMatrixSet")[0];
|
67
|
+
if(tileMatrixElement) {
|
68
|
+
return tileMatrixElement.textContent;
|
69
|
+
}
|
70
|
+
},
|
71
|
+
|
72
|
+
getBounds: function(layer) {
|
73
|
+
// Get the layer's lower corner and upper corner values,
|
74
|
+
// if they exist, and convert to a Leaflet latlngBounds object
|
75
|
+
var lcElement = layer.getElementsByTagName("ows:LowerCorner")[0],
|
76
|
+
ucElement = layer.getElementsByTagName("ows:UpperCorner")[0];
|
77
|
+
if(lcElement && ucElement) {
|
78
|
+
var lc = lcElement.textContent.split(" "),
|
79
|
+
uc = ucElement.textContent.split(" "),
|
80
|
+
corner1 = L.latLng(lc[1], lc[0]),
|
81
|
+
corner2 = L.latLng(uc[1], uc[0]);
|
82
|
+
return L.latLngBounds(corner1, corner2);
|
83
|
+
}
|
84
|
+
}
|
85
|
+
});
|
@@ -1,6 +1,22 @@
|
|
1
|
-
//
|
2
|
-
.
|
3
|
-
|
1
|
+
// Styling for Download and Web services buttons
|
2
|
+
.sidebar-btn {
|
3
|
+
width: 100%;
|
4
|
+
|
5
|
+
+ #downloads-collapse {
|
6
|
+
width: 100%;
|
7
|
+
}
|
8
|
+
}
|
9
|
+
|
10
|
+
/* match bottom margin on tools card */
|
11
|
+
.sidebar-buttons {
|
12
|
+
margin-bottom: 20px;
|
13
|
+
}
|
14
|
+
|
15
|
+
.sidebar-buttons div + div {
|
16
|
+
margin-top: 10px;
|
17
|
+
}
|
18
|
+
|
19
|
+
// Styling for the Authentication card
|
4
20
|
.authentication {
|
5
21
|
@include sidebar-children;
|
6
22
|
|
@@ -20,8 +36,7 @@
|
|
20
36
|
}
|
21
37
|
|
22
38
|
// This section could be eliminated if we update the Authentication card
|
23
|
-
//
|
24
|
-
// list-group rather than the card header).
|
39
|
+
// by putting the button in a list-group rather than the card header.
|
25
40
|
.authentication {
|
26
41
|
.card-header {
|
27
42
|
background-color: inherit;
|
@@ -32,45 +47,3 @@
|
|
32
47
|
}
|
33
48
|
}
|
34
49
|
}
|
35
|
-
|
36
|
-
// Specific to the Export card (mostly because of the current external
|
37
|
-
// label + button approach, which could be mostly eliminated by reworking
|
38
|
-
// as suggested in https://github.com/sul-dlss/earthworks/issues/646)
|
39
|
-
.card.exports {
|
40
|
-
.card-header {
|
41
|
-
.spinner-border { // if this is used, it probably should go in the card body rather than the card header
|
42
|
-
position: absolute;
|
43
|
-
right: 1rem;
|
44
|
-
top: 1rem;
|
45
|
-
}
|
46
|
-
}
|
47
|
-
|
48
|
-
.export {
|
49
|
-
text-align: center;
|
50
|
-
|
51
|
-
@include media-breakpoint-up(xl) {
|
52
|
-
text-align: left;
|
53
|
-
}
|
54
|
-
|
55
|
-
.export-label {
|
56
|
-
padding: 6px 6px 6px 0;
|
57
|
-
|
58
|
-
@include media-breakpoint-up(xl) {
|
59
|
-
display: inline-block;
|
60
|
-
}
|
61
|
-
}
|
62
|
-
|
63
|
-
.export-link-container {
|
64
|
-
@include media-breakpoint-up(xl) {
|
65
|
-
display: inline-block;
|
66
|
-
float: right;
|
67
|
-
}
|
68
|
-
|
69
|
-
a {
|
70
|
-
@include media-breakpoint-up(xl) {
|
71
|
-
width: inherit;
|
72
|
-
}
|
73
|
-
}
|
74
|
-
}
|
75
|
-
}
|
76
|
-
}
|
@@ -5,3 +5,71 @@
|
|
5
5
|
margin: 5px 0;
|
6
6
|
}
|
7
7
|
}
|
8
|
+
|
9
|
+
#map[data-protocol="IndexMap"] {
|
10
|
+
.leaflet-interactive {
|
11
|
+
stroke: black;
|
12
|
+
fill-opacity: 0.65;
|
13
|
+
}
|
14
|
+
}
|
15
|
+
|
16
|
+
.index-map-legend {
|
17
|
+
font-size: 15px;
|
18
|
+
display: flex;
|
19
|
+
position: absolute;
|
20
|
+
right: 15px;
|
21
|
+
top: -2px;
|
22
|
+
left: 90px;
|
23
|
+
|
24
|
+
&-info {
|
25
|
+
display: flex;
|
26
|
+
flex-wrap: nowrap;
|
27
|
+
align-items: center;
|
28
|
+
margin-left: 15px;
|
29
|
+
}
|
30
|
+
|
31
|
+
span {
|
32
|
+
display: inline-block;
|
33
|
+
border: 1px solid black;
|
34
|
+
margin-right: 10px;
|
35
|
+
height: 24px;
|
36
|
+
width: 24px;
|
37
|
+
min-height: 24px;
|
38
|
+
min-width: 24px;
|
39
|
+
}
|
40
|
+
|
41
|
+
p {
|
42
|
+
margin-bottom: 0;
|
43
|
+
}
|
44
|
+
|
45
|
+
&-default {
|
46
|
+
background: #7FCDBB;
|
47
|
+
}
|
48
|
+
&-unavailable {
|
49
|
+
background: #EDF8B1;
|
50
|
+
}
|
51
|
+
&-selected {
|
52
|
+
background: #2C7FB8;
|
53
|
+
}
|
54
|
+
&-default, &-unavailable, &-selected {
|
55
|
+
opacity: 0.65;
|
56
|
+
}
|
57
|
+
|
58
|
+
@media(max-width: 768px){
|
59
|
+
position: revert;
|
60
|
+
margin-bottom: 1.25rem;
|
61
|
+
|
62
|
+
:first-child {
|
63
|
+
margin-left: 0;
|
64
|
+
}
|
65
|
+
}
|
66
|
+
|
67
|
+
@media(max-width: 480px){
|
68
|
+
display: block;
|
69
|
+
|
70
|
+
.index-map-legend-info {
|
71
|
+
margin-left: 0;
|
72
|
+
margin-bottom: 10px;
|
73
|
+
}
|
74
|
+
}
|
75
|
+
}
|
@@ -9,6 +9,11 @@
|
|
9
9
|
[data-map="item"] {
|
10
10
|
border: 1px solid $gray-400;
|
11
11
|
height: 27.5rem;
|
12
|
+
|
13
|
+
// Ensure oembed iframe is the same height as its container
|
14
|
+
iframe {
|
15
|
+
height: 27.5rem;
|
16
|
+
}
|
12
17
|
}
|
13
18
|
|
14
19
|
[data-inspect="true"][data-available="true"] {
|
@@ -19,6 +24,7 @@
|
|
19
24
|
cursor: crosshair;
|
20
25
|
}
|
21
26
|
}
|
27
|
+
margin-bottom: 1rem;
|
22
28
|
}
|
23
29
|
|
24
30
|
.help-text {
|
@@ -36,4 +42,14 @@
|
|
36
42
|
-webkit-box-orient: vertical;
|
37
43
|
-webkit-line-clamp: 8;
|
38
44
|
}
|
45
|
+
|
46
|
+
#table-container{
|
47
|
+
overflow:scroll;
|
48
|
+
max-height: 450px;
|
49
|
+
margin-bottom: 1rem;
|
50
|
+
|
51
|
+
table {
|
52
|
+
margin-bottom: 0px;
|
53
|
+
}
|
54
|
+
}
|
39
55
|
}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Geoblacklight
|
4
|
+
# Display facet values with a decorative icon
|
5
|
+
# @example Usage in the blacklight configuration:
|
6
|
+
# config.add_facet_field 'provider_facet', [...], item_component: Geoblacklight::IconFacetItemComponent
|
7
|
+
class IconFacetItemComponent < Blacklight::FacetItemComponent
|
8
|
+
delegate :safe_join, :geoblacklight_icon, to: :helpers
|
9
|
+
|
10
|
+
def initialize(facet_item:, **)
|
11
|
+
super
|
12
|
+
|
13
|
+
# store a copy of the original label value
|
14
|
+
@undecorated_label = @label
|
15
|
+
end
|
16
|
+
|
17
|
+
def before_render
|
18
|
+
# replace the original label with an icon-decorated version; this has to be done in
|
19
|
+
# #before_render or #render so we have access to the icon helpers.
|
20
|
+
@label = decorated_label
|
21
|
+
|
22
|
+
super
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def decorated_label
|
28
|
+
icon = geoblacklight_icon(@facet_item.value, aria_hidden: true, classes: 'svg_tooltip')
|
29
|
+
|
30
|
+
safe_join([icon, @undecorated_label], ' ')
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -17,7 +17,6 @@ module GeoblacklightHelper
|
|
17
17
|
label,
|
18
18
|
url,
|
19
19
|
'contentUrl' => url,
|
20
|
-
class: ['btn', 'btn-default', 'download', 'download-original'],
|
21
20
|
data: {
|
22
21
|
download: 'trigger',
|
23
22
|
download_type: 'direct',
|
@@ -30,7 +29,6 @@ module GeoblacklightHelper
|
|
30
29
|
link_to(
|
31
30
|
text,
|
32
31
|
download_hgl_path(id: document),
|
33
|
-
class: ['btn', 'btn-default', 'download', 'download-original'],
|
34
32
|
data: {
|
35
33
|
blacklight_modal: 'trigger',
|
36
34
|
download: 'trigger',
|
@@ -47,7 +45,6 @@ module GeoblacklightHelper
|
|
47
45
|
download_text('JPG'),
|
48
46
|
iiif_jpg_url,
|
49
47
|
'contentUrl' => iiif_jpg_url,
|
50
|
-
class: ['btn', 'btn-default', 'download', 'download-generated'],
|
51
48
|
data: {
|
52
49
|
download: 'trigger'
|
53
50
|
}
|
@@ -56,9 +53,8 @@ module GeoblacklightHelper
|
|
56
53
|
|
57
54
|
def download_link_generated(download_type, document)
|
58
55
|
link_to(
|
59
|
-
t('geoblacklight.download.export_link', download_format:
|
56
|
+
t('geoblacklight.download.export_link', download_format: export_format_label(download_type)),
|
60
57
|
'',
|
61
|
-
class: ['btn', 'btn-default', 'download', 'download-generated'],
|
62
58
|
data: {
|
63
59
|
download_path: download_path(document.id, type: download_type),
|
64
60
|
download: 'trigger',
|
@@ -88,16 +84,6 @@ module GeoblacklightHelper
|
|
88
84
|
end
|
89
85
|
end
|
90
86
|
|
91
|
-
##
|
92
|
-
# Renders an unique array of search links based off of terms
|
93
|
-
# passed in using the facet parameter
|
94
|
-
#
|
95
|
-
def render_facet_links(facet, items)
|
96
|
-
items.uniq.map do |item|
|
97
|
-
link_to item, search_catalog_path(f: { facet => [item] })
|
98
|
-
end.join(', ').html_safe
|
99
|
-
end
|
100
|
-
|
101
87
|
##
|
102
88
|
# Looks up properly formatted names for formats
|
103
89
|
#
|
@@ -105,6 +91,11 @@ module GeoblacklightHelper
|
|
105
91
|
t("geoblacklight.formats.#{format.to_s.parameterize(separator: '_')}")
|
106
92
|
end
|
107
93
|
|
94
|
+
# Format labels are customized for exports - look up the appropriate key.
|
95
|
+
def export_format_label(format)
|
96
|
+
t("geoblacklight.download.export_#{format.to_s.parameterize(separator: '_')}_link")
|
97
|
+
end
|
98
|
+
|
108
99
|
##
|
109
100
|
# Looks up formatted names for references
|
110
101
|
# @param (String, Symbol) reference
|
@@ -122,22 +113,6 @@ module GeoblacklightHelper
|
|
122
113
|
value.html_safe
|
123
114
|
end
|
124
115
|
|
125
|
-
def download_generated_body(format)
|
126
|
-
value = proper_case_format(format)
|
127
|
-
value = case value
|
128
|
-
when t('geoblacklight.formats.shapefile')
|
129
|
-
t('geoblacklight.download.export_shapefile_link')
|
130
|
-
when t('geoblacklight.formats.kmz')
|
131
|
-
t('geoblacklight.download.export_kmz_link')
|
132
|
-
when t('geoblacklight.formats.geojson')
|
133
|
-
t('geoblacklight.download.export_geojson_link')
|
134
|
-
else
|
135
|
-
value
|
136
|
-
end
|
137
|
-
|
138
|
-
value.html_safe
|
139
|
-
end
|
140
|
-
|
141
116
|
##
|
142
117
|
# Deteremines if a feature should include help text popover
|
143
118
|
# @return [Boolean]
|
@@ -206,18 +181,6 @@ module GeoblacklightHelper
|
|
206
181
|
Settings.LEAFLET
|
207
182
|
end
|
208
183
|
|
209
|
-
##
|
210
|
-
# Renders a facet item with an icon placed as the first child of
|
211
|
-
# `.facet-label`. This works with `render_facet_value` and
|
212
|
-
# `render_selected_facet_value`
|
213
|
-
# @return String
|
214
|
-
def render_facet_item_with_icon(field_name, item)
|
215
|
-
doc = Nokogiri::HTML.fragment(render_facet_item(field_name, item))
|
216
|
-
doc.at_css('.facet-label').children.first
|
217
|
-
.add_previous_sibling(geoblacklight_icon(item.value, aria_hidden: true, classes: 'svg_tooltip'))
|
218
|
-
doc.to_html.html_safe
|
219
|
-
end
|
220
|
-
|
221
184
|
##
|
222
185
|
# Renders the transformed metadata
|
223
186
|
# (Renders a partial when the metadata isn't available)
|
@@ -267,8 +230,6 @@ module GeoblacklightHelper
|
|
267
230
|
case controller_name
|
268
231
|
when 'bookmarks'
|
269
232
|
'bookmarks'
|
270
|
-
when 'catalog'
|
271
|
-
'index'
|
272
233
|
else
|
273
234
|
'index'
|
274
235
|
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Geoblacklight
|
4
|
+
class BboxFilterField < Blacklight::SearchState::FilterField
|
5
|
+
# this accessor is unnecessary after Blacklight 7.25.0
|
6
|
+
attr_accessor :filters_key
|
7
|
+
|
8
|
+
def initialize(*args)
|
9
|
+
super
|
10
|
+
@filters_key = :bbox
|
11
|
+
end
|
12
|
+
|
13
|
+
# @param [String,#value] a filter item to add to the url
|
14
|
+
# @return [Blacklight::SearchState] new state
|
15
|
+
def add(item)
|
16
|
+
new_state = search_state.reset_search
|
17
|
+
params = new_state.params
|
18
|
+
value = as_url_parameter(item)
|
19
|
+
|
20
|
+
params[filters_key] = value.to_param
|
21
|
+
|
22
|
+
new_state.reset(params)
|
23
|
+
end
|
24
|
+
|
25
|
+
# @param [String,#value] a filter to remove from the url
|
26
|
+
# @return [Blacklight::SearchState] new state
|
27
|
+
def remove(_item)
|
28
|
+
new_state = search_state.reset_search
|
29
|
+
params = new_state.params
|
30
|
+
|
31
|
+
params.delete(filters_key)
|
32
|
+
new_state.reset(params)
|
33
|
+
end
|
34
|
+
|
35
|
+
# @return [Array] an array of applied filters
|
36
|
+
def values(except: [])
|
37
|
+
params = search_state.params
|
38
|
+
return [] if except.include?(:filters) || params[filters_key].blank?
|
39
|
+
|
40
|
+
[Geoblacklight::BoundingBox.from_rectangle(params[filters_key])]
|
41
|
+
rescue Geoblacklight::Exceptions::WrongBoundingBoxFormat => e
|
42
|
+
Rails.logger.warn(e)
|
43
|
+
|
44
|
+
[]
|
45
|
+
end
|
46
|
+
|
47
|
+
# @param [String,#value] a filter to remove from the url
|
48
|
+
# @return [Boolean] whether the provided filter is currently applied/selected
|
49
|
+
delegate :include?, to: :values
|
50
|
+
|
51
|
+
# @since Blacklight v7.25.0
|
52
|
+
# normal filter fields demangle when they encounter a hash, which they assume to be a number-indexed map
|
53
|
+
def needs_normalization?(value_params)
|
54
|
+
value_params.is_a?(Hash) && value_params.keys.map(&:to_s).all? { |k| k =~ /^\d+$/ }
|
55
|
+
end
|
56
|
+
|
57
|
+
# @since Blacklight v7.25.0
|
58
|
+
# value should be the first value from a mangled hash,
|
59
|
+
# otherwise return the value as-is
|
60
|
+
def normalize(value_params)
|
61
|
+
needs_normalization?(value_params) ? value_params.values : value_params
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|