geoblacklight 5.3.0 → 5.4.0
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/app/components/geoblacklight/document/sidebar_component.html.erb +3 -0
- data/app/components/geoblacklight/document/sidebar_component.rb +7 -0
- data/app/components/geoblacklight/download_links_component.html.erb +3 -0
- data/app/components/geoblacklight/download_links_component.rb +1 -1
- data/app/components/geoblacklight/item_map_viewer_component.rb +2 -2
- data/app/components/geoblacklight/location_leaflet_map_component.rb +2 -2
- data/app/components/geoblacklight/relations_component.html.erb +1 -1
- data/app/components/geoblacklight/static_map_component.rb +2 -2
- data/app/controllers/download_controller.rb +6 -0
- data/app/controllers/relation_controller.rb +1 -1
- data/app/helpers/geoblacklight_helper.rb +31 -3
- data/app/javascript/geoblacklight/controllers/leaflet_viewer_controller.js +18 -3
- data/app/javascript/geoblacklight/controllers/openlayers_viewer_controller.js +33 -2
- data/app/javascript/geoblacklight/leaflet/basemaps.js +0 -32
- data/app/javascript/geoblacklight/leaflet/inspection.js +5 -4
- data/app/javascript/geoblacklight/openlayers/basemaps.js +0 -20
- data/app/javascript/geoblacklight/openlayers/layers.js +1 -1
- data/app/models/concerns/geoblacklight/solr_document.rb +19 -2
- data/app/views/catalog/_metadata.html.erb +3 -0
- data/geoblacklight.gemspec +2 -2
- data/lib/generators/geoblacklight/templates/catalog_controller.rb +4 -5
- data/lib/generators/geoblacklight/templates/settings.yml +19 -0
- data/lib/geoblacklight/deprecated_configuration.rb +665 -0
- data/lib/geoblacklight/download.rb +3 -0
- data/lib/geoblacklight/engine.rb +13 -0
- data/lib/geoblacklight/references.rb +6 -1
- data/lib/geoblacklight/relation/ancestors.rb +3 -0
- data/lib/geoblacklight/relation/descendants.rb +3 -0
- data/lib/geoblacklight/relation/relation_response.rb +4 -1
- data/lib/geoblacklight/version.rb +1 -1
- data/lib/geoblacklight.rb +16 -0
- data/lib/tasks/geoblacklight.rake +9 -0
- data/package.json +1 -1
- data/solr/conf/solrconfig.xml +10 -10
- data/spec/features/configurable_basemap_spec.rb +68 -0
- data/spec/features/relations_spec.rb +2 -3
- data/spec/lib/geoblacklight/deprecated_configuration_spec.rb +680 -0
- data/spec/solr_config_spec.rb +41 -0
- data/spec/spec_helper.rb +24 -1
- metadata +12 -9
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1ece9d6b515fa64010cbc158c72b17ae35e019a842e83700e68650f7d6cb0a98
|
|
4
|
+
data.tar.gz: 268d83c2130ce59ac765ec0764164e3c081d7e62beedfe8494968ce8a74ba22c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ee73a4e5fb22a94dd6b0f6010ec8259b360ebec2b99c007545b1bfedecc52a9e4296eee9d40af1d125d8771e11d15d9997bd9c8ac3deec5d05630fac542c0cad
|
|
7
|
+
data.tar.gz: e8658148c4a9289b38ed5258ad50b9538f8fea43d2d1733d0d05bf46fa0fe5e1868c291f62d0a771d3f3165b829d109fff5d6700e06638c871fe15c444bf38b7
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
<%# Rendered by GeoBlacklight itself, so the deprecated methods it calls are silenced here; an application that overrides them still gets warned when it calls them. %>
|
|
2
|
+
<% Geoblacklight.deprecation.silence do %>
|
|
1
3
|
<%= render_static_map_component %>
|
|
2
4
|
<%= render_show_tools %>
|
|
3
5
|
|
|
@@ -10,3 +12,4 @@
|
|
|
10
12
|
<%= render_more_like_this %>
|
|
11
13
|
|
|
12
14
|
<%= render "relations_container", document: document %>
|
|
15
|
+
<% end %>
|
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
module Geoblacklight
|
|
4
4
|
module Document
|
|
5
5
|
class SidebarComponent < Blacklight::Document::SidebarComponent
|
|
6
|
+
# @deprecated
|
|
6
7
|
def render_static_map_component
|
|
7
8
|
render Geoblacklight::StaticMapComponent.new(document:)
|
|
8
9
|
end
|
|
9
10
|
|
|
11
|
+
# @deprecated
|
|
10
12
|
def sidebar_buttons
|
|
11
13
|
[
|
|
12
14
|
Geoblacklight::WebServicesLinkComponent.new(document:),
|
|
@@ -15,9 +17,14 @@ module Geoblacklight
|
|
|
15
17
|
]
|
|
16
18
|
end
|
|
17
19
|
|
|
20
|
+
# @deprecated
|
|
18
21
|
def render_more_like_this
|
|
19
22
|
render Blacklight::Document::MoreLikeThisComponent.new(document:)
|
|
20
23
|
end
|
|
24
|
+
Geoblacklight.deprecation.deprecate_methods(Geoblacklight::Document::SidebarComponent,
|
|
25
|
+
render_static_map_component: "GeoBlacklight 6 builds the sidebar from a single #panels method",
|
|
26
|
+
sidebar_buttons: "GeoBlacklight 6 builds the sidebar from a single #panels method",
|
|
27
|
+
render_more_like_this: "GeoBlacklight 6 builds the sidebar from a single #panels method")
|
|
21
28
|
end
|
|
22
29
|
end
|
|
23
30
|
end
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
<%# Removed in GeoBlacklight 6. The deprecated download API it calls is silenced here so that a stock application is not warned once per request. %>
|
|
2
|
+
<% Geoblacklight.deprecation.silence do %>
|
|
1
3
|
<div data-controller="downloads" class="downloads-sidebar">
|
|
2
4
|
<%# the dropdown-toggle class gives us the little arrow %>
|
|
3
5
|
<button type="button" class="btn btn-primary dropdown-toggle sidebar-btn" id="downloads-button" data-bs-toggle="collapse" data-bs-target="#downloads-collapse" aria-expanded="false" aria-controls="downloads-collapse">
|
|
@@ -29,3 +31,4 @@
|
|
|
29
31
|
</div>
|
|
30
32
|
</div>
|
|
31
33
|
</div>
|
|
34
|
+
<% end %>
|
|
@@ -11,7 +11,7 @@ module Geoblacklight
|
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
def render?
|
|
14
|
-
downloadable? && (document.direct_download.present? || document.iiif_download.present? || document.download_types.present?)
|
|
14
|
+
Geoblacklight.deprecation.silence { downloadable? && (document.direct_download.present? || document.iiif_download.present? || document.download_types.present?) }
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
def downloadable?
|
|
@@ -84,12 +84,12 @@ module Geoblacklight
|
|
|
84
84
|
data: {
|
|
85
85
|
"controller" => viewer_name,
|
|
86
86
|
"#{viewer_name}-available-value" => helpers.document_available?(@document),
|
|
87
|
-
"#{viewer_name}-basemap-value" => helpers.geoblacklight_basemap,
|
|
87
|
+
"#{viewer_name}-basemap-value" => Geoblacklight.deprecation.silence { helpers.geoblacklight_basemap },
|
|
88
88
|
"#{viewer_name}-protocol-value" => protocol,
|
|
89
89
|
"#{viewer_name}-url-value" => @document.viewer_endpoint,
|
|
90
90
|
"#{viewer_name}-map-geom-value" => @document.geometry.geojson,
|
|
91
91
|
"#{viewer_name}-layer-id-value" => @document.wxs_identifier,
|
|
92
|
-
"#{viewer_name}-options-value" => helpers.leaflet_options,
|
|
92
|
+
"#{viewer_name}-options-value" => Geoblacklight.deprecation.silence { helpers.leaflet_options },
|
|
93
93
|
"#{viewer_name}-page-value" => params[:action]&.upcase,
|
|
94
94
|
"#{viewer_name}-draw-initial-bounds-value" => true
|
|
95
95
|
}.compact)
|
|
@@ -26,7 +26,7 @@ module Geoblacklight
|
|
|
26
26
|
|
|
27
27
|
# Add top-level geosearch control to leaflet options if configured
|
|
28
28
|
def leaflet_options
|
|
29
|
-
options = helpers.leaflet_options.deep_dup
|
|
29
|
+
options = Geoblacklight.deprecation.silence { helpers.leaflet_options }.deep_dup
|
|
30
30
|
options["CONTROLS"] = {"Geosearch" => @geosearch} if @geosearch
|
|
31
31
|
options.to_json
|
|
32
32
|
end
|
|
@@ -37,7 +37,7 @@ module Geoblacklight
|
|
|
37
37
|
class: @classes,
|
|
38
38
|
data: {
|
|
39
39
|
"controller" => "leaflet-viewer",
|
|
40
|
-
"leaflet-viewer-basemap-value" => helpers.geoblacklight_basemap,
|
|
40
|
+
"leaflet-viewer-basemap-value" => Geoblacklight.deprecation.silence { helpers.geoblacklight_basemap },
|
|
41
41
|
"leaflet-viewer-map-geom-value" => search_bbox || @map_geometry,
|
|
42
42
|
"leaflet-viewer-data-map-value" => @data_map,
|
|
43
43
|
"leaflet-viewer-page-value" => params[:action]&.upcase,
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<% relationship_type_results['docs'][0..2].map { |hash| SolrDocument.new(hash) }.each do |doc| %>
|
|
8
8
|
<li class="list-group-item border-bottom-0">
|
|
9
9
|
<%= link_to solr_document_path(doc) do %>
|
|
10
|
-
<%= helpers.relations_icon(doc, rel_type_info.icon) unless rel_type_info.icon.nil? %>
|
|
10
|
+
<%= Geoblacklight.deprecation.silence { helpers.relations_icon(doc, rel_type_info.icon) } unless rel_type_info.icon.nil? %>
|
|
11
11
|
<%= doc.title %>
|
|
12
12
|
<% end %>
|
|
13
13
|
</li>
|
|
@@ -18,13 +18,13 @@ module Geoblacklight
|
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
def viewer_tag
|
|
21
|
-
leaflet_options = helpers.leaflet_options.deep_dup
|
|
21
|
+
leaflet_options = Geoblacklight.deprecation.silence { helpers.leaflet_options }.deep_dup
|
|
22
22
|
leaflet_options.SLEEP.SLEEP = false
|
|
23
23
|
tag.div(nil,
|
|
24
24
|
id: "static-map",
|
|
25
25
|
data: {
|
|
26
26
|
"controller" => "leaflet-viewer",
|
|
27
|
-
"leaflet-viewer-basemap-value" => helpers.geoblacklight_basemap,
|
|
27
|
+
"leaflet-viewer-basemap-value" => Geoblacklight.deprecation.silence { helpers.geoblacklight_basemap },
|
|
28
28
|
"leaflet-viewer-page-value" => "STATIC_MAP",
|
|
29
29
|
"leaflet-viewer-map-geom-value" => @document.geometry.geojson,
|
|
30
30
|
"leaflet-viewer-options-value" => leaflet_options,
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
class DownloadController < ApplicationController
|
|
4
|
+
before_action do
|
|
5
|
+
Geoblacklight.deprecation.warn(
|
|
6
|
+
"DownloadController is deprecated; GeoBlacklight 6 removes the generated download subsystem: downloads are direct links only, rendered by Geoblacklight::Document::DownloadLinksComponent"
|
|
7
|
+
)
|
|
8
|
+
end
|
|
9
|
+
|
|
4
10
|
# include Blacklight::SearchHelper
|
|
5
11
|
include Blacklight::Catalog
|
|
6
12
|
|
|
@@ -6,7 +6,7 @@ class RelationController < ApplicationController
|
|
|
6
6
|
copy_blacklight_config_from(CatalogController)
|
|
7
7
|
|
|
8
8
|
def index
|
|
9
|
-
@relations = Geoblacklight::Relation::RelationResponse.new(params[:id], repository)
|
|
9
|
+
@relations = Geoblacklight.deprecation.silence { Geoblacklight::Relation::RelationResponse.new(params[:id], repository) }
|
|
10
10
|
render layout: !request.xhr?
|
|
11
11
|
end
|
|
12
12
|
|
|
@@ -9,6 +9,7 @@ module GeoblacklightHelper
|
|
|
9
9
|
# Blacklight catalog controller helper method to truncate field value to 150 chars
|
|
10
10
|
# @param [SolrDocument] args
|
|
11
11
|
# @return [String]
|
|
12
|
+
# @deprecated
|
|
12
13
|
def snippit(args)
|
|
13
14
|
truncate(Array(args[:value]).flatten.join(" "), length: 150)
|
|
14
15
|
end
|
|
@@ -40,6 +41,7 @@ module GeoblacklightHelper
|
|
|
40
41
|
# div. Arguments come from Blacklight::DocumentPresenter's
|
|
41
42
|
# get_field_values method
|
|
42
43
|
# @param [Hash] args from get_field_values
|
|
44
|
+
# @deprecated
|
|
43
45
|
def render_value_as_truncate_abstract(args)
|
|
44
46
|
tag.div class: "truncate-abstract" do
|
|
45
47
|
Array(args[:value]).flatten.join(" ")
|
|
@@ -49,6 +51,7 @@ module GeoblacklightHelper
|
|
|
49
51
|
##
|
|
50
52
|
# Selects the basemap used for map displays
|
|
51
53
|
# @return [String]
|
|
54
|
+
# @deprecated
|
|
52
55
|
def geoblacklight_basemap
|
|
53
56
|
blacklight_config.basemap_provider || "positron"
|
|
54
57
|
end
|
|
@@ -56,6 +59,7 @@ module GeoblacklightHelper
|
|
|
56
59
|
##
|
|
57
60
|
# Returns a hash of the leaflet plugin settings to pass to the viewer.
|
|
58
61
|
# @return[Hash]
|
|
62
|
+
# @deprecated
|
|
59
63
|
def leaflet_options
|
|
60
64
|
Settings.LEAFLET
|
|
61
65
|
end
|
|
@@ -65,6 +69,7 @@ module GeoblacklightHelper
|
|
|
65
69
|
# (Renders a partial when the metadata isn't available)
|
|
66
70
|
# @param [Geoblacklight::Metadata::Base] metadata the metadata object
|
|
67
71
|
# @return [String]
|
|
72
|
+
# @deprecated
|
|
68
73
|
def render_transformed_metadata(metadata)
|
|
69
74
|
render partial: "catalog/metadata/content", locals: {content: metadata.transform.html_safe}
|
|
70
75
|
rescue Geoblacklight::MetadataTransformer::TransformError => transform_err
|
|
@@ -80,6 +85,7 @@ module GeoblacklightHelper
|
|
|
80
85
|
# @param [SolrDocument] document the Solr Document for the item
|
|
81
86
|
# @param [Geoblacklight::Metadata::Base] metadata the object for the metadata resource
|
|
82
87
|
# @return [Boolean]
|
|
88
|
+
# @deprecated
|
|
83
89
|
def first_metadata?(document, metadata)
|
|
84
90
|
document.references.shown_metadata.first.type == metadata.type
|
|
85
91
|
end
|
|
@@ -96,10 +102,22 @@ module GeoblacklightHelper
|
|
|
96
102
|
end
|
|
97
103
|
|
|
98
104
|
## Returns the icon used based off a Settings strategy
|
|
105
|
+
# @deprecated
|
|
99
106
|
def relations_icon(document, icon)
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
107
|
+
# If configured to use geometry type for relations icon
|
|
108
|
+
if Settings.USE_GEOM_FOR_RELATIONS_ICON
|
|
109
|
+
Geoblacklight.deprecation.warn("USE_GEOM_FOR_RELATIONS_ICON is deprecated and will be removed in GeoBlacklight 6")
|
|
110
|
+
icon_html = render Geoblacklight::HeaderIconsComponent.new(
|
|
111
|
+
document: document,
|
|
112
|
+
fields: [Settings.FIELDS.GEOM_TYPE]
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
# Use geometry-based icon if it's valid (not missing)
|
|
116
|
+
return icon_html unless icon_html.include?("icon-missing")
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Fall back to the default icon
|
|
120
|
+
geoblacklight_icon(icon)
|
|
103
121
|
end
|
|
104
122
|
|
|
105
123
|
## Returns the data-page attribute value used as the JS map selector
|
|
@@ -111,4 +129,14 @@ module GeoblacklightHelper
|
|
|
111
129
|
"index"
|
|
112
130
|
end
|
|
113
131
|
end
|
|
132
|
+
|
|
133
|
+
Geoblacklight.deprecation.deprecate_methods(GeoblacklightHelper,
|
|
134
|
+
snippit: "GeoBlacklight 6 removes it; its catalog_controller template no longer configures a " \
|
|
135
|
+
"truncated description index field",
|
|
136
|
+
render_value_as_truncate_abstract: "use Geoblacklight::MetadataDescriptionMarkdownComponent instead",
|
|
137
|
+
geoblacklight_basemap: "GeoBlacklight 6 reads the basemap from the viewer components themselves",
|
|
138
|
+
leaflet_options: "GeoBlacklight 6 reads the Leaflet options from the viewer components themselves",
|
|
139
|
+
render_transformed_metadata: "use Geoblacklight::MetadataComponent instead",
|
|
140
|
+
first_metadata?: "use Geoblacklight::MetadataComponent instead",
|
|
141
|
+
relations_icon: "use Geoblacklight::Relations::RelationComponent instead")
|
|
114
142
|
end
|
|
@@ -110,13 +110,28 @@ export default class LeafletViewerController extends Controller {
|
|
|
110
110
|
|
|
111
111
|
// Select the configured basemap to use
|
|
112
112
|
getBasemap() {
|
|
113
|
-
const
|
|
114
|
-
return tileLayer(
|
|
115
|
-
...
|
|
113
|
+
const definition = this.basemapDefinition();
|
|
114
|
+
return tileLayer(definition.url, {
|
|
115
|
+
...definition,
|
|
116
116
|
detectRetina: this.optionsValue.LAYERS.DETECT_RETINA || false,
|
|
117
117
|
});
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
+
// The basemap to draw, with any BASEMAPS values from settings.yml merged over
|
|
121
|
+
// the shipped definition. This lets an application change a basemap's URL --
|
|
122
|
+
// to add a CARTO API key, for example -- without restating the rest of the
|
|
123
|
+
// definition, and lets it define basemaps of its own. Falls back to positron
|
|
124
|
+
// for a name that resolves to nothing rather than drawing no basemap.
|
|
125
|
+
basemapDefinition() {
|
|
126
|
+
const name = this.basemapValue || "positron";
|
|
127
|
+
const definition = { ...basemaps[name], ...this.basemapOverrides()[name] };
|
|
128
|
+
return definition.url ? definition : basemaps.positron;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
basemapOverrides() {
|
|
132
|
+
return this.optionsValue.BASEMAPS || {};
|
|
133
|
+
}
|
|
134
|
+
|
|
120
135
|
// Add the configured controls to the map
|
|
121
136
|
addControls() {
|
|
122
137
|
// Add any top-level controls (e.g. geosearch) first
|
|
@@ -14,6 +14,7 @@ export default class OpenlayersViewerController extends Controller {
|
|
|
14
14
|
protocol: String,
|
|
15
15
|
basemap: String,
|
|
16
16
|
mapGeom: String,
|
|
17
|
+
options: Object,
|
|
17
18
|
};
|
|
18
19
|
|
|
19
20
|
async connect() {
|
|
@@ -55,11 +56,41 @@ export default class OpenlayersViewerController extends Controller {
|
|
|
55
56
|
|
|
56
57
|
// Select the configured basemap to use
|
|
57
58
|
getBasemap() {
|
|
58
|
-
const basemap =
|
|
59
|
-
const layer = new TileLayer({
|
|
59
|
+
const basemap = this.basemapDefinition();
|
|
60
|
+
const layer = new TileLayer({
|
|
61
|
+
source: new XYZ({
|
|
62
|
+
...basemap,
|
|
63
|
+
url: this.normalizeUrl(basemap.url),
|
|
64
|
+
// The leaflet definitions spell this `attribution`; OpenLayers wants
|
|
65
|
+
// `attributions`. Accept either so one setting serves both viewers.
|
|
66
|
+
attributions: basemap.attributions || basemap.attribution,
|
|
67
|
+
}),
|
|
68
|
+
});
|
|
60
69
|
return layer;
|
|
61
70
|
}
|
|
62
71
|
|
|
72
|
+
// The basemap to draw, with any BASEMAPS values from settings.yml merged over
|
|
73
|
+
// the shipped definition. This lets an application change a basemap's URL --
|
|
74
|
+
// to add a CARTO API key, for example -- without restating the rest of the
|
|
75
|
+
// definition, and lets it define basemaps of its own. Falls back to positron
|
|
76
|
+
// for a name that resolves to nothing rather than drawing no basemap.
|
|
77
|
+
basemapDefinition() {
|
|
78
|
+
const name = this.basemapValue || "positron";
|
|
79
|
+
const definition = { ...basemaps[name], ...this.basemapOverrides()[name] };
|
|
80
|
+
return definition.url ? definition : basemaps.positron;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
basemapOverrides() {
|
|
84
|
+
return this.optionsValue.BASEMAPS || {};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Leaflet and OpenLayers spell tile URL templates differently, so accept the
|
|
88
|
+
// leaflet form a configured basemap is most likely to be written in: {s}
|
|
89
|
+
// becomes OpenLayers' subdomain range, and {retina} drops out.
|
|
90
|
+
normalizeUrl(url) {
|
|
91
|
+
return url.replace(/\{s\}/g, "{a-d}").replace(/\{retina\}/g, "");
|
|
92
|
+
}
|
|
93
|
+
|
|
63
94
|
// Generate a layer based on the protocol
|
|
64
95
|
getPreviewOverlay(protocol, url) {
|
|
65
96
|
if (protocol === "Pmtiles") return pmTilesLayer(url);
|
|
@@ -23,38 +23,6 @@ export default {
|
|
|
23
23
|
worldCopyJump: true,
|
|
24
24
|
retina: "@2x",
|
|
25
25
|
},
|
|
26
|
-
worldAntique: {
|
|
27
|
-
url: "https://cartocdn_{s}.global.ssl.fastly.net/base-antique/{z}/{x}/{y}{retina}.png",
|
|
28
|
-
attribution:
|
|
29
|
-
'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, © <a href="http://carto.com/attributions">Carto</a>',
|
|
30
|
-
maxZoom: 18,
|
|
31
|
-
worldCopyJump: true,
|
|
32
|
-
retina: "@2x",
|
|
33
|
-
},
|
|
34
|
-
worldEco: {
|
|
35
|
-
url: "https://cartocdn_{s}.global.ssl.fastly.net/base-eco/{z}/{x}/{y}{retina}.png",
|
|
36
|
-
attribution:
|
|
37
|
-
'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, © <a href="http://carto.com/attributions">Carto</a>',
|
|
38
|
-
maxZoom: 18,
|
|
39
|
-
worldCopyJump: true,
|
|
40
|
-
retina: "@2x",
|
|
41
|
-
},
|
|
42
|
-
flatBlue: {
|
|
43
|
-
url: "https://cartocdn_{s}.global.ssl.fastly.net/base-flatblue/{z}/{x}/{y}{retina}.png",
|
|
44
|
-
attribution:
|
|
45
|
-
'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, © <a href="http://carto.com/attributions">Carto</a>',
|
|
46
|
-
maxZoom: 18,
|
|
47
|
-
worldCopyJump: true,
|
|
48
|
-
retina: "@2x",
|
|
49
|
-
},
|
|
50
|
-
midnightCommander: {
|
|
51
|
-
url: "https://cartocdn_{s}.global.ssl.fastly.net/base-midnight/{z}/{x}/{y}{retina}.png",
|
|
52
|
-
attribution:
|
|
53
|
-
'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, © <a href="http://carto.com/attributions">Carto</a>',
|
|
54
|
-
maxZoom: 18,
|
|
55
|
-
worldCopyJump: true,
|
|
56
|
-
retina: "@2x",
|
|
57
|
-
},
|
|
58
26
|
openstreetmapHot: {
|
|
59
27
|
url: "https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png",
|
|
60
28
|
attribution:
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { identifyFeatures } from "esri-leaflet";
|
|
2
|
+
import { polygon, geoJSON, circleMarker, layerGroup } from "leaflet";
|
|
2
3
|
import { appendErrorMessage, appendLoadingMessage, getLayerOpacity, linkify } from "geoblacklight/leaflet/utils";
|
|
3
4
|
|
|
4
5
|
export const wmsInspection = (map, url, layerId, layer) => {
|
|
@@ -66,15 +67,15 @@ export const overlayLayer = (map, data, layer) => {
|
|
|
66
67
|
const color = map.options.selected_color;
|
|
67
68
|
|
|
68
69
|
if (data._latlngs) {
|
|
69
|
-
overlayLayer =
|
|
70
|
+
overlayLayer = polygon(data._latlngs, {color: color, weight: 2, layer: true, fillOpacity: opacity, addToOpacitySlider: true, highlightLayer: true });
|
|
70
71
|
} else {
|
|
71
|
-
overlayLayer =
|
|
72
|
+
overlayLayer = geoJSON(data, {
|
|
72
73
|
color: color,
|
|
73
74
|
opacity: opacity,
|
|
74
75
|
addToOpacitySlider: true,
|
|
75
76
|
highlightLayer: true,
|
|
76
77
|
pointToLayer: function(feature, latlng) {
|
|
77
|
-
return
|
|
78
|
+
return circleMarker(latlng, {
|
|
78
79
|
radius: 8,
|
|
79
80
|
fillColor: color,
|
|
80
81
|
color: color,
|
|
@@ -85,7 +86,7 @@ export const overlayLayer = (map, data, layer) => {
|
|
|
85
86
|
}
|
|
86
87
|
});
|
|
87
88
|
}
|
|
88
|
-
|
|
89
|
+
layerGroup([overlayLayer]).addTo(map);
|
|
89
90
|
}
|
|
90
91
|
|
|
91
92
|
export const tiledMapLayerInspection = (map, layer) => {
|
|
@@ -14,26 +14,6 @@ export default {
|
|
|
14
14
|
attributions: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, © <a href="http://carto.com/attributionss">Carto</a>',
|
|
15
15
|
maxZoom: 18
|
|
16
16
|
},
|
|
17
|
-
worldAntique: {
|
|
18
|
-
url: 'https://cartocdn_{a-d}.global.ssl.fastly.net/base-antique/{z}/{x}/{y}.png',
|
|
19
|
-
attributions: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, © <a href="http://carto.com/attributionss">Carto</a>',
|
|
20
|
-
maxZoom: 18
|
|
21
|
-
},
|
|
22
|
-
worldEco: {
|
|
23
|
-
url: 'https://cartocdn_{a-d}.global.ssl.fastly.net/base-eco/{z}/{x}/{y}.png',
|
|
24
|
-
attributions: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, © <a href="http://carto.com/attributionss">Carto</a>',
|
|
25
|
-
maxZoom: 18
|
|
26
|
-
},
|
|
27
|
-
flatBlue: {
|
|
28
|
-
url: 'https://cartocdn_{a-d}.global.ssl.fastly.net/base-flatblue/{z}/{x}/{y}.png',
|
|
29
|
-
attributions: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, © <a href="http://carto.com/attributionss">Carto</a>',
|
|
30
|
-
maxZoom: 18
|
|
31
|
-
},
|
|
32
|
-
midnightCommander: {
|
|
33
|
-
url: 'https://cartocdn_{a-d}.global.ssl.fastly.net/base-midnight/{z}/{x}/{y}.png',
|
|
34
|
-
attributions: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, © <a href="http://carto.com/attributionss">Carto</a>',
|
|
35
|
-
maxZoom: 18
|
|
36
|
-
},
|
|
37
17
|
openstreetmapHot: {
|
|
38
18
|
url: 'https://{a-c}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png',
|
|
39
19
|
attributions: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>, Tiles courtesy of <a href="http://hot.openstreetmap.org/" target="_blank">Humanitarian OpenStreetMap Team</a>',
|
|
@@ -31,6 +31,22 @@ module Geoblacklight
|
|
|
31
31
|
attribute :format, :string, Settings.FIELDS.FORMAT
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
+
##
|
|
35
|
+
# Warn once per reader name rather than once per document: a search results page
|
|
36
|
+
# would otherwise emit one warning per result, because
|
|
37
|
+
# ActiveSupport::Deprecation does not deduplicate.
|
|
38
|
+
# @param method [Symbol]
|
|
39
|
+
def self.warn_about_url_reader(method)
|
|
40
|
+
@warned_url_readers ||= Set.new
|
|
41
|
+
return unless @warned_url_readers.add?(method)
|
|
42
|
+
|
|
43
|
+
Geoblacklight.deprecation.warn(
|
|
44
|
+
"SolrDocument##{method} is resolved dynamically by Geoblacklight::SolrDocument#method_missing, " \
|
|
45
|
+
"which GeoBlacklight 6 removes; call references.#{method.to_s.delete_suffix("_url")}&.endpoint " \
|
|
46
|
+
"instead"
|
|
47
|
+
)
|
|
48
|
+
end
|
|
49
|
+
|
|
34
50
|
def available?
|
|
35
51
|
public? || same_institution?
|
|
36
52
|
end
|
|
@@ -44,7 +60,7 @@ module Geoblacklight
|
|
|
44
60
|
end
|
|
45
61
|
|
|
46
62
|
def downloadable?
|
|
47
|
-
|
|
63
|
+
Geoblacklight.deprecation.silence { direct_download || download_types.present? || iiif_download } && available?
|
|
48
64
|
end
|
|
49
65
|
|
|
50
66
|
def references
|
|
@@ -101,7 +117,8 @@ module Geoblacklight
|
|
|
101
117
|
|
|
102
118
|
def method_missing(method, *args, &block)
|
|
103
119
|
if /.*_url$/.match?(method.to_s)
|
|
104
|
-
|
|
120
|
+
Geoblacklight::SolrDocument.warn_about_url_reader(method)
|
|
121
|
+
Geoblacklight.deprecation.silence { checked_endpoint(method.to_s.gsub("_url", "")) }
|
|
105
122
|
else
|
|
106
123
|
super
|
|
107
124
|
end
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
<%# Removed in GeoBlacklight 6. The deprecated helpers it calls are silenced here so that a stock application is not warned once per request; Geoblacklight::DeprecatedConfiguration warns at boot if an application overrides it. %>
|
|
2
|
+
<% Geoblacklight.deprecation.silence do %>
|
|
1
3
|
<% document ||= @documents.first %>
|
|
2
4
|
|
|
3
5
|
<div class='metadata-view'>
|
|
@@ -25,3 +27,4 @@
|
|
|
25
27
|
<% end %>
|
|
26
28
|
</div>
|
|
27
29
|
</div>
|
|
30
|
+
<% end %>
|
data/geoblacklight.gemspec
CHANGED
|
@@ -35,11 +35,11 @@ Gem::Specification.new do |spec|
|
|
|
35
35
|
spec.add_development_dependency "rspec-rails"
|
|
36
36
|
spec.add_development_dependency "engine_cart", "~> 2.0"
|
|
37
37
|
spec.add_development_dependency "capybara", ">= 2.5.0"
|
|
38
|
-
spec.add_development_dependency "selenium-webdriver"
|
|
38
|
+
spec.add_development_dependency "selenium-webdriver", ">= 4.11"
|
|
39
39
|
spec.add_development_dependency "factory_bot_rails"
|
|
40
40
|
spec.add_development_dependency "simplecov", "~> 0.22"
|
|
41
41
|
spec.add_development_dependency "foreman"
|
|
42
|
-
spec.add_development_dependency "
|
|
42
|
+
spec.add_development_dependency "standard", "~> 1.56.0"
|
|
43
43
|
spec.add_development_dependency "webmock", "~> 3.14"
|
|
44
44
|
spec.add_development_dependency "database_cleaner"
|
|
45
45
|
spec.add_development_dependency "axe-core-rspec"
|
|
@@ -224,7 +224,7 @@ class CatalogController < ApplicationController
|
|
|
224
224
|
|
|
225
225
|
config.add_search_field "all_fields", label: "All Fields"
|
|
226
226
|
# config.add_search_field 'dct_title_ti', :label => 'Title'
|
|
227
|
-
# config.add_search_field '
|
|
227
|
+
# config.add_search_field 'dct_description_tmi', :label => 'Description'
|
|
228
228
|
|
|
229
229
|
# Now we see how to over-ride Solr request handler defaults, in this
|
|
230
230
|
# case for a BL "search field", which is really a dismax aggregate
|
|
@@ -309,12 +309,11 @@ class CatalogController < ApplicationController
|
|
|
309
309
|
# 'positron'
|
|
310
310
|
# 'darkMatter'
|
|
311
311
|
# 'positronLite'
|
|
312
|
-
# 'worldAntique'
|
|
313
|
-
# 'worldEco'
|
|
314
|
-
# 'flatBlue'
|
|
315
|
-
# 'midnightCommander'
|
|
316
312
|
# 'openstreetmapHot'
|
|
317
313
|
# 'openstreetmapStandard'
|
|
314
|
+
#
|
|
315
|
+
# To change one of these basemaps' tile URLs, or to add a basemap of your
|
|
316
|
+
# own and name it here, set LEAFLET.BASEMAPS in settings.yml
|
|
318
317
|
|
|
319
318
|
config.basemap_provider = "positron"
|
|
320
319
|
|
|
@@ -231,6 +231,25 @@ WMS_PARAMS:
|
|
|
231
231
|
# Settings for leaflet
|
|
232
232
|
LEAFLET:
|
|
233
233
|
MAP:
|
|
234
|
+
# Basemap definitions, keyed by the name config.basemap_provider selects.
|
|
235
|
+
# Anything set here is merged over the basemap GeoBlacklight ships with, so
|
|
236
|
+
# you can change just the url and keep the rest of the definition.
|
|
237
|
+
#
|
|
238
|
+
# CARTO now watermarks raster tiles requested without an API key, which
|
|
239
|
+
# affects the positron, positronLite and darkMatter basemaps. Request a free
|
|
240
|
+
# key at https://carto.com/basemaps/apikey/ and pass it as a key parameter:
|
|
241
|
+
# BASEMAPS:
|
|
242
|
+
# positron:
|
|
243
|
+
# url: 'https://basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png?key=YOUR_KEY'
|
|
244
|
+
# darkMatter:
|
|
245
|
+
# url: 'https://basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png?key=YOUR_KEY'
|
|
246
|
+
#
|
|
247
|
+
# You can also define a basemap of your own here and select it with
|
|
248
|
+
# config.basemap_provider = 'myBasemap' in your CatalogController:
|
|
249
|
+
# myBasemap:
|
|
250
|
+
# url: 'https://tiles.example.edu/{z}/{x}/{y}.png'
|
|
251
|
+
# attribution: 'Tiles courtesy of Example University'
|
|
252
|
+
# maxZoom: 18
|
|
234
253
|
BOUNDSOVERLAY:
|
|
235
254
|
INDEX:
|
|
236
255
|
color: '#3388ff'
|