geoblacklight 0.12.1 → 1.0.0.pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/.hound.yml +8 -0
  3. data/.jshintignore +2 -0
  4. data/.jshintrc +67 -0
  5. data/.rubocop.yml +29 -3
  6. data/Gemfile +20 -16
  7. data/README.md +1 -0
  8. data/Rakefile +3 -2
  9. data/app/assets/javascripts/geoblacklight/basemaps.js +0 -9
  10. data/app/assets/javascripts/geoblacklight/controls.js +1 -0
  11. data/app/assets/javascripts/geoblacklight/controls/opacity.js +8 -0
  12. data/app/assets/javascripts/geoblacklight/geoblacklight.js +3 -2
  13. data/app/assets/javascripts/geoblacklight/viewers.js +1 -1
  14. data/app/assets/javascripts/geoblacklight/viewers/esri.js +2 -3
  15. data/app/assets/javascripts/geoblacklight/viewers/esri/dynamic_map_layer.js +2 -2
  16. data/app/assets/javascripts/geoblacklight/viewers/esri/feature_layer.js +1 -5
  17. data/app/assets/javascripts/geoblacklight/viewers/iiif.js +1 -1
  18. data/app/assets/javascripts/geoblacklight/viewers/map.js +1 -9
  19. data/app/assets/javascripts/geoblacklight/viewers/viewer.js +42 -1
  20. data/app/assets/javascripts/geoblacklight/viewers/wms.js +1 -1
  21. data/app/assets/stylesheets/geoblacklight/modules/toolbar.scss +4 -0
  22. data/app/helpers/geoblacklight_helper.rb +28 -14
  23. data/app/models/concerns/geoblacklight/solr_document.rb +20 -11
  24. data/{lib/geoblacklight/search_builder.rb → app/models/concerns/geoblacklight/spatial_search_behavior.rb} +6 -8
  25. data/app/presenters/geoblacklight/document_presenter.rb +14 -7
  26. data/app/views/catalog/_document_split.html.erb +1 -1
  27. data/app/views/catalog/_downloads.html.erb +46 -38
  28. data/app/views/catalog/_facet_tag_item.html.erb +1 -1
  29. data/app/views/catalog/_facet_tag_layout.html.erb +1 -1
  30. data/app/views/catalog/_header_icons.html.erb +3 -0
  31. data/app/views/catalog/_home_text.html.erb +5 -5
  32. data/app/views/catalog/_index_split_default.html.erb +5 -7
  33. data/app/views/catalog/_search_form_no_navbar.html.erb +2 -2
  34. data/app/views/catalog/_show_default_viewer_container.html.erb +2 -2
  35. data/app/views/catalog/_show_header_default.html.erb +1 -3
  36. data/app/views/catalog/_web_services_wfs.html.erb +1 -1
  37. data/app/views/catalog/_web_services_wms.html.erb +1 -1
  38. data/config/jetty.yml +1 -1
  39. data/config/locales/geoblacklight.en.yml +1 -0
  40. data/geoblacklight.gemspec +4 -4
  41. data/lib/generators/geoblacklight/install_generator.rb +34 -3
  42. data/lib/generators/geoblacklight/templates/catalog_controller.rb +36 -31
  43. data/lib/generators/geoblacklight/templates/config/jetty.yml +1 -1
  44. data/lib/generators/geoblacklight/templates/geoblacklight.js +1 -0
  45. data/lib/generators/geoblacklight/templates/{geoblacklight.css.scss → geoblacklight.scss} +0 -0
  46. data/lib/generators/geoblacklight/templates/settings.yml +42 -2
  47. data/lib/geoblacklight.rb +1 -2
  48. data/lib/geoblacklight/constants.rb +1 -1
  49. data/lib/geoblacklight/download.rb +8 -7
  50. data/lib/geoblacklight/download/geojson_download.rb +1 -1
  51. data/lib/geoblacklight/download/geotiff_download.rb +1 -1
  52. data/lib/geoblacklight/download/kmz_download.rb +1 -1
  53. data/lib/geoblacklight/download/shapefile_download.rb +1 -1
  54. data/lib/geoblacklight/geoblacklight_helper_behavior.rb +4 -10
  55. data/lib/geoblacklight/metadata.rb +3 -6
  56. data/lib/geoblacklight/references.rb +2 -2
  57. data/lib/geoblacklight/routes.rb +3 -17
  58. data/lib/geoblacklight/routes/downloadable.rb +14 -0
  59. data/lib/geoblacklight/routes/exportable.rb +16 -0
  60. data/lib/geoblacklight/routes/wms.rb +13 -0
  61. data/lib/geoblacklight/version.rb +1 -1
  62. data/spec/controllers/catalog_controller_spec.rb +1 -1
  63. data/spec/controllers/download_controller_spec.rb +7 -1
  64. data/spec/features/bookmarks_spec.rb +1 -1
  65. data/spec/features/configurable_basemap_spec.rb +9 -8
  66. data/spec/features/download_layer_spec.rb +33 -15
  67. data/spec/features/esri_viewer_spec.rb +9 -8
  68. data/spec/features/exports_spec.rb +3 -3
  69. data/spec/features/home_page_spec.rb +1 -1
  70. data/spec/features/iiif_viewer_spec.rb +1 -1
  71. data/spec/features/layer_inspection_spec.rb +2 -2
  72. data/spec/features/layer_opacity_spec.rb +7 -2
  73. data/spec/features/layer_preview_spec.rb +2 -2
  74. data/spec/features/metadata_panel_spec.rb +3 -3
  75. data/spec/features/saved_searches_spec.rb +1 -1
  76. data/spec/features/search_bar_spec.rb +2 -2
  77. data/spec/features/show_page_metadata_spec.rb +1 -1
  78. data/spec/features/split_view.html.erb_spec.rb +6 -5
  79. data/spec/features/web_services_modal_spec.rb +3 -3
  80. data/spec/helpers/geoblacklight_helpers_spec.rb +71 -3
  81. data/spec/lib/geoblacklight/document_presenter_spec.rb +41 -13
  82. data/spec/lib/geoblacklight/download_spec.rb +9 -1
  83. data/spec/lib/geoblacklight/geoblacklight_helper_behavior_spec.rb +12 -9
  84. data/spec/lib/geoblacklight/item_viewer_spec.rb +4 -3
  85. data/spec/lib/geoblacklight/references_spec.rb +22 -18
  86. data/spec/lib/geoblacklight/view_helper_override_spec.rb +1 -1
  87. data/spec/lib/geoblacklight/wms_layer/feature_info_response_spec.rb +1 -1
  88. data/spec/lib/geoblacklight/wms_layer_spec.rb +1 -1
  89. data/spec/models/concerns/geoblacklight/solr_document/carto_db_spec.rb +7 -1
  90. data/spec/models/concerns/geoblacklight/solr_document_spec.rb +34 -11
  91. data/spec/{lib/geoblacklight/search_builder_spec.rb → models/concerns/geoblacklight/spatial_search_behavior_spec.rb} +10 -15
  92. data/spec/spec_helper.rb +6 -6
  93. data/spec/test_app_templates/lib/generators/test_app_generator.rb +1 -1
  94. metadata +25 -22
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9c48807e9e693272f01efe26dfe5f292c4d2260d
4
- data.tar.gz: f84f1b102c444f450dd6f0c9bc6bff1498d0e677
3
+ metadata.gz: 5b0ad269f0ebd47db8d81ab0d4719f90fcbb8a17
4
+ data.tar.gz: 1ad6c33856e8f7ce2551b19674f534085f52965a
5
5
  SHA512:
