blacklight-maps 0.5.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +2 -0
- data/.rubocop.yml +99 -0
- data/.solr_wrapper.yml +7 -0
- data/.travis.yml +19 -16
- data/Gemfile +40 -7
- data/README.md +13 -12
- data/Rakefile +35 -32
- data/app/assets/images/blacklight/maps.svg +1 -0
- data/app/assets/javascripts/blacklight-maps.js +1 -4
- data/app/assets/javascripts/blacklight-maps/blacklight-maps-browse.js +7 -8
- 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.rb +8 -2
- data/lib/blacklight/maps/controller.rb +27 -0
- data/lib/blacklight/maps/engine.rb +12 -13
- data/lib/blacklight/maps/export.rb +112 -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/generators/blacklight_maps/install_generator.rb +38 -31
- data/lib/generators/blacklight_maps/templates/search_history_controller.rb +2 -0
- 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
- 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 +19 -21
- data/spec/system/index_view_spec.rb +127 -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 +86 -91
- 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
@@ -1,93 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe "catalog#show view", js: true do
|
4
|
-
|
5
|
-
before :each do
|
6
|
-
CatalogController.blacklight_config = Blacklight::Configuration.new
|
7
|
-
CatalogController.configure_blacklight do |config|
|
8
|
-
# add maplet to show view partials
|
9
|
-
config.show.partials << :show_maplet
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
describe "item with point feature" do
|
14
|
-
|
15
|
-
before :each do
|
16
|
-
visit solr_document_path("00314247")
|
17
|
-
end
|
18
|
-
|
19
|
-
it "should display the maplet" do
|
20
|
-
expect(page).to have_selector("#blacklight-show-map-container")
|
21
|
-
end
|
22
|
-
|
23
|
-
it "should have a single marker icon" do
|
24
|
-
expect(page).to have_selector(".leaflet-marker-icon", count: 1)
|
25
|
-
end
|
26
|
-
|
27
|
-
describe "click marker icon" do
|
28
|
-
|
29
|
-
before { find(".leaflet-marker-icon").click }
|
30
|
-
|
31
|
-
it "should show a popup with correct content" do
|
32
|
-
expect(page).to have_selector("div.leaflet-popup-content-wrapper")
|
33
|
-
expect(page).to have_content("Japan")
|
34
|
-
end
|
35
|
-
|
36
|
-
end
|
37
|
-
|
38
|
-
end
|
39
|
-
|
40
|
-
describe "item with point and bbox features" do
|
41
|
-
|
42
|
-
before :each do
|
43
|
-
visit solr_document_path("2008308175")
|
44
|
-
end
|
45
|
-
|
46
|
-
it "should show the correct mapped item count" do
|
47
|
-
expect(page).to have_selector(".mapped-count .badge", text: "2")
|
48
|
-
end
|
49
|
-
|
50
|
-
it "should show a bounding box and a point marker" do
|
51
|
-
expect(page).to have_selector(".leaflet-overlay-pane path.leaflet-clickable")
|
52
|
-
expect(page).to have_selector(".leaflet-marker-icon")
|
53
|
-
end
|
54
|
-
|
55
|
-
describe "click bbox path" do
|
56
|
-
|
57
|
-
before do
|
58
|
-
0.upto(4) { find("a.leaflet-control-zoom-in").click } #so bbox not covered by point
|
59
|
-
find(".leaflet-overlay-pane svg").click
|
60
|
-
end
|
61
|
-
|
62
|
-
it "should show a popup with correct content" do
|
63
|
-
expect(page).to have_selector("div.leaflet-popup-content-wrapper")
|
64
|
-
expect(page).to have_content("[68.162386, 6.7535159, 97.395555, 35.5044752]")
|
65
|
-
end
|
66
|
-
|
67
|
-
end
|
68
|
-
|
69
|
-
end
|
70
|
-
|
71
|
-
describe "item with bbox feature" do
|
72
|
-
|
73
|
-
before :each do
|
74
|
-
CatalogController.configure_blacklight do |config|
|
75
|
-
# set zoom config so we can test whether setMapBounds() is correct
|
76
|
-
config.view.maps.maxzoom = 8
|
77
|
-
config.view.maps.show_initial_zoom = 10
|
78
|
-
end
|
79
|
-
visit solr_document_path("2009373514")
|
80
|
-
end
|
81
|
-
|
82
|
-
it "should display a bounding box" do
|
83
|
-
expect(page).to have_selector(".leaflet-overlay-pane path.leaflet-clickable")
|
84
|
-
end
|
85
|
-
|
86
|
-
it "should zoom to the correct map bounds" do
|
87
|
-
# if setMapBounds() zoom >= maxzoom, zoom-in control will be disabled
|
88
|
-
expect(page).to have_selector(".leaflet-control-zoom-in.leaflet-disabled")
|
89
|
-
end
|
90
|
-
|
91
|
-
end
|
92
|
-
|
93
|
-
end
|