geoblacklight 6.0.0.pre.alpha.6 → 6.0.0.pre.alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE.md +0 -1
- data/.github/workflows/ruby.yml +1 -1
- data/CODE_OF_CONDUCT.md +11 -11
- data/CONTRIBUTING.md +19 -9
- data/README.md +1 -1
- data/app/assets/stylesheets/geoblacklight/global.css +1 -1
- data/app/assets/stylesheets/geoblacklight/index_maps.css +1 -1
- data/app/assets/stylesheets/geoblacklight/record.css +15 -13
- data/app/assets/stylesheets/geoblacklight/viewers.css +88 -5
- data/app/components/geoblacklight/document/download_link_component.html.erb +1 -2
- data/app/components/geoblacklight/document/download_links_component.html.erb +3 -1
- data/app/components/geoblacklight/document/preview_component.html.erb +6 -0
- data/app/components/geoblacklight/document/preview_component.rb +14 -0
- data/app/components/geoblacklight/document_component.html.erb +1 -6
- data/app/components/geoblacklight/facets/bbox_field_component.html.erb +17 -0
- data/app/components/geoblacklight/facets/bbox_field_component.rb +7 -0
- data/app/components/geoblacklight/header_badge_component.html.erb +2 -0
- data/app/components/geoblacklight/header_badge_component.rb +21 -0
- data/app/components/geoblacklight/header_component.html.erb +1 -1
- data/app/components/geoblacklight/header_icons_component.html.erb +1 -1
- data/app/components/geoblacklight/header_icons_component.rb +8 -12
- data/app/components/geoblacklight/item_map_viewer_component.rb +6 -5
- data/app/components/geoblacklight/location_leaflet_map_component.rb +8 -9
- data/app/{views/catalog/_metadata.html.erb → components/geoblacklight/metadata_component.html.erb} +5 -7
- data/app/components/geoblacklight/metadata_component.rb +29 -0
- data/app/components/geoblacklight/metadata_description_markdown_component.rb +21 -0
- data/app/components/geoblacklight/relations_component.html.erb +2 -2
- data/app/components/geoblacklight/resource_header_badge_component.rb +37 -0
- data/app/components/geoblacklight/search_result_component.html.erb +15 -14
- data/app/components/geoblacklight/static_map_component.rb +5 -2
- data/app/helpers/geoblacklight_helper.rb +27 -50
- data/app/javascript/geoblacklight/controllers/leaflet_viewer_controller.js +19 -4
- data/app/javascript/geoblacklight/controllers/openlayers_viewer_controller.js +10 -2
- data/app/javascript/geoblacklight/leaflet/basemaps.js +8 -8
- data/app/javascript/geoblacklight/openlayers/basemaps.js +8 -8
- data/app/models/concerns/geoblacklight/solr_document.rb +9 -0
- data/app/views/catalog/_document_split.html.erb +1 -6
- data/app/views/catalog/_home_text.html.erb +1 -1
- data/app/views/catalog/metadata.html.erb +1 -1
- data/geoblacklight.gemspec +2 -1
- data/lib/generators/geoblacklight/templates/catalog_controller.rb +22 -30
- data/lib/generators/geoblacklight/templates/settings.yml +0 -5
- data/lib/geoblacklight/configuration/leaflet_config.rb +3 -2
- data/lib/geoblacklight/configuration/settings_builder.rb +0 -1
- data/lib/geoblacklight/configuration.rb +18 -5
- data/lib/geoblacklight/engine.rb +1 -0
- data/lib/geoblacklight/item_viewer.rb +1 -1
- data/lib/geoblacklight/version.rb +1 -1
- data/schema/readme.md +1 -1
- data/spec/components/geoblacklight/citation_component_spec.rb +1 -1
- data/spec/components/geoblacklight/document_component_spec.rb +10 -0
- data/spec/components/geoblacklight/metadata_component_spec.rb +67 -0
- data/spec/components/geoblacklight/metadata_description_markdown_component_spec.rb +38 -0
- data/spec/components/geoblacklight/viewer_help_text_component_spec.rb +1 -0
- data/spec/controllers/catalog_controller_spec.rb +8 -55
- data/spec/features/configurable_basemap_spec.rb +7 -7
- data/spec/features/home_page_spec.rb +0 -26
- data/spec/features/index_view_spec.rb +0 -24
- data/spec/features/layer_preview_spec.rb +1 -1
- data/spec/features/metadata_panel_spec.rb +18 -69
- data/spec/features/relations_spec.rb +0 -18
- data/spec/features/search_spec.rb +0 -22
- data/spec/features/sms_spec.rb +8 -8
- data/spec/features/web_services_modal_spec.rb +0 -83
- data/spec/fixtures/fgdc/SANB_a2725322-fgdc.xml +209 -0
- data/spec/fixtures/index_maps/index-map-point.geojson +13181 -949
- data/spec/fixtures/index_maps/index-map-polygon-no-downloadurl.geojson +21150 -970
- data/spec/fixtures/index_maps/index-map-polygon.geojson +21150 -970
- data/spec/fixtures/index_maps/index-map-stanford.geojson +269 -390
- data/spec/fixtures/index_maps/index-map-v1-complex.geojson +8596 -12247
- data/spec/fixtures/iso19139/{stanford-cg357zz0321.xml → SANB_a2725322-iso19139.xml} +130 -194
- data/spec/fixtures/metadata/fgdc.html +119 -59
- data/spec/fixtures/metadata/iso.html +258 -260
- data/spec/fixtures/mods/stanford-bc576pk4911.mods +98 -0
- data/spec/fixtures/solr_documents/README.md +48 -47
- data/spec/fixtures/solr_documents/actual-raster1.json +2 -3
- data/spec/fixtures/solr_documents/index-map-stanford.json +31 -27
- data/spec/fixtures/solr_documents/restricted-line.json +20 -31
- data/spec/helpers/geoblacklight_helper_spec.rb +0 -76
- data/spec/models/concerns/geoblacklight/solr_document/citation_spec.rb +1 -1
- data/spec/requests/bookmarks_spec.rb +13 -0
- data/spec/requests/catalog_search_spec.rb +43 -0
- data/spec/requests/catalog_show_spec.rb +48 -0
- data/spec/requests/home_page_spec.rb +42 -0
- data/spec/requests/index_view_spec.rb +27 -0
- data/spec/requests/metadata_spec.rb +40 -0
- data/spec/requests/missing_metadata_spec.rb +28 -0
- data/spec/requests/relations_spec.rb +28 -0
- data/spec/requests/search_history_spec.rb +13 -0
- data/spec/requests/search_results_spec.rb +62 -0
- data/spec/requests/web_services_spec.rb +51 -0
- metadata +44 -23
- data/spec/features/bookmarks_spec.rb +0 -12
- data/spec/features/data_dictionary_download_spec.rb +0 -18
- data/spec/features/empty_search_spec.rb +0 -13
- data/spec/features/exports_spec.rb +0 -14
- data/spec/features/help_text_spec.rb +0 -10
- data/spec/features/missing_metadata_spec.rb +0 -26
- data/spec/features/oembed_spec.rb +0 -11
- data/spec/features/saved_searches_spec.rb +0 -11
- data/spec/features/search_bar_spec.rb +0 -14
- data/spec/features/search_results_complex_geometry_spec.rb +0 -25
- data/spec/features/search_results_icons_spec.rb +0 -16
- data/spec/features/search_results_overlap_ratio_spec.rb +0 -57
- data/spec/features/show_page_metadata_spec.rb +0 -14
- data/spec/features/suppressed_records_spec.rb +0 -16
- data/spec/fixtures/fgdc/harvard-g7064-s2-1834-k3.xml +0 -1
- data/spec/fixtures/mods/fb897vt9938.mods +0 -111
- data/spec/fixtures/mods/stanford-cg357zz0321.mods +0 -113
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Geoblacklight
|
|
4
|
+
class MetadataDescriptionMarkdownComponent < Blacklight::MetadataFieldComponent
|
|
5
|
+
# Transform markdown into HTML
|
|
6
|
+
# @param [String] value markdown to transform
|
|
7
|
+
# @return [ActiveSupport::SafeBuffer] rendered HTML
|
|
8
|
+
def markdown_to_html(value)
|
|
9
|
+
Commonmarker.to_html(value).html_safe
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def render_field_values
|
|
13
|
+
[tag.div(class: "truncate-abstract", data: {
|
|
14
|
+
read_more_text: t("geoblacklight.truncate.read_more"),
|
|
15
|
+
close_text: t("geoblacklight.truncate.close")
|
|
16
|
+
}) do
|
|
17
|
+
safe_join(Array(@field.values).flatten.map { |value| markdown_to_html(value) })
|
|
18
|
+
end]
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
<ul class="list-group list-group-flush">
|
|
7
7
|
<% relationship_type_results['docs'][0..2].map { |hash| SolrDocument.new(hash) }.each do |doc| %>
|
|
8
|
-
<li class="list-group-item
|
|
8
|
+
<li class="list-group-item">
|
|
9
9
|
<%= link_to solr_document_path(doc) do %>
|
|
10
10
|
<%= helpers.geoblacklight_icon(rel_type_info.icon) unless rel_type_info.icon.nil? %>
|
|
11
11
|
<%= doc.title %>
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
</li>
|
|
14
14
|
<% end %>
|
|
15
15
|
<% unless (relationship_type_results['numFound'].to_i <= 3) %>
|
|
16
|
-
<li class="list-group-item
|
|
16
|
+
<li class="list-group-item">
|
|
17
17
|
<%= link_to search_catalog_path({f: {"#{Geoblacklight.configuration.relationships_shown.public_send(relationship_type).field}" => [relations.link_id]}}) do %>
|
|
18
18
|
<%= t('geoblacklight.relations.browse_all', count: relationship_type_results['numFound']) %>
|
|
19
19
|
<% end %>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Geoblacklight
|
|
4
|
+
class ResourceHeaderBadgeComponent < HeaderBadgeComponent
|
|
5
|
+
def label
|
|
6
|
+
return first_resource if resource_type_icon_missing?
|
|
7
|
+
|
|
8
|
+
dataset_type
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def icon(field)
|
|
12
|
+
return resource_type_icon unless resource_type_icon_missing?
|
|
13
|
+
default_resource_icon
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def default_resource_icon
|
|
17
|
+
helpers.geoblacklight_icon(first_resource)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def resource_type_icon_missing?
|
|
21
|
+
return @resource_type_icon_missing if defined?(@resource_type_icon_missing)
|
|
22
|
+
@resource_type_icon_missing = resource_type_icon.include?("icon-missing")
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def resource_type_icon
|
|
26
|
+
@resource_type_icon ||= helpers.geoblacklight_icon(dataset_type)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def dataset_type
|
|
30
|
+
@dataset_type ||= @document.resource_type.find { |type| type.include?(" data") }&.gsub(" data", "")
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def first_resource
|
|
34
|
+
@first_resource ||= @document.resource_class.first
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -12,9 +12,10 @@
|
|
|
12
12
|
},
|
|
13
13
|
itemscope: true,
|
|
14
14
|
itemtype: @document.itemtype,
|
|
15
|
-
class: classes
|
|
15
|
+
class: classes do %>
|
|
16
16
|
|
|
17
|
-
<%= content_tag :div, class: '
|
|
17
|
+
<%= content_tag :div, class: 'document-main-section' do %>
|
|
18
|
+
<%= content_tag :header, class: 'documentHeader index-split', data: { layer_id: @document.id, geom: @document.geometry.geojson } do %>
|
|
18
19
|
<div class="document-counter">
|
|
19
20
|
<%= t('blacklight.search.documents.counter', :counter => @counter) if @counter %>
|
|
20
21
|
</div>
|
|
@@ -23,18 +24,18 @@
|
|
|
23
24
|
<%= helpers.link_to_document(@document, counter: @counter, itemprop: "name") %>
|
|
24
25
|
</h3>
|
|
25
26
|
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
27
|
+
<button
|
|
28
|
+
class="btn dropdown-toggle collapsed"
|
|
29
|
+
data-bs-toggle="collapse"
|
|
30
|
+
data-bs-target="#doc-<%= @document.id %>-fields-collapse"
|
|
31
|
+
aria-label="<%= t('geoblacklight.metadata.toggle_summary') %>"
|
|
32
|
+
aria-expanded="false"
|
|
33
|
+
aria-controls="doc-<%= @document.id %>-fields-collapse">
|
|
34
|
+
</button>
|
|
35
|
+
<% end %>
|
|
36
|
+
<div class="status-icons mx-4 mt-2">
|
|
37
|
+
<%= render Geoblacklight::HeaderIconsComponent.new(document: @document) %>
|
|
38
|
+
</div>
|
|
38
39
|
<% end %>
|
|
39
40
|
<% end %>
|
|
40
41
|
<div class="more-info-area border-bottom">
|
|
@@ -9,8 +9,10 @@ module Geoblacklight
|
|
|
9
9
|
super()
|
|
10
10
|
end
|
|
11
11
|
|
|
12
|
+
# If there's no preview using the big map, or there is a IIIF preview that
|
|
13
|
+
# is not georeferenced, we need to see where the item is located.
|
|
12
14
|
def render?
|
|
13
|
-
|
|
15
|
+
!@document.previewable? || (@document.iiif_preview? && !@document.georeferenced?)
|
|
14
16
|
end
|
|
15
17
|
|
|
16
18
|
def before_render
|
|
@@ -25,7 +27,8 @@ module Geoblacklight
|
|
|
25
27
|
class: "viewer border",
|
|
26
28
|
data: {
|
|
27
29
|
"controller" => "leaflet-viewer",
|
|
28
|
-
"leaflet-viewer-basemap-value" =>
|
|
30
|
+
"leaflet-viewer-basemap-value" => Geoblacklight.configuration.basemap_provider,
|
|
31
|
+
"leaflet-viewer-dark-basemap-value" => Geoblacklight.configuration.dark_basemap_provider,
|
|
29
32
|
"leaflet-viewer-page-value" => "STATIC_MAP",
|
|
30
33
|
"leaflet-viewer-map-geom-value" => @document.geometry.geojson,
|
|
31
34
|
"leaflet-viewer-options-value" => leaflet_options.to_h,
|
|
@@ -1,6 +1,28 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module GeoblacklightHelper
|
|
4
|
+
include Blacklight::LayoutHelperBehavior
|
|
5
|
+
|
|
6
|
+
# Let the facets take up more space for the locator map
|
|
7
|
+
def sidebar_classes
|
|
8
|
+
"page-sidebar col-lg-4 order-first"
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# Make the search results take up less space so the facets can take more
|
|
12
|
+
def main_content_classes
|
|
13
|
+
"col-lg-8"
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Needed so we keep the defaults instead of using sidebar_classes
|
|
17
|
+
def show_sidebar_classes
|
|
18
|
+
"page-sidebar col-lg-3"
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# Needed so we keep the defaults instead of using main_content_classes
|
|
22
|
+
def show_content_classes
|
|
23
|
+
"col-lg-9 show-document"
|
|
24
|
+
end
|
|
25
|
+
|
|
4
26
|
def document_available?(document)
|
|
5
27
|
document.public? || (document.same_institution? && user_signed_in?)
|
|
6
28
|
end
|
|
@@ -34,60 +56,15 @@ module GeoblacklightHelper
|
|
|
34
56
|
t "geoblacklight.references.#{reference}"
|
|
35
57
|
end
|
|
36
58
|
|
|
37
|
-
##
|
|
38
|
-
# Render value for a document's field as a truncate abstract
|
|
39
|
-
# div. Arguments come from Blacklight::DocumentPresenter's
|
|
40
|
-
# get_field_values method
|
|
41
|
-
# @param [Hash] args from get_field_values
|
|
42
|
-
def render_value_as_truncate_abstract(args)
|
|
43
|
-
tag.div class: "truncate-abstract", data: {
|
|
44
|
-
read_more_text: t("geoblacklight.truncate.read_more"),
|
|
45
|
-
close_text: t("geoblacklight.truncate.close")
|
|
46
|
-
} do
|
|
47
|
-
Array(args[:value]).flatten.collect { |v| concat tag.p(v) }
|
|
48
|
-
end
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
##
|
|
52
|
-
# Selects the basemap used for map displays
|
|
53
|
-
# @return [String]
|
|
54
|
-
def geoblacklight_basemap
|
|
55
|
-
blacklight_config.basemap_provider || "positron"
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
##
|
|
59
|
-
# Renders the transformed metadata
|
|
60
|
-
# (Renders a partial when the metadata isn't available)
|
|
61
|
-
# @param [Geoblacklight::Metadata::Base] metadata the metadata object
|
|
62
|
-
# @return [String]
|
|
63
|
-
def render_transformed_metadata(metadata)
|
|
64
|
-
render partial: "catalog/metadata/content", locals: {content: metadata.transform.html_safe}
|
|
65
|
-
rescue Geoblacklight::MetadataTransformer::TransformError => transform_err
|
|
66
|
-
Geoblacklight.logger.warn transform_err.message
|
|
67
|
-
render partial: "catalog/metadata/markup", locals: {content: metadata.to_xml}
|
|
68
|
-
rescue => err
|
|
69
|
-
Geoblacklight.logger.warn err.message
|
|
70
|
-
render partial: "catalog/metadata/missing"
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
##
|
|
74
|
-
# Determines whether or not the metadata is the first within the array of References
|
|
75
|
-
# @param [SolrDocument] document the Solr Document for the item
|
|
76
|
-
# @param [Geoblacklight::Metadata::Base] metadata the object for the metadata resource
|
|
77
|
-
# @return [Boolean]
|
|
78
|
-
def first_metadata?(document, metadata)
|
|
79
|
-
document.references.shown_metadata.first.type == metadata.type
|
|
80
|
-
end
|
|
81
|
-
|
|
82
59
|
##
|
|
83
60
|
# Renders a reference url for a document
|
|
84
61
|
# @param [Hash] document, field_name
|
|
85
62
|
def render_references_url(args)
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
)
|
|
63
|
+
url = args[:document]&.references&.url
|
|
64
|
+
return unless url
|
|
65
|
+
|
|
66
|
+
endpoint = url.endpoint
|
|
67
|
+
link_to(endpoint, endpoint)
|
|
91
68
|
end
|
|
92
69
|
|
|
93
70
|
## Returns the data-page attribute value used as the JS map selector
|
|
@@ -34,6 +34,7 @@ export default class LeafletViewerController extends Controller {
|
|
|
34
34
|
available: Boolean,
|
|
35
35
|
options: Object,
|
|
36
36
|
basemap: String,
|
|
37
|
+
darkBasemap: String,
|
|
37
38
|
mapGeom: Object,
|
|
38
39
|
page: String,
|
|
39
40
|
layerId: String,
|
|
@@ -44,6 +45,10 @@ export default class LeafletViewerController extends Controller {
|
|
|
44
45
|
// Use leaflet icon images from CDN
|
|
45
46
|
Icon.Default.imagePath = "https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/images/"
|
|
46
47
|
|
|
48
|
+
// The map can be turbo-permanent; if we're reconnected but the map already
|
|
49
|
+
// exists, no need to destroy and recreate the layers and controls.
|
|
50
|
+
if (this.map) return
|
|
51
|
+
|
|
47
52
|
// Set up layers
|
|
48
53
|
this.basemap = this.getBasemap()
|
|
49
54
|
this.overlay = layerGroup()
|
|
@@ -54,6 +59,13 @@ export default class LeafletViewerController extends Controller {
|
|
|
54
59
|
|
|
55
60
|
// Load the map
|
|
56
61
|
this.loadMap()
|
|
62
|
+
|
|
63
|
+
// Check for changes to dark/light mode and update the basemap accordingly
|
|
64
|
+
const observer = new MutationObserver(() => {
|
|
65
|
+
this.map.removeLayer(this.basemap)
|
|
66
|
+
this.map.addLayer(this.getBasemap())
|
|
67
|
+
})
|
|
68
|
+
observer.observe(document.documentElement, { attributes: true, attributeFilter: ["data-bs-theme"] })
|
|
57
69
|
}
|
|
58
70
|
|
|
59
71
|
// Create the map, add layers, fit the bounds
|
|
@@ -103,11 +115,14 @@ export default class LeafletViewerController extends Controller {
|
|
|
103
115
|
this.element.dataset.bounds = this.bounds.toBBoxString()
|
|
104
116
|
}
|
|
105
117
|
|
|
106
|
-
// Select the configured
|
|
118
|
+
// Select the configured basemaps to use
|
|
107
119
|
getBasemap() {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
120
|
+
if (document.documentElement.getAttribute("data-bs-theme") === "dark")
|
|
121
|
+
this.basemapName = this.darkBasemapValue || "dark_matter"
|
|
122
|
+
else this.basemapName = this.basemapValue || "positron"
|
|
123
|
+
|
|
124
|
+
return tileLayer(basemaps[this.basemapName].url, {
|
|
125
|
+
...basemaps[this.basemapName],
|
|
111
126
|
detectRetina: this.optionsValue.layers.detect_retina || false,
|
|
112
127
|
})
|
|
113
128
|
}
|
|
@@ -13,6 +13,7 @@ export default class OpenlayersViewerController extends Controller {
|
|
|
13
13
|
url: String,
|
|
14
14
|
protocol: String,
|
|
15
15
|
basemap: String,
|
|
16
|
+
darkBasemap: String,
|
|
16
17
|
mapGeom: String,
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -24,6 +25,10 @@ export default class OpenlayersViewerController extends Controller {
|
|
|
24
25
|
await this.getBounds()
|
|
25
26
|
// Load the map
|
|
26
27
|
this.loadMap()
|
|
28
|
+
|
|
29
|
+
// Check for changes to dark/light mode and update the basemap accordingly
|
|
30
|
+
const observer = new MutationObserver(() => this.map.getLayers().setAt(0, this.getBasemap()))
|
|
31
|
+
observer.observe(document.documentElement, { attributes: true, attributeFilter: ["data-bs-theme"] })
|
|
27
32
|
}
|
|
28
33
|
|
|
29
34
|
// Create the map, add layers, and fit the bounds
|
|
@@ -52,8 +57,11 @@ export default class OpenlayersViewerController extends Controller {
|
|
|
52
57
|
|
|
53
58
|
// Select the configured basemap to use
|
|
54
59
|
getBasemap() {
|
|
55
|
-
|
|
56
|
-
|
|
60
|
+
if (document.documentElement.getAttribute("data-bs-theme") === "dark")
|
|
61
|
+
this.basemapName = this.darkBasemapValue || "dark_matter"
|
|
62
|
+
else this.basemapName = this.basemapValue || "positron"
|
|
63
|
+
|
|
64
|
+
const layer = new TileLayer({ source: new XYZ(basemaps[this.basemapName]) })
|
|
57
65
|
return layer
|
|
58
66
|
}
|
|
59
67
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
|
|
2
|
+
dark_matter: {
|
|
3
3
|
url: "https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{retina}.png",
|
|
4
4
|
attribution:
|
|
5
5
|
'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, © <a href="http://carto.com/attributions">Carto</a>',
|
|
@@ -15,7 +15,7 @@ export default {
|
|
|
15
15
|
worldCopyJump: true,
|
|
16
16
|
retina: "@2x",
|
|
17
17
|
},
|
|
18
|
-
|
|
18
|
+
positron_lite: {
|
|
19
19
|
url: "https://{s}.basemaps.cartocdn.com/light_nolabels/{z}/{x}/{y}{retina}.png",
|
|
20
20
|
attribution:
|
|
21
21
|
'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, © <a href="http://carto.com/attributions">Carto</a>',
|
|
@@ -23,7 +23,7 @@ export default {
|
|
|
23
23
|
worldCopyJump: true,
|
|
24
24
|
retina: "@2x",
|
|
25
25
|
},
|
|
26
|
-
|
|
26
|
+
world_antique: {
|
|
27
27
|
url: "https://cartocdn_{s}.global.ssl.fastly.net/base-antique/{z}/{x}/{y}{retina}.png",
|
|
28
28
|
attribution:
|
|
29
29
|
'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, © <a href="http://carto.com/attributions">Carto</a>',
|
|
@@ -31,7 +31,7 @@ export default {
|
|
|
31
31
|
worldCopyJump: true,
|
|
32
32
|
retina: "@2x",
|
|
33
33
|
},
|
|
34
|
-
|
|
34
|
+
world_eco: {
|
|
35
35
|
url: "https://cartocdn_{s}.global.ssl.fastly.net/base-eco/{z}/{x}/{y}{retina}.png",
|
|
36
36
|
attribution:
|
|
37
37
|
'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, © <a href="http://carto.com/attributions">Carto</a>',
|
|
@@ -39,7 +39,7 @@ export default {
|
|
|
39
39
|
worldCopyJump: true,
|
|
40
40
|
retina: "@2x",
|
|
41
41
|
},
|
|
42
|
-
|
|
42
|
+
flat_blue: {
|
|
43
43
|
url: "https://cartocdn_{s}.global.ssl.fastly.net/base-flatblue/{z}/{x}/{y}{retina}.png",
|
|
44
44
|
attribution:
|
|
45
45
|
'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, © <a href="http://carto.com/attributions">Carto</a>',
|
|
@@ -47,7 +47,7 @@ export default {
|
|
|
47
47
|
worldCopyJump: true,
|
|
48
48
|
retina: "@2x",
|
|
49
49
|
},
|
|
50
|
-
|
|
50
|
+
midnight_commander: {
|
|
51
51
|
url: "https://cartocdn_{s}.global.ssl.fastly.net/base-midnight/{z}/{x}/{y}{retina}.png",
|
|
52
52
|
attribution:
|
|
53
53
|
'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, © <a href="http://carto.com/attributions">Carto</a>',
|
|
@@ -55,7 +55,7 @@ export default {
|
|
|
55
55
|
worldCopyJump: true,
|
|
56
56
|
retina: "@2x",
|
|
57
57
|
},
|
|
58
|
-
|
|
58
|
+
openstreetmap_hot: {
|
|
59
59
|
url: "https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png",
|
|
60
60
|
attribution:
|
|
61
61
|
'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>, Tiles courtesy of <a href="http://hot.openstreetmap.org/" target="_blank">Humanitarian OpenStreetMap Team</a>',
|
|
@@ -63,7 +63,7 @@ export default {
|
|
|
63
63
|
worldCopyJump: true,
|
|
64
64
|
retina: "@2x",
|
|
65
65
|
},
|
|
66
|
-
|
|
66
|
+
openstreetmap_standard: {
|
|
67
67
|
url: "https://tile.openstreetmap.org/{z}/{x}/{y}.png",
|
|
68
68
|
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
|
69
69
|
maxZoom: 19,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
|
|
2
|
+
dark_matter: {
|
|
3
3
|
url: "https://{a-d}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png",
|
|
4
4
|
attributions:
|
|
5
5
|
'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, © <a href="http://carto.com/attributionss">Carto</a>',
|
|
@@ -11,43 +11,43 @@ export default {
|
|
|
11
11
|
'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, © <a href="http://carto.com/attributionss">Carto</a>',
|
|
12
12
|
maxZoom: 18,
|
|
13
13
|
},
|
|
14
|
-
|
|
14
|
+
positron_lite: {
|
|
15
15
|
url: "https://{a-d}.basemaps.cartocdn.com/light_nolabels/{z}/{x}/{y}.png",
|
|
16
16
|
attributions:
|
|
17
17
|
'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, © <a href="http://carto.com/attributionss">Carto</a>',
|
|
18
18
|
maxZoom: 18,
|
|
19
19
|
},
|
|
20
|
-
|
|
20
|
+
world_antique: {
|
|
21
21
|
url: "https://cartocdn_{a-d}.global.ssl.fastly.net/base-antique/{z}/{x}/{y}.png",
|
|
22
22
|
attributions:
|
|
23
23
|
'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, © <a href="http://carto.com/attributionss">Carto</a>',
|
|
24
24
|
maxZoom: 18,
|
|
25
25
|
},
|
|
26
|
-
|
|
26
|
+
world_eco: {
|
|
27
27
|
url: "https://cartocdn_{a-d}.global.ssl.fastly.net/base-eco/{z}/{x}/{y}.png",
|
|
28
28
|
attributions:
|
|
29
29
|
'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, © <a href="http://carto.com/attributionss">Carto</a>',
|
|
30
30
|
maxZoom: 18,
|
|
31
31
|
},
|
|
32
|
-
|
|
32
|
+
flat_blue: {
|
|
33
33
|
url: "https://cartocdn_{a-d}.global.ssl.fastly.net/base-flatblue/{z}/{x}/{y}.png",
|
|
34
34
|
attributions:
|
|
35
35
|
'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, © <a href="http://carto.com/attributionss">Carto</a>',
|
|
36
36
|
maxZoom: 18,
|
|
37
37
|
},
|
|
38
|
-
|
|
38
|
+
midnight_commander: {
|
|
39
39
|
url: "https://cartocdn_{a-d}.global.ssl.fastly.net/base-midnight/{z}/{x}/{y}.png",
|
|
40
40
|
attributions:
|
|
41
41
|
'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, © <a href="http://carto.com/attributionss">Carto</a>',
|
|
42
42
|
maxZoom: 18,
|
|
43
43
|
},
|
|
44
|
-
|
|
44
|
+
openstreetmap_hot: {
|
|
45
45
|
url: "https://{a-c}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png",
|
|
46
46
|
attributions:
|
|
47
47
|
'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>, Tiles courtesy of <a href="http://hot.openstreetmap.org/" target="_blank">Humanitarian OpenStreetMap Team</a>',
|
|
48
48
|
maxZoom: 19,
|
|
49
49
|
},
|
|
50
|
-
|
|
50
|
+
openstreetmap_standard: {
|
|
51
51
|
url: "https://tile.openstreetmap.org/{z}/{x}/{y}.png",
|
|
52
52
|
attributions: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
|
53
53
|
maxZoom: 19,
|
|
@@ -29,6 +29,7 @@ module Geoblacklight
|
|
|
29
29
|
attribute :identifiers, :array, field_config.identifier
|
|
30
30
|
attribute :issued, :string, field_config.date_issued
|
|
31
31
|
attribute :format, :string, field_config.format
|
|
32
|
+
attribute :georeferenced?, :boolean, field_config.georeferenced
|
|
32
33
|
end
|
|
33
34
|
|
|
34
35
|
def available?
|
|
@@ -47,6 +48,14 @@ module Geoblacklight
|
|
|
47
48
|
(direct_download || iiif_download) && available?
|
|
48
49
|
end
|
|
49
50
|
|
|
51
|
+
def iiif_preview?
|
|
52
|
+
viewer_protocol == "iiif" || viewer_protocol == "iiif_manifest"
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def previewable?
|
|
56
|
+
viewer_endpoint.present?
|
|
57
|
+
end
|
|
58
|
+
|
|
50
59
|
def references
|
|
51
60
|
References.new(self)
|
|
52
61
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<div class="row">
|
|
2
2
|
<div
|
|
3
3
|
id="documents"
|
|
4
|
-
class="documents-list
|
|
4
|
+
class="documents-list"
|
|
5
5
|
data-controller="search-results"
|
|
6
6
|
data-action="leaflet-viewer:loaded@window->search-results#fitResultBounds"
|
|
7
7
|
data-search-results-leaflet-viewer-outlet=".leaflet-viewer"
|
|
@@ -13,9 +13,4 @@
|
|
|
13
13
|
<% end %>
|
|
14
14
|
</div>
|
|
15
15
|
</div>
|
|
16
|
-
<% if results_js_map_selector(controller.controller_name) == "index" %>
|
|
17
|
-
<%= render(Geoblacklight::LocationLeafletMapComponent.new(page: 'index', geosearch: { dynamic: true }, classes: 'col-md-6 sticky-top position-sticky leaflet-viewer border')) %>
|
|
18
|
-
<% else %>
|
|
19
|
-
<%= render(Geoblacklight::LocationLeafletMapComponent.new(page: 'index', classes: 'col-md-6 leaflet-viewer border')) %>
|
|
20
|
-
<% end %>
|
|
21
16
|
</div>
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
</div>
|
|
24
24
|
<div class="col-sm">
|
|
25
25
|
<%= content_tag :h3, t('geoblacklight.home.map_heading') %>
|
|
26
|
-
<%= render(Geoblacklight::LocationLeafletMapComponent.new(page: 'home', geosearch: { dynamic: false }
|
|
26
|
+
<%= render(Geoblacklight::LocationLeafletMapComponent.new(page: 'home', geosearch: { dynamic: false })) %>
|
|
27
27
|
</div>
|
|
28
28
|
</div>
|
|
29
29
|
</div>
|
data/geoblacklight.gemspec
CHANGED
|
@@ -20,12 +20,13 @@ Gem::Specification.new do |spec|
|
|
|
20
20
|
|
|
21
21
|
spec.add_dependency "rails", ">= 8", "< 9"
|
|
22
22
|
spec.add_dependency "blacklight", ">= 8.0", "< 10"
|
|
23
|
+
spec.add_dependency "commonmarker", "~> 2.9"
|
|
23
24
|
spec.add_dependency "config"
|
|
24
25
|
spec.add_dependency "faraday", "~> 2.0"
|
|
25
26
|
spec.add_dependency "faraday-follow_redirects"
|
|
26
27
|
spec.add_dependency "coderay"
|
|
27
28
|
spec.add_dependency "deprecation"
|
|
28
|
-
spec.add_dependency "geo_combine", "~> 0.
|
|
29
|
+
spec.add_dependency "geo_combine", "~> 0.11"
|
|
29
30
|
spec.add_dependency "mime-types"
|
|
30
31
|
spec.add_dependency "rgeo-geojson"
|
|
31
32
|
|
|
@@ -86,6 +86,23 @@ class CatalogController < ApplicationController
|
|
|
86
86
|
|
|
87
87
|
# FACETS
|
|
88
88
|
|
|
89
|
+
# GEOBLACKLIGHT APPLICATION FACETS
|
|
90
|
+
|
|
91
|
+
# Map-Based "Search Here" Feature
|
|
92
|
+
# component: - Defines how the facet appears in the sidebar
|
|
93
|
+
# item_presenter - Defines how the facet values appear in the constraints section
|
|
94
|
+
# filter_query_builder - Defines the query generated for Solr
|
|
95
|
+
# filter_class - Defines how to add/remove facet from query
|
|
96
|
+
# label - Defines the label used for the facet
|
|
97
|
+
config.add_facet_field field_config.geometry, component: Geoblacklight::Facets::BboxFieldComponent,
|
|
98
|
+
item_presenter: Geoblacklight::BboxItemPresenter,
|
|
99
|
+
filter_class: Geoblacklight::BboxFilterField,
|
|
100
|
+
filter_query_builder: Geoblacklight::BboxFilterQuery,
|
|
101
|
+
within_boost: gbl_config.bbox_within_boost,
|
|
102
|
+
overlap_boost: gbl_config.overlap_ratio_boost,
|
|
103
|
+
overlap_field: field_config.overlap_field,
|
|
104
|
+
label: "Bounding Box"
|
|
105
|
+
|
|
89
106
|
# DEFAULT FACETS
|
|
90
107
|
config.add_facet_field field_config.index_year, label: "Year", limit: 10
|
|
91
108
|
config.add_facet_field field_config.spatial_coverage, label: "Place", limit: 8
|
|
@@ -100,20 +117,9 @@ class CatalogController < ApplicationController
|
|
|
100
117
|
config.add_facet_field field_config.provider, label: "Provider", limit: 8
|
|
101
118
|
config.add_facet_field field_config.georeferenced, label: "Georeferenced", limit: 3
|
|
102
119
|
|
|
103
|
-
#
|
|
104
|
-
|
|
105
|
-
#
|
|
106
|
-
# item_presenter - Defines how the facet appears in the GBL UI
|
|
107
|
-
# filter_query_builder - Defines the query generated for Solr
|
|
108
|
-
# filter_class - Defines how to add/remove facet from query
|
|
109
|
-
# label - Defines the label used in contstraints container
|
|
110
|
-
config.add_facet_field field_config.geometry, item_presenter: Geoblacklight::BboxItemPresenter,
|
|
111
|
-
filter_class: Geoblacklight::BboxFilterField,
|
|
112
|
-
filter_query_builder: Geoblacklight::BboxFilterQuery,
|
|
113
|
-
within_boost: gbl_config.bbox_within_boost,
|
|
114
|
-
overlap_boost: gbl_config.overlap_ratio_boost,
|
|
115
|
-
overlap_field: field_config.overlap_field,
|
|
116
|
-
label: "Bounding Box"
|
|
120
|
+
# If you wish to add a date range filter, first run `bundle add blacklight_range_limit && bin/rails generate blacklight_range_limit:install`
|
|
121
|
+
# Then uncomment the following line:
|
|
122
|
+
# config.add_facet_field field_config.index_year, label: "Date", range: true
|
|
117
123
|
|
|
118
124
|
# Item Relationship Facets
|
|
119
125
|
# * Not displayed to end user (show: false)
|
|
@@ -152,6 +158,7 @@ class CatalogController < ApplicationController
|
|
|
152
158
|
# item_prop: [String] property given to span with Schema.org item property
|
|
153
159
|
# link_to_search: [Boolean] that can be passed to link to a facet search
|
|
154
160
|
# helper_method: [Symbol] method that can be used to render the value
|
|
161
|
+
# component: [ViewComponent::Base] component that can be used to render the field
|
|
155
162
|
|
|
156
163
|
# DEFAULT FIELDS
|
|
157
164
|
# The following fields all feature string values. If there is a value present in the metadata, they fields will show up on the item show page.
|
|
@@ -160,7 +167,7 @@ class CatalogController < ApplicationController
|
|
|
160
167
|
config.add_show_field field_config.alternative_title, label: "Alternative Title",
|
|
161
168
|
itemprop: "alt_title"
|
|
162
169
|
config.add_show_field field_config.description, label: "Description", itemprop: "description",
|
|
163
|
-
|
|
170
|
+
component: Geoblacklight::MetadataDescriptionMarkdownComponent
|
|
164
171
|
config.add_show_field field_config.creator, label: "Creator", itemprop: "creator"
|
|
165
172
|
config.add_show_field field_config.publisher, label: "Publisher", itemprop: "publisher"
|
|
166
173
|
config.add_show_field field_config.provider, label: "Provider", link_to_facet: true
|
|
@@ -327,21 +334,6 @@ class CatalogController < ApplicationController
|
|
|
327
334
|
config.add_show_tools_partial :web_services, component: Geoblacklight::WebServicesLinkComponent,
|
|
328
335
|
if: proc { |_context, _config, options| options[:document] && (gbl_config.webservices_shown & options[:document].references.refs.map(&:type).map(&:to_s)).any? }
|
|
329
336
|
|
|
330
|
-
# Configure basemap provider for GeoBlacklight maps (uses https only basemap
|
|
331
|
-
# providers with open licenses)
|
|
332
|
-
# Valid basemaps include:
|
|
333
|
-
# 'positron'
|
|
334
|
-
# 'darkMatter'
|
|
335
|
-
# 'positronLite'
|
|
336
|
-
# 'worldAntique'
|
|
337
|
-
# 'worldEco'
|
|
338
|
-
# 'flatBlue'
|
|
339
|
-
# 'midnightCommander'
|
|
340
|
-
# 'openstreetmapHot'
|
|
341
|
-
# 'openstreetmapStandard'
|
|
342
|
-
|
|
343
|
-
config.basemap_provider = "positron"
|
|
344
|
-
|
|
345
337
|
# Configuration for autocomplete suggestor
|
|
346
338
|
config.autocomplete_enabled = true
|
|
347
339
|
config.autocomplete_path = "suggest"
|
|
@@ -9,8 +9,9 @@ module Geoblacklight
|
|
|
9
9
|
attr_accessor :bounds_overlay, :controls
|
|
10
10
|
|
|
11
11
|
attr_reader :sleep, :layers
|
|
12
|
-
|
|
13
|
-
attribute
|
|
12
|
+
|
|
13
|
+
# set to false to display attribute table as a separate panel below the map
|
|
14
|
+
attribute :sidebar, :boolean, default: true
|
|
14
15
|
attribute :selected_color, :string, default: "#2C7FB8"
|
|
15
16
|
|
|
16
17
|
DEFAULT_SLEEP_CONFIG = {
|
|
@@ -19,7 +19,6 @@ module Geoblacklight
|
|
|
19
19
|
assign(config, :display_notes_shown, build_display_notes)
|
|
20
20
|
assign(config, :institution, settings.INSTITUTION)
|
|
21
21
|
assign(config, :help_text, settings.HELP_TEXT&.to_h)
|
|
22
|
-
assign(config, :sidebar_static_map, settings.SIDEBAR_STATIC_MAP)
|
|
23
22
|
assign(config, :iiif_drag_drop_link, settings.IIIF_DRAG_DROP_LINK)
|
|
24
23
|
assign(config, :homepage_map_geom, settings.HOMEPAGE_MAP_GEOM)
|
|
25
24
|
assign(config, :metadata_shown, settings.METADATA_SHOWN)
|