6
- metadata.gz: 48e1657b1cf33837a5c63fae09b70c0c79c0038df9b3e25734b071bb66825839ae53871e1103b88f6a40f4fb7cd58ece31d3ba1983d310c324c64cb6aa5eb34a
7
- data.tar.gz: 2c269376fbd741b1546a9c8607bb23d7c8c8cad149406f9ff9a1d2130e48d48b21b57e3d9d26ff20013d2a34b5ef7bc27d9ba6cbad408d46096c7eede19c4ff0
6
+ metadata.gz: 42059f7dd06f6a17c25f0bbc55b40b50899bd8af109f1480faca73e8818bd429be250d90579a8905fdfd830e0177ae5c9b15f3aba23704acc2da1495e1a14e1d
7
+ data.tar.gz: 32743a287f05b96ca364713b6ad470b676fcb9822f5f285b38e7be9329302c4a980ef1676826c1b491f51e63a7156a8fc8952040f628747fece73ed3e7fd9e2a
data/.hound.yml ADDED
@@ -0,0 +1,8 @@
1
+ javascript:
2
+ config_file: .jshintrc
3
+ ignore_file: .jshintignore
4
+ scss:
5
+ exclude:
6
+ - 'vendor/assets/stylesheets/**'
7
+ ruby:
8
+ config_file: .rubocop.yml
data/.jshintignore ADDED
@@ -0,0 +1,2 @@
1
+ vendor/*
2
+ app/assets/javascripts/vendor/*
data/.jshintrc ADDED
@@ -0,0 +1,67 @@
1
+ {
2
+ /*
3
+ * ENVIRONMENTS
4
+ * =================
5
+ */
6
+
7
+ // Define globals exposed by modern browsers.
8
+ "browser": true,
9
+
10
+ // Define globals exposed by jQuery.
11
+ "jquery": true,
12
+
13
+ // Define globals exposed by Node.js.
14
+ "node": true,
15
+
16
+ // Allow ES6.
17
+ "esnext": true,
18
+
19
+ /*
20
+ * ENFORCING OPTIONS
21
+ * =================
22
+ */
23
+
24
+ // Force all variable names to use either camelCase style or UPPER_CASE
25
+ // with underscores.
26
+ "camelcase": true,
27
+
28
+ // Prohibit use of == and != in favor of === and !==.
29
+ "eqeqeq": true,
30
+
31
+ // Enforce tab width of 2 spaces.
32
+ "indent": 2,
33
+
34
+ // Prohibit use of a variable before it is defined.
35
+ "latedef": true,
36
+
37
+ // Enforce line length to 80 characters
38
+ "maxlen": 80,
39
+
40
+ // Require capitalized names for constructor functions.
41
+ "newcap": true,
42
+
43
+ // Enforce use of single quotation marks for strings.
44
+ "quotmark": "single",
45
+
46
+ // Enforce placing 'use strict' at the top function scope
47
+ "strict": true,
48
+
49
+ // Prohibit use of explicitly undeclared variables.
50
+ "undef": true,
51
+
52
+ // Warn when variables are defined but never used.
53
+ "unused": true,
54
+
55
+ /*
56
+ * RELAXING OPTIONS
57
+ * =================
58
+ */
59
+
60
+ // Suppress warnings about == null comparisons.
61
+ "eqnull": true,
62
+
63
+ // Custom predefined js stuff
64
+ "predef": [
65
+ "expect", "describe", "it", "xit", "spyOn", "fixture", "beforeEach", "afterEach", "L", "jasmine", "TestResponses"
66
+ ]
67
+ }
data/.rubocop.yml CHANGED
@@ -1,7 +1,7 @@
1
- require: rubocop-rspec
1
+ Rails:
2
+ Enabled: true
2
3
 
