geoblacklight 4.0.0.pre.alpha.1 → 4.0.0.pre.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE.md +1 -1
- data/.github/workflows/ruby.yml +32 -64
- data/.gitignore +1 -0
- data/.rubocop.yml +6 -6
- data/.rubocop_todo.yml +0 -3
- data/.solr_wrapper +1 -0
- data/README.md +1 -4
- data/Rakefile +0 -1
- data/app/assets/images/blacklight/child-item.svg +3 -0
- data/app/assets/images/blacklight/collections.svg +4 -0
- data/app/assets/images/blacklight/datasets.svg +7 -0
- data/app/assets/images/blacklight/geoblacklight-icons.json +363 -332
- data/app/assets/images/blacklight/imagery.svg +4 -0
- data/app/assets/images/blacklight/maps.svg +4 -0
- data/app/assets/images/blacklight/michigan-state-university.svg +0 -1
- data/app/assets/images/blacklight/parent-item.svg +3 -0
- data/app/assets/images/blacklight/pennsylvania-state-university.svg +0 -1
- data/app/assets/images/blacklight/purdue-university.svg +0 -1
- data/app/assets/images/blacklight/the-ohio-state-university.svg +0 -1
- data/app/assets/images/blacklight/university-of-chicago.svg +0 -1
- data/app/assets/images/blacklight/university-of-colorado-boulder.svg +6 -0
- data/app/assets/images/blacklight/university-of-illinois-urbana-champaign.svg +0 -1
- data/app/assets/images/blacklight/university-of-iowa.svg +0 -1
- data/app/assets/images/blacklight/university-of-maryland.svg +0 -1
- data/app/assets/images/blacklight/university-of-michigan.svg +0 -1
- data/app/assets/images/blacklight/university-of-minnesota.svg +0 -1
- data/app/assets/images/blacklight/university-of-nebraska-lincoln.svg +0 -1
- data/app/assets/images/blacklight/university-of-wisconsin-madison.svg +0 -1
- data/app/assets/images/blacklight/websites.svg +4 -0
- data/app/assets/javascripts/geoblacklight/controls/fullscreen.js +8 -0
- data/app/assets/javascripts/geoblacklight/geoblacklight.js +2 -1
- data/app/assets/javascripts/geoblacklight/viewers/esri.js +1 -0
- data/app/assets/javascripts/geoblacklight/viewers/index_map.js +1 -0
- data/app/assets/javascripts/geoblacklight/viewers/tilejson.js +33 -0
- data/app/assets/javascripts/geoblacklight/viewers/tms.js +2 -2
- data/app/assets/javascripts/geoblacklight/viewers/viewer.js +3 -0
- data/app/assets/javascripts/geoblacklight/viewers/wms.js +2 -2
- data/app/assets/javascripts/geoblacklight/viewers/wmts.js +85 -0
- data/app/assets/javascripts/geoblacklight/viewers/xyz.js +10 -0
- data/app/assets/stylesheets/geoblacklight/geoblacklight.scss +1 -0
- data/app/assets/stylesheets/geoblacklight/modules/_base.scss +0 -1
- data/app/assets/stylesheets/geoblacklight/modules/_styles.scss +5 -1
- data/app/assets/stylesheets/geoblacklight/modules/downloads.scss +20 -47
- data/app/assets/stylesheets/geoblacklight/modules/index_maps.scss +68 -0
- data/app/assets/stylesheets/geoblacklight/modules/item.scss +16 -0
- data/app/assets/stylesheets/geoblacklight/modules/modal.scss +6 -0
- data/app/assets/stylesheets/geoblacklight/modules/sidebar.scss +4 -0
- data/app/components/geoblacklight/icon_facet_item_component.rb +33 -0
- data/app/helpers/geoblacklight_helper.rb +6 -45
- data/app/models/concerns/geoblacklight/bbox_filter_field.rb +45 -0
- data/app/models/concerns/geoblacklight/bbox_filter_query.rb +50 -0
- data/app/models/concerns/geoblacklight/solr_document.rb +1 -1
- data/app/models/concerns/geoblacklight/suppressed_records_search_behavior.rb +26 -0
- data/app/presenters/geoblacklight/bbox_item_presenter.rb +9 -0
- data/app/views/catalog/_downloads_collapse.html.erb +27 -0
- data/app/views/catalog/_header_icons.html.erb +2 -2
- data/app/views/catalog/_index_split_default.html.erb +2 -2
- data/app/views/catalog/_show_default_viewer_container.html.erb +17 -0
- data/app/views/catalog/_show_downloads.html.erb +10 -21
- data/app/views/catalog/_show_sidebar.html.erb +3 -0
- data/app/views/catalog/_show_web_services.html.erb +11 -0
- data/app/views/catalog/_web_services.html.erb +3 -2
- data/app/views/catalog/web_services.html.erb +1 -1
- data/app/views/relation/_relations.html.erb +1 -1
- data/app/views/relation/index.html.erb +1 -1
- data/config/locales/geoblacklight.en.yml +4 -1
- data/geoblacklight.gemspec +6 -6
- data/lib/generators/geoblacklight/install_generator.rb +1 -1
- data/lib/generators/geoblacklight/templates/assets/_customizations.scss +5 -4
- data/lib/generators/geoblacklight/templates/assets/application.scss +0 -3
- data/lib/generators/geoblacklight/templates/catalog_controller.rb +74 -56
- data/lib/generators/geoblacklight/templates/settings.gbl_v1.yml +5 -5
- data/lib/generators/geoblacklight/templates/settings.yml +36 -23
- data/lib/geoblacklight/bounding_box.rb +4 -0
- data/lib/geoblacklight/constants.rb +3 -0
- data/lib/geoblacklight/engine.rb +3 -2
- data/lib/geoblacklight/faraday_middleware/follow_redirects.rb +176 -0
- data/lib/geoblacklight/item_viewer.rb +13 -1
- data/lib/geoblacklight/metadata/base.rb +2 -1
- data/lib/geoblacklight/version.rb +1 -1
- data/lib/geoblacklight/view_helper_override.rb +2 -28
- data/lib/geoblacklight.rb +0 -10
- data/lib/tasks/geoblacklight.rake +1 -1
- data/schema/geoblacklight-schema-aardvark.json +3 -23
- data/solr/conf/schema.xml +37 -43
- data/solr/conf/solrconfig.xml +17 -17
- data/spec/components/geoblacklight/icon_facet_item_component_spec.rb +17 -0
- data/spec/controllers/catalog_controller_spec.rb +1 -1
- data/spec/features/download_layer_spec.rb +31 -14
- data/spec/features/esri_viewer_spec.rb +5 -1
- data/spec/features/full_screen_controll_spec.rb +15 -0
- data/spec/features/home_page_spec.rb +2 -2
- data/spec/features/index_map_spec.rb +2 -2
- data/spec/features/missing_metadata_spec.rb +1 -1
- data/spec/features/multiple_downloads_spec.rb +2 -1
- data/spec/features/relations_spec.rb +1 -1
- data/spec/features/saved_searches_spec.rb +1 -1
- data/spec/features/search_results_complex_geometry_spec.rb +24 -0
- data/spec/features/search_results_icons_spec.rb +16 -0
- data/spec/features/search_results_map_spec.rb +2 -2
- data/spec/features/search_spec.rb +22 -0
- data/spec/features/show_page_download_spec.rb +29 -0
- data/spec/features/show_page_metadata_spec.rb +2 -2
- data/spec/features/split_view.html.erb_spec.rb +12 -1
- data/spec/features/tilejson_spec.rb +22 -0
- data/spec/features/tms_spec.rb +2 -2
- data/spec/features/web_services_modal_spec.rb +35 -2
- data/spec/features/wmts_spec.rb +34 -0
- data/spec/features/xyz_spec.rb +10 -0
- data/spec/fixtures/manifests/tilejson.json +21 -0
- data/spec/fixtures/manifests/wmts-multiple.xml +813 -0
- data/spec/fixtures/manifests/wmts-single.xml +126 -0
- data/spec/fixtures/solr_documents/README.md +46 -43
- data/spec/fixtures/solr_documents/actual-papermap1.json +2 -1
- data/spec/fixtures/solr_documents/actual-point1.json +2 -1
- data/spec/fixtures/solr_documents/actual-polygon1.json +2 -1
- data/spec/fixtures/solr_documents/actual-raster1.json +3 -2
- data/spec/fixtures/solr_documents/baruch_ancestor1.json +2 -1
- data/spec/fixtures/solr_documents/baruch_ancestor2.json +2 -1
- data/spec/fixtures/solr_documents/baruch_documentation_download.json +1 -1
- data/spec/fixtures/solr_documents/bbox-spans-180.json +2 -1
- data/spec/fixtures/solr_documents/cornell_html_metadata.json +4 -3
- data/spec/fixtures/solr_documents/esri-dynamic-layer-all-layers.json +3 -2
- data/spec/fixtures/solr_documents/esri-dynamic-layer-single-layer.json +3 -2
- data/spec/fixtures/solr_documents/esri-feature-layer.json +2 -1
- data/spec/fixtures/solr_documents/esri-image-map-layer.json +3 -2
- data/spec/fixtures/solr_documents/esri-tiled_map_layer.json +2 -1
- data/spec/fixtures/solr_documents/esri-wms-layer.json +2 -1
- data/spec/fixtures/solr_documents/harvard_raster.json +3 -2
- data/spec/fixtures/solr_documents/iiif-eastern-hemisphere.json +3 -2
- data/spec/fixtures/solr_documents/index-map-polygon-no-downloadurl.json +2 -1
- data/spec/fixtures/solr_documents/index-map-polygon.json +2 -1
- data/spec/fixtures/solr_documents/index-map-stanford.json +2 -1
- data/spec/fixtures/solr_documents/index_map_point.json +3 -2
- data/spec/fixtures/solr_documents/metadata_no_provider.json +2 -1
- data/spec/fixtures/solr_documents/multiple-downloads.json +3 -2
- data/spec/fixtures/solr_documents/no_spatial.json +1 -4
- data/spec/fixtures/solr_documents/oembed.json +2 -1
- data/spec/fixtures/solr_documents/princeton-child1.json +3 -2
- data/spec/fixtures/solr_documents/princeton-child2.json +3 -2
- data/spec/fixtures/solr_documents/princeton-child3.json +2 -1
- data/spec/fixtures/solr_documents/princeton-child4.json +3 -2
- data/spec/fixtures/solr_documents/princeton-parent.json +5 -3
- data/spec/fixtures/solr_documents/public_direct_download.json +2 -1
- data/spec/fixtures/solr_documents/public_iiif_princeton.json +3 -2
- data/spec/fixtures/solr_documents/public_polygon_mit.json +2 -1
- data/spec/fixtures/solr_documents/restricted-line.json +2 -1
- data/spec/fixtures/solr_documents/tilejson.json +48 -0
- data/spec/fixtures/solr_documents/tms.json +15 -18
- data/spec/fixtures/solr_documents/umn_metro_result1.json +5 -3
- data/spec/fixtures/solr_documents/umn_state_result1.json +3 -2
- data/spec/fixtures/solr_documents/umn_state_result2.json +3 -5
- data/spec/fixtures/solr_documents/uva_slug_colon.json +2 -1
- data/spec/fixtures/solr_documents/wmts-multiple.json +41 -0
- data/spec/fixtures/solr_documents/wmts-single-layer.json +48 -0
- data/spec/fixtures/solr_documents/xyz.json +46 -0
- data/spec/helpers/geoblacklight_helper_spec.rb +12 -35
- data/spec/lib/geoblacklight/document_presenter_spec.rb +3 -3
- data/spec/lib/geoblacklight/download/geojson_download_spec.rb +1 -1
- data/spec/lib/geoblacklight/download/geotiff_download_spec.rb +1 -1
- data/spec/lib/geoblacklight/download/kmz_download_spec.rb +1 -1
- data/spec/lib/geoblacklight/download/shapefile_download_spec.rb +1 -1
- data/spec/lib/geoblacklight/download_spec.rb +2 -2
- data/spec/lib/geoblacklight/metadata/base_spec.rb +19 -1
- data/spec/lib/geoblacklight/references_spec.rb +1 -1
- data/spec/lib/geoblacklight/relation/relation_response_spec.rb +5 -0
- data/spec/lib/geoblacklight/view_helper_override_spec.rb +0 -10
- data/spec/models/concerns/geoblacklight/bbox_filter_field_spec.rb +77 -0
- data/spec/models/concerns/geoblacklight/bbox_filter_query_spec.rb +105 -0
- data/spec/models/concerns/geoblacklight/solr_document/inspection_spec.rb +2 -1
- data/spec/models/concerns/geoblacklight/suppressed_records_search_behavior_spec.rb +31 -0
- data/spec/presenters/geoblacklight/bbox_item_presenter_spec.rb +36 -0
- data/spec/spec_helper.rb +6 -1
- data/spec/test_app_templates/Gemfile.extra +1 -0
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +4 -4
- data/spec/views/catalog/_show_downloads.html.erb_spec.rb +5 -5
- data/template.rb +2 -4
- data/vendor/assets/images/fullscreen.png +0 -0
- data/vendor/assets/images/fullscreen@2x.png +0 -0
- data/vendor/assets/javascripts/Leaflet.fullscreen.js +152 -0
- data/vendor/assets/javascripts/esri-leaflet.js +10 -3
- data/vendor/assets/javascripts/esri-leaflet.js.map +1 -1
- data/vendor/assets/javascripts/leaflet-iiif.js +39 -18
- data/vendor/assets/javascripts/leaflet-src.js.erb +14062 -0
- data/vendor/assets/javascripts/leaflet-src.js.map +1 -1
- data/vendor/assets/stylesheets/leaflet.css +640 -634
- data/vendor/assets/stylesheets/leaflet.fullscreen.css +40 -0
- metadata +91 -46
- data/app/models/concerns/geoblacklight/spatial_search_behavior.rb +0 -71
- data/app/views/catalog/_download_generated_link.html.erb +0 -4
- data/app/views/catalog/_download_link.html.erb +0 -3
- data/app/views/catalog/_downloads_generated.html.erb +0 -6
- data/app/views/catalog/_downloads_primary.html.erb +0 -21
- data/app/views/catalog/_downloads_secondary.html.erb +0 -39
- data/app/views/catalog/_icon_facet.html.erb +0 -16
- data/bin/coverage.rb +0 -36
- data/lib/generators/geoblacklight/templates/Procfile +0 -3
- data/lib/generators/geoblacklight/templates/package.json +0 -14
- data/lib/generators/geoblacklight/templates/webpacker.yml +0 -67
- data/lib/generators/geoblacklight/webpacker_generator.rb +0 -36
- data/lib/geoblacklight/catalog_helper_override.rb +0 -14
- data/spec/models/concerns/geoblacklight/spatial_search_behavior_spec.rb +0 -97
- data/vendor/assets/javascripts/leaflet.js.erb +0 -13922
- data/vendor/assets/stylesheets/leaflet-label.css +0 -54
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* Leaflet-IIIF
|
2
|
+
* Leaflet-IIIF 3.0.0
|
3
3
|
* IIIF Viewer for Leaflet
|
4
4
|
* by Jack Reed, @mejackreed
|
5
5
|
*/
|
@@ -32,7 +32,7 @@ L.TileLayer.Iiif = L.TileLayer.extend({
|
|
32
32
|
}
|
33
33
|
|
34
34
|
options = L.setOptions(this, options);
|
35
|
-
this.
|
35
|
+
this._infoPromise = null;
|
36
36
|
this._infoUrl = url;
|
37
37
|
this._baseUrl = this._templateUrl();
|
38
38
|
this._getInfo();
|
@@ -52,26 +52,35 @@ L.TileLayer.Iiif = L.TileLayer.extend({
|
|
52
52
|
var xDiff = (maxx - minx);
|
53
53
|
var yDiff = (maxy - miny);
|
54
54
|
|
55
|
+
// Canonical URI Syntax for v2
|
56
|
+
var size = Math.ceil(xDiff / scale) + ',';
|
57
|
+
if (_this.type === 'ImageService3') {
|
58
|
+
// Cannonical URI Syntax for v3
|
59
|
+
size = size + Math.ceil(yDiff / scale);
|
60
|
+
}
|
61
|
+
|
55
62
|
return L.Util.template(this._baseUrl, L.extend({
|
56
63
|
format: _this.options.tileFormat,
|
57
64
|
quality: _this.quality,
|
58
65
|
region: [minx, miny, xDiff, yDiff].join(','),
|
59
66
|
rotation: 0,
|
60
|
-
size:
|
67
|
+
size: size
|
61
68
|
}, this.options));
|
62
69
|
},
|
63
70
|
onAdd: function(map) {
|
64
71
|
var _this = this;
|
65
72
|
|
66
|
-
// Wait for
|
67
|
-
|
68
|
-
|
73
|
+
// Wait for info.json fetch and parse to complete
|
74
|
+
Promise.all([_this._infoPromise]).then(function() {
|
69
75
|
// Store unmutated imageSizes
|
70
76
|
_this._imageSizesOriginal = _this._imageSizes.slice(0);
|
71
77
|
|
72
78
|
// Set maxZoom for map
|
73
79
|
map._layersMaxZoom = _this.maxZoom;
|
74
80
|
|
81
|
+
// Call add TileLayer
|
82
|
+
L.TileLayer.prototype.onAdd.call(_this, map);
|
83
|
+
|
75
84
|
// Set minZoom and minNativeZoom based on how the imageSizes match up
|
76
85
|
var smallestImage = _this._imageSizes[0];
|
77
86
|
var mapSize = _this._map.getSize();
|
@@ -91,9 +100,6 @@ L.TileLayer.Iiif = L.TileLayer.extend({
|
|
91
100
|
_this._prev_map_layersMinZoom = _this._map._layersMinZoom;
|
92
101
|
_this._map._layersMinZoom = newMinZoom;
|
93
102
|
|
94
|
-
// Call add TileLayer
|
95
|
-
L.TileLayer.prototype.onAdd.call(_this, map);
|
96
|
-
|
97
103
|
if (_this.options.fitBounds) {
|
98
104
|
_this._fitBounds();
|
99
105
|
}
|
@@ -115,6 +121,9 @@ L.TileLayer.Iiif = L.TileLayer.extend({
|
|
115
121
|
tile.tile.style.height = height + 'px';
|
116
122
|
|
117
123
|
});
|
124
|
+
})
|
125
|
+
.catch(function(err){
|
126
|
+
console.error(err);
|
118
127
|
});
|
119
128
|
},
|
120
129
|
onRemove: function(map) {
|
@@ -160,9 +169,14 @@ L.TileLayer.Iiif = L.TileLayer.extend({
|
|
160
169
|
_getInfo: function() {
|
161
170
|
var _this = this;
|
162
171
|
|
163
|
-
|
164
|
-
|
165
|
-
|
172
|
+
_this._infoPromise = fetch(_this._infoUrl)
|
173
|
+
.then(function(response) {
|
174
|
+
return response.json();
|
175
|
+
})
|
176
|
+
.catch(function(err){
|
177
|
+
console.error(err);
|
178
|
+
})
|
179
|
+
.then(function(data) {
|
166
180
|
_this.y = data.height;
|
167
181
|
_this.x = data.width;
|
168
182
|
|
@@ -180,6 +194,7 @@ L.TileLayer.Iiif = L.TileLayer.extend({
|
|
180
194
|
}else {
|
181
195
|
_this.profile = data.profile;
|
182
196
|
}
|
197
|
+
_this.type = data.type;
|
183
198
|
|
184
199
|
_this._setQuality();
|
185
200
|
|
@@ -201,8 +216,11 @@ L.TileLayer.Iiif = L.TileLayer.extend({
|
|
201
216
|
};
|
202
217
|
|
203
218
|
// Calculates maximum native zoom for the layer
|
204
|
-
_this.maxNativeZoom = Math.max(
|
205
|
-
ceilLog2(_this.
|
219
|
+
_this.maxNativeZoom = Math.max(
|
220
|
+
ceilLog2(_this.x / _this.options.tileSize),
|
221
|
+
ceilLog2(_this.y / _this.options.tileSize),
|
222
|
+
0
|
223
|
+
);
|
206
224
|
_this.options.maxNativeZoom = _this.maxNativeZoom;
|
207
225
|
|
208
226
|
// Enable zooming further than native if maxZoom option supplied
|
@@ -225,10 +243,11 @@ L.TileLayer.Iiif = L.TileLayer.extend({
|
|
225
243
|
|
226
244
|
_this._tierSizes = tierSizes;
|
227
245
|
_this._imageSizes = imageSizes;
|
228
|
-
|
229
|
-
|
230
|
-
|
246
|
+
})
|
247
|
+
.catch(function(err){
|
248
|
+
console.error(err);
|
231
249
|
});
|
250
|
+
|
232
251
|
},
|
233
252
|
|
234
253
|
_setQuality: function() {
|
@@ -263,7 +282,6 @@ L.TileLayer.Iiif = L.TileLayer.extend({
|
|
263
282
|
return this._infoToBaseUrl() + '{region}/{size}/{rotation}/{quality}.{format}';
|
264
283
|
},
|
265
284
|
_isValidTile: function(coords) {
|
266
|
-
var tileBounds = this._tileCoordsToBounds(coords);
|
267
285
|
var _this = this;
|
268
286
|
var zoom = _this._getZoomForUrl();
|
269
287
|
var sizes = _this._tierSizes[zoom];
|
@@ -280,6 +298,9 @@ L.TileLayer.Iiif = L.TileLayer.extend({
|
|
280
298
|
return true;
|
281
299
|
}
|
282
300
|
},
|
301
|
+
_tileShouldBeLoaded: function(coords) {
|
302
|
+
return this._isValidTile(coords);
|
303
|
+
},
|
283
304
|
_getInitialZoom: function (mapSize) {
|
284
305
|
var _this = this;
|
285
306
|
var tolerance = 0.8;
|