blacklight-maps 0.5.2 → 1.2.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 +5 -5
- data/.github/workflows/ruby.yml +33 -0
- data/.gitignore +2 -0
- data/.rubocop.yml +103 -0
- data/.solr_wrapper.yml +8 -0
- data/Gemfile +38 -8
- data/README.md +15 -13
- data/Rakefile +35 -32
- data/app/assets/images/blacklight/maps.svg +1 -0
- data/app/assets/javascripts/blacklight-maps/blacklight-maps-browse.js +7 -8
- data/app/assets/javascripts/blacklight-maps.js +1 -4
- data/app/assets/stylesheets/blacklight_maps/blacklight-maps.scss +1 -2
- data/app/assets/stylesheets/blacklight_maps/default.scss +7 -10
- data/app/helpers/blacklight/blacklight_maps_helper_behavior.rb +81 -86
- data/app/helpers/blacklight_maps_helper.rb +2 -0
- data/app/views/catalog/_show_maplet_default.html.erb +8 -9
- data/app/views/catalog/map.html.erb +2 -2
- data/blacklight-maps.gemspec +27 -26
- data/config/locales/blacklight-maps-zh.yml +7 -7
- data/config/locales/blacklight-maps.ar.yml +21 -0
- data/config/locales/blacklight-maps.de.yml +21 -0
- data/config/locales/blacklight-maps.en.yml +1 -1
- data/config/locales/blacklight-maps.es.yml +21 -0
- data/config/locales/blacklight-maps.fr.yml +8 -8
- data/config/locales/blacklight-maps.hu.yml +21 -0
- data/config/locales/blacklight-maps.it.yml +8 -8
- data/config/locales/blacklight-maps.nl.yml +21 -0
- data/config/locales/blacklight-maps.pt-BR.yml +21 -0
- data/config/locales/blacklight-maps.sq.yml +21 -0
- data/config/routes.rb +3 -2
- data/lib/blacklight/maps/controller.rb +27 -0
- data/lib/blacklight/maps/engine.rb +15 -14
- data/lib/blacklight/maps/export.rb +114 -93
- data/lib/blacklight/maps/geometry.rb +30 -18
- data/lib/blacklight/maps/maps_search_builder.rb +4 -3
- data/lib/blacklight/maps/render_constraints_override.rb +63 -29
- data/lib/blacklight/maps/version.rb +3 -1
- data/lib/blacklight/maps.rb +8 -2
- data/lib/generators/blacklight_maps/install_generator.rb +38 -31
- data/lib/generators/blacklight_maps/templates/search_history_controller.rb +2 -0
- data/lib/railties/blacklight_maps.rake +10 -7
- data/spec/controllers/catalog_controller_spec.rb +20 -10
- data/spec/fixtures/sample_solr_documents.yml +909 -906
- data/spec/helpers/blacklight_maps_helper_spec.rb +60 -108
- data/spec/lib/blacklight/maps/export_spec.rb +109 -143
- data/spec/lib/blacklight/maps/geometry_spec.rb +34 -21
- data/spec/lib/blacklight/maps/maps_search_builder_spec.rb +17 -21
- data/spec/lib/blacklight/maps/render_constraints_override_spec.rb +42 -69
- data/spec/spec_helper.rb +18 -21
- data/spec/system/index_view_spec.rb +128 -0
- data/spec/system/initial_view_spec.rb +28 -0
- data/spec/system/map_view_spec.rb +50 -0
- data/spec/system/show_view_maplet_spec.rb +78 -0
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +6 -21
- data/vendor/assets/images/layers-2x.png +0 -0
- data/vendor/assets/images/layers.png +0 -0
- data/vendor/assets/images/marker-icon-2x.png +0 -0
- data/vendor/assets/images/marker-icon.png +0 -0
- data/vendor/assets/images/marker-shadow.png +0 -0
- data/vendor/assets/javascripts/leaflet.js.erb +13922 -0
- data/vendor/assets/javascripts/leaflet.markercluster.js +3 -0
- data/vendor/assets/stylesheets/MarkerCluster.Default.css +60 -0
- data/vendor/assets/stylesheets/MarkerCluster.css +14 -0
- data/vendor/assets/stylesheets/leaflet.css +635 -0
- metadata +85 -90
- data/.travis.yml +0 -25
- data/config/jetty.yml +0 -7
- data/lib/blacklight/maps/controller_override.rb +0 -20
- data/lib/generators/blacklight_maps/templates/saved_searches_controller.rb +0 -5
- data/spec/features/initial_view_spec.rb +0 -21
- data/spec/features/maps_spec.rb +0 -202
- data/spec/features/show_view_maplet_spec.rb +0 -93
- data/spec/test_app_templates/Gemfile.extra +0 -5
- /data/{solr_conf → lib/generators/blacklight_maps/templates/solr}/conf/schema.xml +0 -0
- /data/{solr_conf → lib/generators/blacklight_maps/templates/solr}/conf/solrconfig.xml +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a5f97f65f09264f6f7c17afda244ee952c15c01fccf072e60e89ec7401a15989
|
4
|
+
data.tar.gz: c00ba470859274d2e62cff117c875deea3c7aa4c419595e46b5087bbc30b4c99
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e27c8bc1357431f728a924d8ff6557ec6e9ea0d32962cb3c94eeaf0e0c5a8fff5a7eb7c7dc62f2c84c89f77ae1308521eef579c76d4ee01991b813cdbc76d5a6
|
7
|
+
data.tar.gz: 00134ab9767316aa17974520e3b8f8a050bbd7959c7b31d24913d791a7556028307b4266fa60d495e6f15c7adf1df0d9389914ac68e023fb4dadb88e6fbb7e37
|
@@ -0,0 +1,33 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [master]
|
6
|
+
pull_request:
|
7
|
+
branches: [master]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
test:
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
name: test (ruby ${{ matrix.ruby }} / rails ${{ matrix.rails_version }} / blacklight ${{ matrix.blacklight_version }} ${{ matrix.additional_name }})
|
13
|
+
strategy:
|
14
|
+
matrix:
|
15
|
+
ruby: ["3.2", "3.3", "3.4"]
|
16
|
+
rails_version: ["7.1.5.1", "7.2.2"]
|
17
|
+
blacklight_version: ["~> 7.0"]
|
18
|
+
additional_engine_cart_rails_options: [""]
|
19
|
+
additional_name: [""]
|
20
|
+
env:
|
21
|
+
RAILS_VERSION: ${{ matrix.rails_version }}
|
22
|
+
BLACKLIGHT_VERSION: ${{ matrix.blacklight_version }}
|
23
|
+
ENGINE_CART_RAILS_OPTIONS: "--skip-action-cable ${{ matrix.additional_engine_cart_rails_options }}"
|
24
|
+
steps:
|
25
|
+
- uses: actions/checkout@v4
|
26
|
+
- name: Set up Ruby ${{ matrix.ruby }}
|
27
|
+
uses: ruby/setup-ruby@v1
|
28
|
+
with:
|
29
|
+
ruby-version: ${{ matrix.ruby }}
|
30
|
+
- name: Install dependencies with Rails ${{ matrix.rails_version }}
|
31
|
+
run: bundle install
|
32
|
+
- name: Run tests
|
33
|
+
run: bundle exec rake
|
data/.gitignore
CHANGED
data/.rubocop.yml
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
plugins:
|
2
|
+
- rubocop-rspec
|
3
|
+
- rubocop-rails
|
4
|
+
|
5
|
+
AllCops:
|
6
|
+
DisplayCopNames: true
|
7
|
+
TargetRubyVersion: 3.4
|
8
|
+
Exclude:
|
9
|
+
- "lib/generators/blacklight_maps/templates/**/*"
|
10
|
+
- "blacklight-maps.gemspec"
|
11
|
+
|
12
|
+
# engine_cart block includes conditional, not duplication
|
13
|
+
Bundler/DuplicatedGem:
|
14
|
+
Exclude:
|
15
|
+
- 'Gemfile'
|
16
|
+
|
17
|
+
# engine_cart block is following default Rails order
|
18
|
+
Bundler/OrderedGems:
|
19
|
+
Exclude:
|
20
|
+
- 'Gemfile'
|
21
|
+
|
22
|
+
Layout/IndentationConsistency:
|
23
|
+
EnforcedStyle: normal
|
24
|
+
|
25
|
+
Metrics/AbcSize:
|
26
|
+
Max: 20
|
27
|
+
Exclude:
|
28
|
+
- 'lib/blacklight/maps/maps_search_builder.rb'
|
29
|
+
|
30
|
+
Metrics/BlockLength:
|
31
|
+
Exclude:
|
32
|
+
- "spec/**/*"
|
33
|
+
|
34
|
+
Metrics/ClassLength:
|
35
|
+
Exclude:
|
36
|
+
- 'lib/blacklight/maps/export.rb'
|
37
|
+
|
38
|
+
Layout/LineLength:
|
39
|
+
Max: 200
|
40
|
+
Exclude:
|
41
|
+
- 'lib/blacklight/maps/engine.rb'
|
42
|
+
- 'spec/**/*'
|
43
|
+
|
44
|
+
Metrics/MethodLength:
|
45
|
+
Max: 15
|
46
|
+
|
47
|
+
Naming/HeredocDelimiterNaming:
|
48
|
+
Enabled: false
|
49
|
+
|
50
|
+
Naming/PredicateName:
|
51
|
+
ForbiddenPrefixes:
|
52
|
+
- is_
|
53
|
+
|
54
|
+
Rails:
|
55
|
+
Enabled: true
|
56
|
+
|
57
|
+
Rails/HelperInstanceVariable:
|
58
|
+
Enabled: false
|
59
|
+
|
60
|
+
Rails/OutputSafety:
|
61
|
+
Enabled: false
|
62
|
+
|
63
|
+
RSpec/AnyInstance:
|
64
|
+
Exclude:
|
65
|
+
- 'spec/system/initial_view_spec.rb'
|
66
|
+
|
67
|
+
RSpec/BeforeAfterAll:
|
68
|
+
Enabled: false
|
69
|
+
|
70
|
+
RSpec/DescribeClass:
|
71
|
+
Exclude:
|
72
|
+
- 'spec/system/*'
|
73
|
+
|
74
|
+
RSpec/SpecFilePathFormat:
|
75
|
+
Exclude:
|
76
|
+
- 'spec/lib/blacklight/maps/*'
|
77
|
+
|
78
|
+
RSpec/MessageSpies:
|
79
|
+
EnforcedStyle: receive
|
80
|
+
|
81
|
+
RSpec/MultipleExpectations:
|
82
|
+
Max: 4
|
83
|
+
|
84
|
+
RSpec/MultipleMemoizedHelpers:
|
85
|
+
Max: 10
|
86
|
+
|
87
|
+
RSpec/NestedGroups:
|
88
|
+
Max: 5
|
89
|
+
|
90
|
+
RSpec/PredicateMatcher:
|
91
|
+
Exclude:
|
92
|
+
- 'spec/lib/blacklight/maps/render_constraints_override_spec.rb'
|
93
|
+
|
94
|
+
# https://github.com/rubocop-hq/rubocop/issues/6439
|
95
|
+
Style/AccessModifierDeclarations:
|
96
|
+
Enabled: false
|
97
|
+
|
98
|
+
Style/Documentation:
|
99
|
+
Enabled: false
|
100
|
+
|
101
|
+
Style/SignalException:
|
102
|
+
Exclude:
|
103
|
+
- 'spec/**/*'
|
data/.solr_wrapper.yml
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
# Place any default configuration for solr_wrapper here
|
2
|
+
# you must first run 'rake engine_cart:generate' to create the test app
|
3
|
+
# before running 'solr_wrapper' from project root
|
4
|
+
# port: 8983
|
5
|
+
collection:
|
6
|
+
dir: ./.internal_test_app/solr/conf/
|
7
|
+
name: blacklight-core
|
8
|
+
version: 9.6.1
|
data/Gemfile
CHANGED
@@ -1,15 +1,45 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
source 'https://rubygems.org'
|
2
4
|
|
3
|
-
# Specify your gem's dependencies in blacklight-maps.gemspec
|
4
5
|
gemspec
|
5
6
|
|
6
|
-
group :test do
|
7
|
-
gem '
|
8
|
-
gem 'coveralls', require: false
|
7
|
+
group :development, :test do
|
8
|
+
gem 'coveralls_reborn', require: false
|
9
9
|
end
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
11
|
+
# BEGIN ENGINE_CART BLOCK
|
12
|
+
# engine_cart: 2.6.0
|
13
|
+
# engine_cart stanza: 2.5.0
|
14
|
+
# the below comes from engine_cart, a gem used to test this Rails engine gem in the context of a Rails app.
|
15
|
+
file = File.expand_path('Gemfile', ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path('.internal_test_app', File.dirname(__FILE__)))
|
16
|
+
if File.exist?(file)
|
17
|
+
begin
|
18
|
+
eval_gemfile file
|
19
|
+
rescue Bundler::GemfileError => e
|
20
|
+
Bundler.ui.warn '[EngineCart] Skipping Rails application dependencies:'
|
21
|
+
Bundler.ui.warn e.message
|
22
|
+
end
|
23
|
+
else
|
24
|
+
Bundler.ui.warn "[EngineCart] Unable to find test application dependencies in #{file}, using placeholder dependencies"
|
25
|
+
|
26
|
+
if ENV['RAILS_VERSION']
|
27
|
+
if ENV['RAILS_VERSION'] == 'edge'
|
28
|
+
gem 'rails', github: 'rails/rails'
|
29
|
+
ENV['ENGINE_CART_RAILS_OPTIONS'] = '--edge --skip-turbolinks'
|
30
|
+
else
|
31
|
+
gem 'rails', ENV['RAILS_VERSION']
|
32
|
+
end
|
33
|
+
|
34
|
+
case ENV['RAILS_VERSION']
|
35
|
+
when /^6.0/
|
36
|
+
gem 'sass-rails', '>= 6'
|
37
|
+
gem 'webpacker', '~> 4.0'
|
38
|
+
when /^5.[12]/
|
39
|
+
gem 'sass-rails', '~> 5.0'
|
40
|
+
gem 'sprockets', '~> 3.7'
|
41
|
+
gem 'thor', '~> 0.20'
|
42
|
+
end
|
43
|
+
end
|
15
44
|
end
|
45
|
+
# END ENGINE_CART BLOCK
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Blacklight::Maps
|
2
2
|
|
3
|
-
|
3
|
+
 | [](https://coveralls.io/r/projectblacklight/blacklight-maps?branch=master)
|
4
4
|
|
5
5
|
Provides map views for Blacklight for items with geospatial coordinate (latitude/longitude) metadata.
|
6
6
|
|
@@ -53,11 +53,11 @@ Blacklight-Maps requires that your Solr index include at least one (but preferab
|
|
53
53
|
|
54
54
|
```
|
55
55
|
# coordinates: lon lat or lat,lon
|
56
|
-
# bounding box: minX
|
57
|
-
|
56
|
+
# bounding box: ENVELOPE(minX, maxX, maxY, minY)
|
57
|
+
coordinates_srpt:
|
58
58
|
- 78.96288 20.593684
|
59
59
|
- 20.593684,78.96288
|
60
|
-
- 68.162386
|
60
|
+
- ENVELOPE(68.162386, 97.395555, 35.5044752, 6.7535159)
|
61
61
|
```
|
62
62
|
|
63
63
|
2. An indexed, stored string field containing a properly-formatted [GeoJSON](http://geojson.org) feature object for a point or bounding box that includes the coordinates and (preferably) location name. This field can be multivalued.
|
@@ -74,7 +74,7 @@ Blacklight-Maps requires that your Solr index include at least one (but preferab
|
|
74
74
|
3. An indexed, stored text or string field containing location names. This field can be multivalued.
|
75
75
|
|
76
76
|
```
|
77
|
-
|
77
|
+
subject_geo_ssim: India
|
78
78
|
```
|
79
79
|
|
80
80
|
##### Why so complicated?
|
@@ -88,10 +88,10 @@ Blacklight-Maps can be used with either field type (#1 or #2), however to take a
|
|
88
88
|
**Important:** If you are NOT using the geojson field (#2), you should create a `copyField` in your Solr schema.xml to copy the coordinates from the `location_rpt` field to a string field that is stored, indexed, and multivalued to allow for proper faceting of the coordinate values in the catalog#map and catalog#index views.
|
89
89
|
|
90
90
|
```
|
91
|
-
<!--
|
92
|
-
<dynamicField name="
|
91
|
+
<!-- Solr location_rpt field for coordinates, shapes, etc. -->
|
92
|
+
<dynamicField name="*_srpt" type="location_rpt" indexed="true" stored="true" multiValued="true" />
|
93
93
|
<!-- copy geospatial to string field for faceting -->
|
94
|
-
<copyField source="
|
94
|
+
<copyField source="coordinates_srpt" dest="coordinates_ssim" />
|
95
95
|
```
|
96
96
|
|
97
97
|
Support for additional field types may be added in the future.
|
@@ -112,9 +112,9 @@ Blacklight-Maps expects you to provide these configuration options:
|
|
112
112
|
+ `placename_field` = the name of the Solr field containing the location names
|
113
113
|
+ `coordinates_field` = the name of the Solr `location_rpt` type field containing geospatial coordinate data
|
114
114
|
|
115
|
-
In addition, you must add the geospatial facet field to the list of facet fields:
|
115
|
+
In addition, you must add the geospatial facet field to the list of facet fields in `app/controllers/catalog_controller.rb`, for example:
|
116
116
|
```ruby
|
117
|
-
config.add_facet_field '
|
117
|
+
config.add_facet_field 'geojson_ssim', :limit => -2, :label => 'Coordinates', :show => false
|
118
118
|
```
|
119
119
|
|
120
120
|
#### Optional
|
@@ -196,9 +196,11 @@ The table below indicates which versions of Blacklight Maps are compatible with
|
|
196
196
|
|
197
197
|
Blacklight Maps version | works with Blacklight version
|
198
198
|
----------------------- | ---------------------
|
199
|
-
|
200
|
-
|
201
|
-
|
199
|
+
1.2.* | >= 7.35.0, < 8
|
200
|
+
1.1.* | >= 7.8.0, < 8
|
201
|
+
0.5.* | >= 6.1.0, < 7
|
202
|
+
0.4.* | >= 5.12.0, < 6.*
|
203
|
+
<= 0.3.3 | >= 5.1, <= 5.11.2
|
202
204
|
|
203
205
|
## Contributing
|
204
206
|
|
data/Rakefile
CHANGED
@@ -1,43 +1,46 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
begin
|
4
|
+
require 'bundler/setup'
|
5
|
+
rescue LoadError
|
6
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
7
|
+
end
|
8
8
|
|
9
|
-
require '
|
9
|
+
require 'rdoc/task'
|
10
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
11
|
+
rdoc.rdoc_dir = 'rdoc'
|
12
|
+
rdoc.title = 'BlacklightMaps'
|
13
|
+
rdoc.options << '--line-numbers'
|
14
|
+
rdoc.rdoc_files.include('README.rdoc')
|
15
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
16
|
+
end
|
10
17
|
|
11
|
-
|
18
|
+
Bundler::GemHelper.install_tasks
|
12
19
|
|
13
|
-
|
20
|
+
Rake::Task.define_task(:environment)
|
14
21
|
|
15
|
-
|
16
|
-
task :fixtures => ['engine_cart:generate'] do
|
17
|
-
EngineCart.within_test_app do
|
18
|
-
system "rake blacklight_maps:solr:seed RAILS_ENV=test"
|
19
|
-
end
|
20
|
-
end
|
22
|
+
load 'lib/railties/blacklight_maps.rake'
|
21
23
|
|
22
|
-
|
23
|
-
task :ci => ['engine_cart:generate', 'jetty:clean', 'blacklight_maps:configure_jetty'] do
|
24
|
-
|
25
|
-
require 'jettywrapper'
|
26
|
-
jetty_params = Jettywrapper.load_config('test')
|
24
|
+
task default: :ci
|
27
25
|
|
28
|
-
|
29
|
-
Rake::Task['fixtures'].invoke
|
30
|
-
Rake::Task['spec'].invoke
|
31
|
-
end
|
32
|
-
raise "test failures: #{error}" if error
|
33
|
-
end
|
26
|
+
require 'engine_cart/rake_task'
|
34
27
|
|
28
|
+
require 'solr_wrapper'
|
35
29
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
30
|
+
require 'rspec/core/rake_task'
|
31
|
+
RSpec::Core::RakeTask.new
|
32
|
+
|
33
|
+
require 'rubocop/rake_task'
|
34
|
+
RuboCop::RakeTask.new(:rubocop)
|
35
|
+
|
36
|
+
desc 'Run test suite'
|
37
|
+
task ci: [:rubocop, 'engine_cart:generate'] do
|
38
|
+
SolrWrapper.wrap do |solr|
|
39
|
+
solr.with_collection do
|
40
|
+
within_test_app do
|
41
|
+
system 'RAILS_ENV=test rake blacklight_maps:index:seed'
|
42
|
+
end
|
43
|
+
Rake::Task['spec'].invoke
|
41
44
|
end
|
42
45
|
end
|
43
|
-
end
|
46
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M16,12a5.11,5.11,0,0,0,.8-1.6ZM8,12l-.8-1.6A4.72,4.72,0,0,0,8,12Z"/><path d="M12,4A5,5,0,0,0,7,9a4.71,4.71,0,0,0,.1,1c0,.13.06.26.1.39L8,12l4,8,4-8,.8-1.6L16.9,10A4.71,4.71,0,0,0,17,9,5,5,0,0,0,12,4Zm0,7a2,2,0,1,1,1.73-1A2,2,0,0,1,12,11Z"/><path d="M7.1,10c0,.13.06.26.1.39L7,10Z"/><path d="M17,10l-.19.39L16.9,10Z"/></svg>
|
@@ -5,8 +5,8 @@
|
|
5
5
|
|
6
6
|
// Configure default options and those passed via the constructor options
|
7
7
|
var options = $.extend({
|
8
|
-
tileurl : '
|
9
|
-
mapattribution : 'Map data © <a href="
|
8
|
+
tileurl : 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
9
|
+
mapattribution : 'Map data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors, <a' + ' href="https://creativecommons.org/licenses/by-sa/4.0/">CC-BY-SA</a>',
|
10
10
|
initialzoom: 2,
|
11
11
|
singlemarkermode: true,
|
12
12
|
searchcontrol: false,
|
@@ -21,7 +21,7 @@
|
|
21
21
|
// Extend options from data-attributes
|
22
22
|
$.extend(options, this.data());
|
23
23
|
|
24
|
-
var mapped_items = '<span class="mapped-count"><span class="badge">' + geojson_docs.features.length + '</span> location' + (geojson_docs.features.length !== 1 ? 's' : '') + ' mapped</span>';
|
24
|
+
var mapped_items = '<span class="mapped-count"><span class="badge badge-secondary">' + geojson_docs.features.length + '</span>' + ' location' + (geojson_docs.features.length !== 1 ? 's' : '') + ' mapped</span>';
|
25
25
|
|
26
26
|
var mapped_caveat = '<span class="mapped-caveat">Only items with location data are shown below</span>';
|
27
27
|
|
@@ -31,12 +31,12 @@
|
|
31
31
|
|
32
32
|
// Update page links with number of mapped items, disable sort, per_page, pagination
|
33
33
|
if (sortAndPerPage.length) { // catalog#index and #map view
|
34
|
-
var page_links = sortAndPerPage.find('.
|
35
|
-
var result_count = page_links.find('.
|
36
|
-
page_links.html('<span class="
|
34
|
+
var page_links = sortAndPerPage.find('.page-links');
|
35
|
+
var result_count = page_links.find('.page-entries').find('strong').last().html();
|
36
|
+
page_links.html('<span class="page-entries"><strong>' + result_count + '</strong> items found</span>' + mapped_items + mapped_caveat);
|
37
37
|
sortAndPerPage.find('.dropdown-toggle').hide();
|
38
38
|
} else { // catalog#show view
|
39
|
-
|
39
|
+
$(this).before(mapped_items);
|
40
40
|
}
|
41
41
|
|
42
42
|
// determine whether to use item location or result count in cluster icon display
|
@@ -119,7 +119,6 @@
|
|
119
119
|
var container = L.DomUtil.create('div', 'leaflet-bar leaflet-control');
|
120
120
|
this.link = L.DomUtil.create('a', 'leaflet-bar-part search-control', container);
|
121
121
|
this.link.title = options.searchctrlcue;
|
122
|
-
this.icon = L.DomUtil.create('i', 'glyphicon glyphicon-search', this.link);
|
123
122
|
|
124
123
|
L.DomEvent.addListener(this.link, 'click', _search);
|
125
124
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
@import 'leaflet';
|
2
|
-
@import '
|
3
|
-
@import '
|
2
|
+
@import 'MarkerCluster';
|
3
|
+
@import 'MarkerCluster.Default';
|
4
4
|
|
5
5
|
body.blacklight-catalog-map {
|
6
6
|
|
@@ -14,21 +14,17 @@ body.blacklight-catalog-map {
|
|
14
14
|
|
15
15
|
}
|
16
16
|
|
17
|
-
.view-icon-maps {
|
18
|
-
&:before { content: "\e135"; }
|
19
|
-
}
|
20
|
-
|
21
17
|
#sortAndPerPage {
|
22
18
|
|
23
|
-
.
|
19
|
+
.page-links {
|
24
20
|
|
25
21
|
.mapped-count {
|
26
|
-
margin-left:
|
22
|
+
margin-left: 10px;
|
27
23
|
color: dimgray;
|
28
24
|
}
|
29
25
|
|
30
26
|
.mapped-caveat {
|
31
|
-
margin-left:
|
27
|
+
margin-left: 10px;
|
32
28
|
font-size: 12px;
|
33
29
|
color: darkgray;
|
34
30
|
}
|
@@ -45,7 +41,7 @@ body.blacklight-catalog-map {
|
|
45
41
|
|
46
42
|
& ~ div.record-padding {
|
47
43
|
|
48
|
-
|
44
|
+
nav.pagination {
|
49
45
|
display: none;
|
50
46
|
}
|
51
47
|
|
@@ -65,6 +61,7 @@ body.blacklight-catalog-map {
|
|
65
61
|
|
66
62
|
a.leaflet-bar-part.search-control {
|
67
63
|
cursor: pointer;
|
64
|
+
&:before { content: "\1F50D"; }
|
68
65
|
}
|
69
66
|
|
70
67
|
/* Portrait tablet to landscape and desktop */
|