3
4
  AllCops:
4
- RunRailsCops: true
5
5
  DisplayCopNames: true
6
6
 
7
7
  Include:
@@ -42,4 +42,30 @@ RSpec/FilePath:
42
42
  # Rubocop bug causes view specs to fail.
43
43
  # https://github.com/nevir/rubocop-rspec/issues/47
44
44
  RSpec/DescribeClass:
45
- Enabled: false
45
+ Enabled: false
46
+
47
+ # geoblacklight references in solr_document_spec are
48
+ # difficult to mock because of the use of 'method_missing'.
49
+ # https://relishapp.com/rspec/rspec-mocks/docs/verifying-doubles/dynamic-classes
50
+ RSpec/AnyInstance:
51
+ Exclude:
52
+ - 'spec/models/concerns/geoblacklight/solr_document_spec.rb'
53
+
54
+ Style/SignalException:
55
+ EnforcedStyle: semantic
56
+
57
+ Style/StringLiterals:
58
+ Description: Checks if uses of quotes match the configured preference.
59
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-string-literals
60
+ Enabled: true
61
+ EnforcedStyle: single_quotes
62
+
63
+ Style/DotPosition:
64
+ Description: Checks the position of the dot in multi-line method calls.
65
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
66
+ Enabled: true
67
+ EnforcedStyle: leading
68
+ SupportedStyles:
69
+ - leading
70
+ - trailing
71
+
data/Gemfile CHANGED
@@ -3,25 +3,20 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in geoblacklight.gemspec
4
4
  gemspec
5
5
 
6
- # If we don't specify 2.11.0 we'll end up with sprockets 2.12.0 in the main
7
- # Gemfile.lock but since sass-rails gets generated (rails new) into the test app
8
- # it'll want sprockets 2.11.0 and we'll have a conflict
9
- gem 'sprockets', '2.11.0'
10
-
11
6
  group :development, :test do
12
7
  # Peg simplecov to < 0.8 until this is resolved:
13
8
  # https://github.com/colszowka/simplecov/issues/281
14
9
  gem 'simplecov', '~> 0.7.1', require: false
15
10
  gem 'coveralls', require: false
16
- gem 'rubocop', '0.35.1', require: false
17
- gem 'rubocop-rspec', '1.3.1', require: false
11
+ gem 'rubocop', '0.38.0', require: false
12
+ gem 'rubocop-rspec', '1.4.0', require: false
18
13
  end
19
14
 
20
15
  # BEGIN ENGINE_CART BLOCK
21
- # engine_cart: 0.8.0
22
- # engine_cart stanza: 0.8.0
16
+ # engine_cart: 0.10.0
17
+ # engine_cart stanza: 0.10.0
23
18
  # the below comes from engine_cart, a gem used to test this Rails engine gem in the context of a Rails app.
24
- file = File.expand_path("Gemfile", ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path(".internal_test_app", File.dirname(__FILE__)))
19
+ file = File.expand_path('Gemfile', ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path('.internal_test_app', File.dirname(__FILE__)))
25
20
  if File.exist?(file)
26
21
  begin
27
22
  eval_gemfile file
@@ -32,13 +27,22 @@ if File.exist?(file)
32
27
  else
33
28
  Bundler.ui.warn "[EngineCart] Unable to find test application dependencies in #{file}, using placeholder dependencies"
34
29
 
35
- gem 'rails', ENV['RAILS_VERSION'] if ENV['RAILS_VERSION']
30
+ if ENV['RAILS_VERSION']
31
+ if ENV['RAILS_VERSION'] == 'edge'
32
+ gem 'rails', github: 'rails/rails'
33
+ ENV['ENGINE_CART_RAILS_OPTIONS'] = '--edge --skip-turbolinks'
34
+ else
35
+ gem 'rails', ENV['RAILS_VERSION']
36
+ end
37
+ end
36
38
 
37
- if ENV['RAILS_VERSION'].nil? || ENV['RAILS_VERSION'] =~ /^4.2/
38
- gem 'responders', "~> 2.0"
39
- gem 'sass-rails', ">= 5.0"
40
- else
41
- gem 'sass-rails', "< 5.0"
39
+ case ENV['RAILS_VERSION']
40
+ when /^4.2/
41
+ gem 'responders', '~> 2.0'
42
+ gem 'sass-rails', '>= 5.0'
43
+ gem 'coffee-rails', '~> 4.1.0'
44
+ when /^4.[01]/
45
+ gem 'sass-rails', '< 5.0'
42
46
  end
43
47
  end
44
48
  # END ENGINE_CART BLOCK
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # Geoblacklight
2
2
 
3
3
  [![Build Status](https://travis-ci.org/geoblacklight/geoblacklight.svg?branch=master)](https://travis-ci.org/geoblacklight/geoblacklight) | [![Coverage Status](https://img.shields.io/coveralls/geoblacklight/geoblacklight.svg)](https://coveralls.io/r/geoblacklight/geoblacklight?branch=coveralls) | [![Gem Version](https://img.shields.io/gem/v/geoblacklight.svg)](https://github.com/geoblacklight/geoblacklight/releases)
4
+ [![Stories in Ready](https://badge.waffle.io/geoblacklight/geoblacklight.png?label=ready&title=Ready)](https://waffle.io/geoblacklight/geoblacklight)
4
5
 
5
6
  GeoBlacklight is a world-class discovery platform for geospatial (GIS) holdings. It
6
7
  is an open collaborative project aiming to build off of the successes
data/Rakefile CHANGED
@@ -5,8 +5,8 @@ rescue LoadError
5
5
  puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
6
  end
7
7
 
8
- BLACKLIGHT_JETTY_VERSION = '4.10.3'
9
- ZIP_URL = "https://github.com/projectblacklight/blacklight-jetty/archive/v#{BLACKLIGHT_JETTY_VERSION}.zip"
8
+ BLACKLIGHT_JETTY_VERSION = '4.10.3'.freeze
9
+ ZIP_URL = "https://github.com/projectblacklight/blacklight-jetty/archive/v#{BLACKLIGHT_JETTY_VERSION}.zip".freeze
10
10
  APP_ROOT = File.dirname(__FILE__)
11
11
 
12
12
  require 'rspec/core/rake_task'
@@ -20,6 +20,7 @@ task default: :ci
20
20
 
21
21
  desc 'Run style checker'
22
22
  RuboCop::RakeTask.new(:rubocop) do |task|
23
+ task.requires << 'rubocop-rspec'
23
24
  task.fail_on_error = true
24
25
  end
25
26
 
@@ -9,15 +9,6 @@ GeoBlacklight.Basemaps = {
9
9
  detectRetina: true
10
10
  }
11
11
  ),
12
- mapquest: L.tileLayer(
13
- 'https://otile{s}-s.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.png', {
14
- attribution: '&copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, Tiles Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a> <img src="//developer.mapquest.com/content/osm/mq_logo.png" alt="">',
15
- maxZoom: 18,
16
- worldCopyJump: true,
17
- subdomains: '1234', // see http://developer.mapquest.com/web/products/open/map
18
- detectRetina: true
19
- }
20
- ),
21
12
  positron: L.tileLayer(
22
13
  'https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png', {
23
14
  attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, &copy; <a href="http://cartodb.com/attributions">CartoDB</a>',
@@ -0,0 +1 @@
1
+ //= require_tree ./controls
@@ -0,0 +1,8 @@
1
+ /*global GeoBlacklight */
2
+
3
+ 'use strict';
4
+
5
+ // Leaflet opacity control.
6
+ GeoBlacklight.Controls.Opacity = function() {
7
+ this.map.addControl(new L.Control.LayerOpacity(this.overlay));
8
+ };
@@ -20,7 +20,7 @@
20
20
 
21
21
  var GeoBlacklight = L.Class.extend({
22
22
  statics: {
23
- __version__: '0.0.1',
23
+ __version__: '1.0.0.pre1',
24
24
 
25
25
  debounce: function(fn, delay) {
26
26
  var timeout = null;
@@ -35,6 +35,7 @@
35
35
  }
36
36
  });
37
37
 
38
+ // Hash for leaflet controls.
39
+ GeoBlacklight.Controls = {};
38
40
  global.GeoBlacklight = GeoBlacklight;
39
-
40
41
  }(this);
@@ -1 +1 @@
1
- //= require_tree ./viewers
1
+ //= require_tree ./viewers
@@ -31,9 +31,8 @@ GeoBlacklight.Viewer.Esri = GeoBlacklight.Viewer.Map.extend({
31
31
 
32
32
  // add layer to map
33
33
  if (_this.addPreviewLayer(layer)) {
34
-
35
- // add control if layer is added
36
- _this.addOpacityControl();
34
+ // add controls if layer is added
35
+ _this.loadControls();
37
36
  }
38
37
  }
39
38
  });
@@ -30,8 +30,8 @@ GeoBlacklight.Viewer.DynamicMapLayer = GeoBlacklight.Viewer.Esri.extend({
30
30
  // add layer to map
31
31
  if (_this.addPreviewLayer(layer)) {
32
32
 
33
- // add control if layer is added
34
- _this.addOpacityControl();
33
+ // add controls if layer is added
34
+ _this.loadControls();
35
35
  }
36
36
  }
37
37
  });
@@ -28,16 +28,12 @@ GeoBlacklight.Viewer.FeatureLayer = GeoBlacklight.Viewer.Esri.extend({
28
28
  return this.esriFeatureLayer;
29
29
  },
30
30
 
31
- // override opacity control because feature layer is special
32
- addOpacityControl: function() {
31
+ controlPreload: function() {
33
32
 
34
33
  // define setOpacity function that works for svg elements
35
34
  this.esriFeatureLayer.setOpacity = function(opacity) {
36
35
  $('.leaflet-clickable').css({ opacity: opacity });
37
36
  };
38
-
39
- // add new opacity control
40
- this.map.addControl(new L.Control.LayerOpacity(this.esriFeatureLayer));
41
37
  },
42
38
 
43
39
  getFeatureStyle: function() {
@@ -9,7 +9,7 @@ GeoBlacklight.Viewer.Iiif = GeoBlacklight.Viewer.extend({
9
9
  crs: L.CRS.Simple,
10
10
  zoom: 0
11
11
  });
12
-
12
+ this.loadControls();
13
13
  this.iiifLayer = L.tileLayer.iiif(this.data.url)
14
14
  .addTo(this.map);
15
15
  },
@@ -1,7 +1,6 @@
1
1
  //= require geoblacklight/viewers/viewer
2
2
 
3
3
  GeoBlacklight.Viewer.Map = GeoBlacklight.Viewer.extend({
4
-
5
4
  options: {
6
5
  /**
7
6
  * Initial bounds of map
@@ -47,13 +46,6 @@ GeoBlacklight.Viewer.Map = GeoBlacklight.Viewer.extend({
47
46
  this.overlay.clearLayers();
48
47
  },
49
48
 
50
- /**
51
- * Add an opacity control to map.
52
- */
53
- addOpacityControl: function() {
54
- this.map.addControl(new L.Control.LayerOpacity(this.overlay));
55
- },
56
-
57
49
  /**
58
50
  * Selects basemap if specified in data options, if not return mapquest
59
51
  */
@@ -62,7 +54,7 @@ GeoBlacklight.Viewer.Map = GeoBlacklight.Viewer.extend({
62
54
  if (_this.data.basemap) {
63
55
  return GeoBlacklight.Basemaps[_this.data.basemap];
64
56
  } else {
65
- return _this.basemap.mapquest;
57
+ return _this.basemap.positron;
66
58
  }
67
59
  }
68
60
  });
@@ -1,3 +1,7 @@
1
+ /*global GeoBlacklight */
2
+
3
+ 'use strict';
4
+
1
5
  // base viewer
2
6
  GeoBlacklight.Viewer = L.Class.extend({
3
7
  options: {},
@@ -8,7 +12,44 @@ GeoBlacklight.Viewer = L.Class.extend({
8
12
 
9
13
  L.Util.setOptions(this, options);
10
14
 
11
- // trigger viewer load function
15
+ // trigger viewer load functions
12
16
  this.load();
17
+ },
18
+
19
+ /**
20
+ * Loads leaflet controls from controls directory.
21
+ **/
22
+ loadControls: function() {
23
+ var _this = this;
24
+ var protocol = this.data.protocol.toUpperCase();
25
+ var options = this.data.leafletOptions;
26
+
27
+ if (!options.VIEWERS) {
28
+ return;
29
+ }
30
+
31
+ var viewer = options.VIEWERS[protocol];
32
+ var controls = viewer && viewer.CONTROLS;
33
+
34
+ _this.controlPreload();
35
+
36
+ /**
37
+ * Loop though the GeoBlacklight.Controls hash, and for each control,
38
+ * check to see if it is included in the controls list for the current
39
+ * viewer. If it is, then pass in the viewer object and run the function
40
+ * that adds it to the map.
41
+ **/
42
+ $.each(GeoBlacklight.Controls, function(name, func) {
43
+ if (controls && controls.indexOf(name) > -1) {
44
+ func.call(_this);
45
+ }
46
+ });
47
+ },
48
+
49
+ /**
50
+ * Work to do before the controls are loaded.
51
+ **/
52
+ controlPreload: function() {
53
+ return;
13
54
  }
14
55
  });
@@ -10,7 +10,7 @@ GeoBlacklight.Viewer.Wms = GeoBlacklight.Viewer.Map.extend({
10
10
 
11
11
  if (this.data.available) {
12
12
  this.addPreviewLayer();
13
- this.addOpacityControl();
13
+ this.loadControls();
14
14
  } else {
15
15
  this.addBoundsOverlay(this.options.bbox);
16
16
  }
@@ -32,4 +32,8 @@
32
32
  text-align: center;
33
33
  width: 1.4em;
34
34
  }
35
+
36
+ .downloads {
37
+ padding-top: 15px;
38
+ }
35
39
  }
@@ -15,16 +15,16 @@ module GeoblacklightHelper
15
15
  document_available? && @document.downloadable?
16
16
  end
17
17
 
18
- def snippit(text)
19
- if text
20
- if text.length > 150
21
- text.slice(0, 150) + '...'
22
- else
23
- text
24
- end
25
- else
26
- ''
27
- end
18
+ def iiif_jpg_url
19
+ @document.references.iiif.endpoint.sub! 'info.json', 'full/full/0/default.jpg'
20
+ end
21
+
22
+ ##
23
+ # Blacklight catalog controller helper method to truncate field value to 150 chars
24
+ # @param [SolrDocument] args
25
+ # @return [String]
26
+ def snippit(args)
27
+ truncate(Array(args[:value]).flatten.first, length: 150)
28
28
  end
29
29
 
30
30
  def render_facet_tags(facet)
@@ -50,7 +50,7 @@ module GeoblacklightHelper
50
50
  #
51
51
  def render_facet_links(facet, items)
52
52
  items.uniq.map do |item|
53
- link_to item, catalog_index_path(f: { "#{facet}" => [item] })
53
+ link_to item, search_catalog_path(f: { facet => [item] })
54
54
  end.join(', ').html_safe
55
55
  end
56
56
 
@@ -98,7 +98,14 @@ module GeoblacklightHelper
98
98
  # Selects the basemap used for map displays
99
99
  # @return [String]
100
100
  def geoblacklight_basemap
101
- blacklight_config.basemap_provider || 'mapquest'
101
+ blacklight_config.basemap_provider || 'positron'
102
+ end
103
+
104
+ ##
105
+ # Removes blank space from provider to accomodate CartoDB OneClick
106
+ #
107
+ def cartodb_provider
108
+ application_name.delete(' ')
102
109
  end
103
110
 
104
111
  ##
@@ -106,9 +113,9 @@ module GeoblacklightHelper
106
113
  # @param [String] file_link
107
114
  # @return [String]
108
115
  def cartodb_link(file_link)
109
- params = URI.encode_www_form(
116
+ params = URI.encode_www_form(
110
117
  file: file_link,
111
- provider: application_name,
118
+ provider: cartodb_provider,
112
119
  logo: Settings.APPLICATION_LOGO_URL
113
120
  )
114
121
  Settings.CARTODB_ONECLICK_LINK + '?' + params
@@ -126,4 +133,11 @@ module GeoblacklightHelper
126
133
  rescue ActionView::MissingTemplate
127
134
  render partial: 'web_services_default', locals: { reference: reference }
128
135
  end
136
+
137
+ ##
138
+ # Returns a hash of the leaflet plugin settings to pass to the viewer.
139
+ # @return[Hash]
140
+ def leaflet_options
141
+ Settings.LEAFLET
142
+ end
129
143
  end