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
@@ -1,101 +1,96 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
tag(:div, options)
|
3
|
+
module Blacklight
|
4
|
+
module BlacklightMapsHelperBehavior
|
5
|
+
# @param id [String] the html element id
|
6
|
+
# @param tag_options [Hash] options to put on the tag
|
7
|
+
def blacklight_map_tag(id, tag_options = {}, &block)
|
8
|
+
maps_config = blacklight_config.view.maps
|
9
|
+
default_data = {
|
10
|
+
maxzoom: maps_config.maxzoom,
|
11
|
+
tileurl: maps_config.tileurl,
|
12
|
+
mapattribution: maps_config.mapattribution
|
13
|
+
}
|
14
|
+
options = { id: id, data: default_data }.deep_merge(tag_options)
|
15
|
+
block_given? ? content_tag(:div, options, &block) : tag.div(**options)
|
17
16
|
end
|
18
|
-
end
|
19
17
|
|
20
|
-
|
21
|
-
|
22
|
-
geojson_hash
|
23
|
-
|
24
|
-
|
25
|
-
# create a link to a bbox spatial search
|
26
|
-
def link_to_bbox_search bbox_coordinates
|
27
|
-
coords_for_search = bbox_coordinates.map { |v| v.to_s }
|
28
|
-
link_to(t('blacklight.maps.interactions.bbox_search'),
|
29
|
-
search_catalog_path(spatial_search_type: "bbox",
|
30
|
-
coordinates: "[#{coords_for_search[1]},#{coords_for_search[0]} TO #{coords_for_search[3]},#{coords_for_search[2]}]",
|
31
|
-
view: default_document_index_view_type))
|
32
|
-
end
|
33
|
-
|
34
|
-
# create a link to a location name facet value
|
35
|
-
def link_to_placename_field field_value, field, displayvalue = nil
|
36
|
-
if params[:f] && params[:f][field] && params[:f][field].include?(field_value)
|
37
|
-
new_params = params
|
38
|
-
else
|
39
|
-
new_params = search_state.add_facet_params(field, field_value)
|
18
|
+
# return the placename value to be used as a link
|
19
|
+
# @param geojson_hash [Hash]
|
20
|
+
def placename_value(geojson_hash)
|
21
|
+
geojson_hash[:properties][blacklight_config.view.maps.placename_property.to_sym]
|
40
22
|
end
|
41
|
-
new_params[:view] = default_document_index_view_type
|
42
|
-
link_to(displayvalue.presence || field_value,
|
43
|
-
search_catalog_path(new_params.except(:id, :spatial_search_type, :coordinates)))
|
44
|
-
end
|
45
23
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
24
|
+
# create a link to a bbox spatial search
|
25
|
+
# @param bbox [Array]
|
26
|
+
def link_to_bbox_search(bbox)
|
27
|
+
bbox_coords = bbox.map(&:to_s)
|
28
|
+
bbox_search_coords = "[#{bbox_coords[1]},#{bbox_coords[0]} TO #{bbox_coords[3]},#{bbox_coords[2]}]"
|
29
|
+
link_to(t('blacklight.maps.interactions.bbox_search'),
|
30
|
+
search_catalog_path(spatial_search_type: 'bbox',
|
31
|
+
coordinates: bbox_search_coords,
|
32
|
+
view: default_document_index_view_type))
|
33
|
+
end
|
54
34
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
35
|
+
# create a link to a location name facet value
|
36
|
+
# @param field_value [String] Solr field value
|
37
|
+
# @param field [String] Solr field name
|
38
|
+
# @param display_value [String] value to display instead of field_value
|
39
|
+
def link_to_placename_field(field_value, field, display_value = nil)
|
40
|
+
new_params = if params[:f] && params[:f][field]&.include?(field_value)
|
41
|
+
search_state.params
|
42
|
+
else
|
43
|
+
search_state.add_facet_params(field, field_value)
|
44
|
+
end
|
45
|
+
new_params[:view] = default_document_index_view_type
|
46
|
+
new_params.except!(:id, :spatial_search_type, :coordinates, :controller, :action)
|
47
|
+
link_to(display_value.presence || field_value, search_catalog_path(new_params))
|
48
|
+
end
|
61
49
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
[]
|
50
|
+
# create a link to a spatial search for a set of point coordinates
|
51
|
+
# @param point_coords [Array]
|
52
|
+
def link_to_point_search(point_coords)
|
53
|
+
new_params = params.except(:controller, :action, :view, :id, :spatial_search_type, :coordinates)
|
54
|
+
new_params[:spatial_search_type] = 'point'
|
55
|
+
new_params[:coordinates] = "#{point_coords[1]},#{point_coords[0]}"
|
56
|
+
new_params[:view] = default_document_index_view_type
|
57
|
+
new_params.permit!
|
58
|
+
link_to(t('blacklight.maps.interactions.point_search'), search_catalog_path(new_params))
|
68
59
|
end
|
69
|
-
end
|
70
60
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
end
|
61
|
+
# render the location name for the Leaflet popup
|
62
|
+
# @param geojson_hash [Hash]
|
63
|
+
def render_placename_heading(geojson_hash)
|
64
|
+
geojson_hash[:properties][blacklight_config.view.maps.placename_property.to_sym]
|
65
|
+
end
|
77
66
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
67
|
+
# render the map for #index and #map views
|
68
|
+
def render_index_mapview
|
69
|
+
maps_config = blacklight_config.view.maps
|
70
|
+
map_facet_field = if maps_config.facet_mode == 'coordinates'
|
71
|
+
maps_config.coordinates_facet_field
|
72
|
+
else
|
73
|
+
maps_config.geojson_field
|
74
|
+
end
|
75
|
+
map_facet_values = @response.aggregations[map_facet_field]&.items || []
|
76
|
+
render partial: 'catalog/index_mapview',
|
77
|
+
locals: { geojson_features: serialize_geojson(map_facet_values) }
|
78
|
+
end
|
83
79
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
link_to_bbox_search(
|
88
|
-
else
|
89
|
-
link_to_point_search(coordinates)
|
80
|
+
# determine the type of spatial search to use based on coordinates (bbox or point)
|
81
|
+
# @param coords [Array]
|
82
|
+
def render_spatial_search_link(coords)
|
83
|
+
coords.length == 4 ? link_to_bbox_search(coords) : link_to_point_search(coords)
|
90
84
|
end
|
91
|
-
end
|
92
85
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
86
|
+
# pass the document or facet values to BlacklightMaps::GeojsonExport
|
87
|
+
# @param documents [Array || SolrDocument]
|
88
|
+
def serialize_geojson(documents, options = {})
|
89
|
+
export = BlacklightMaps::GeojsonExport.new(controller,
|
90
|
+
action_name.to_sym,
|
91
|
+
documents,
|
92
|
+
options)
|
93
|
+
export.to_geojson
|
94
|
+
end
|
100
95
|
end
|
101
96
|
end
|
@@ -1,10 +1,9 @@
|
|
1
1
|
<% # map for catalog#show view %>
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
</div>
|
2
|
+
<% if @document[blacklight_config.view.maps.geojson_field.to_sym] || @document[blacklight_config.view.maps.coordinates_field.to_sym] %>
|
3
|
+
<div id="blacklight-show-map-container">
|
4
|
+
<%= blacklight_map_tag('blacklight-show-map',
|
5
|
+
{data:{initialzoom:blacklight_config.view.maps.show_initial_zoom,
|
6
|
+
singlemarkermode:false}}) %>
|
7
|
+
<%= javascript_tag "$('#blacklight-show-map').blacklight_leaflet_map(#{serialize_geojson(@document)});" %>
|
8
|
+
</div>
|
9
|
+
<% end %>
|
@@ -1,8 +1,8 @@
|
|
1
1
|
<div id="content" class="col-md-12 col-sm-12">
|
2
2
|
<h1><%= t('blacklight.maps.title') %></h1>
|
3
|
-
<div id="map_leader_text"><%= t('blacklight.maps.
|
3
|
+
<div id="map_leader_text"><%= t('blacklight.maps.leader_html') %></div>
|
4
4
|
<%= render 'search_results' %>
|
5
5
|
</div>
|
6
6
|
|
7
7
|
<%# have to put this at the end so it overrides 'catalog/search_results' %>
|
8
|
-
<% @page_title = t('blacklight.maps.title', :
|
8
|
+
<% @page_title = t('blacklight.maps.title', application_name: application_name) %>
|
data/blacklight-maps.gemspec
CHANGED
@@ -1,33 +1,34 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
5
|
require 'blacklight/maps/version'
|
5
6
|
|
6
|
-
Gem::Specification.new do |
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
s.name = 'blacklight-maps'
|
9
|
+
s.version = Blacklight::Maps::VERSION
|
10
|
+
s.authors = ['Chris Beer', 'Jack Reed', 'Eben English']
|
11
|
+
s.email = %w[cabeer@stanford.edu pjreed@stanford.edu eenglish@bpl.org]
|
12
|
+
s.summary = 'Maps for Blacklight'
|
13
|
+
s.description = 'Blacklight plugin providing map views for records with geographic data.'
|
14
|
+
s.homepage = 'https://github.com/projectblacklight/blacklight-maps'
|
15
|
+
s.license = 'Apache-2.0'
|
14
16
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
17
|
+
s.files = `git ls-files -z`.split("\x0")
|
18
|
+
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
19
|
+
s.bindir = 'exe'
|
20
|
+
s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
|
+
s.require_paths = ['lib']
|
19
22
|
|
20
|
-
|
21
|
-
|
22
|
-
spec.add_dependency "bootstrap-sass", "~> 3.2"
|
23
|
-
spec.add_dependency "leaflet-rails", "0.7.7"
|
24
|
-
spec.add_dependency "leaflet-markercluster-rails"
|
23
|
+
s.add_dependency 'blacklight', '>= 7.35.0', '< 8'
|
24
|
+
s.add_dependency 'rails', '>= 7.1', '< 8'
|
25
25
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
26
|
+
s.add_development_dependency 'capybara'
|
27
|
+
s.add_development_dependency 'engine_cart', '~> 2.6'
|
28
|
+
s.add_development_dependency 'rspec-rails', '~> 7.1'
|
29
|
+
s.add_development_dependency 'rubocop', '~> 1.72.2'
|
30
|
+
s.add_development_dependency 'rubocop-rspec', '~> 3.4'
|
31
|
+
s.add_development_dependency "rubocop-rails", '~> 2.30'
|
32
|
+
s.add_development_dependency 'selenium-webdriver', '~> 4.0'
|
33
|
+
s.add_development_dependency 'solr_wrapper', '~> 4.1'
|
33
34
|
end
|
@@ -3,18 +3,18 @@ zh:
|
|
3
3
|
|
4
4
|
maps:
|
5
5
|
interactions:
|
6
|
-
bbox_search: '
|
7
|
-
placename_search: '
|
6
|
+
bbox_search: '查看与此边界框相交的项目'
|
7
|
+
placename_search: '查看此位置的物品'
|
8
8
|
item: '资料'
|
9
|
-
point_search: '
|
10
|
-
search_ctrl_cue: '
|
9
|
+
point_search: '查看此位置的物品'
|
10
|
+
search_ctrl_cue: '在当前地图窗口中搜索所有项目'
|
11
11
|
title: '地图'
|
12
|
-
leader: '
|
12
|
+
leader: '单击标记以从该位置搜索项目,或使用 🔍 按钮搜索当前地图窗口中的所有项目。'
|
13
13
|
|
14
14
|
search:
|
15
15
|
filters:
|
16
16
|
coordinates:
|
17
|
-
bbox: '
|
18
|
-
point: '
|
17
|
+
bbox: '边界框'
|
18
|
+
point: '座标'
|
19
19
|
view:
|
20
20
|
maps: '地图'
|
@@ -0,0 +1,21 @@
|
|
1
|
+
ar:
|
2
|
+
blacklight:
|
3
|
+
|
4
|
+
maps:
|
5
|
+
interactions:
|
6
|
+
bbox_search: 'عرض العناصر التي تتقاطع مع هذا المربع المحيط'
|
7
|
+
placename_search: 'عرض العناصر من هذا الموقع'
|
8
|
+
item: 'مادة'
|
9
|
+
point_search: 'عرض العناصر من هذا الموقع'
|
10
|
+
search_ctrl_cue: 'ابحث عن جميع العناصر داخل نافذة الخريطة الحالية'
|
11
|
+
title: 'خريطة'
|
12
|
+
leader_html: "انقر فوق علامة للبحث عن عناصر من هذا الموقع ، أو استخدم الزر للبحث عن جميع العناصر الموجودة في نافذة الخريطة الحالية."
|
13
|
+
|
14
|
+
search:
|
15
|
+
filters:
|
16
|
+
coordinates:
|
17
|
+
bbox: 'المربع المحيط'
|
18
|
+
point: 'إحداثيات'
|
19
|
+
view:
|
20
|
+
maps: 'خريطة'
|
21
|
+
|
@@ -0,0 +1,21 @@
|
|
1
|
+
de:
|
2
|
+
blacklight:
|
3
|
+
|
4
|
+
maps:
|
5
|
+
interactions:
|
6
|
+
bbox_search: 'Zeigen Sie Elemente an, die sich mit diesem Begrenzungsrahmen überschneiden'
|
7
|
+
placename_search: 'Zeigen Sie Elemente von diesem Speicherort aus an'
|
8
|
+
item: 'Artikel'
|
9
|
+
point_search: 'Zeigen Sie Elemente von diesem Speicherort aus an'
|
10
|
+
search_ctrl_cue: 'Suchen Sie nach allen Elementen im aktuellen Kartenfenster'
|
11
|
+
title: 'Karte'
|
12
|
+
leader_html: "Klicken Sie auf eine Markierung, um nach Elementen von diesem Ort aus zu suchen, oder verwenden Sie die 🔍 Schaltfläche, um nach allen Elementen im aktuellen Kartenfenster zu suchen."
|
13
|
+
|
14
|
+
search:
|
15
|
+
filters:
|
16
|
+
coordinates:
|
17
|
+
bbox: 'Begrenzungsrahmen'
|
18
|
+
point: 'Koordinaten'
|
19
|
+
view:
|
20
|
+
maps: 'Karte'
|
21
|
+
|
@@ -9,7 +9,7 @@ en:
|
|
9
9
|
point_search: 'View items from this location'
|
10
10
|
search_ctrl_cue: 'Search for all items within the current map window'
|
11
11
|
title: 'Map'
|
12
|
-
|
12
|
+
leader_html: "Click on a marker to search for items from that location, or use the 🔍 button to search for all items within the current map window."
|
13
13
|
|
14
14
|
search:
|
15
15
|
filters:
|
@@ -0,0 +1,21 @@
|
|
1
|
+
es:
|
2
|
+
blacklight:
|
3
|
+
|
4
|
+
maps:
|
5
|
+
interactions:
|
6
|
+
bbox_search: 'Ver elementos que se cruzan con este cuadro delimitador'
|
7
|
+
placename_search: 'Ver elementos desde esta ubicación'
|
8
|
+
item: 'articulo'
|
9
|
+
point_search: 'Ver elementos desde esta ubicación'
|
10
|
+
search_ctrl_cue: 'Buscar todos los elementos dentro de la ventana del mapa actual'
|
11
|
+
title: 'Mapa'
|
12
|
+
leader_html: "Haga clic en un marcador para buscar elementos desde esa ubicación, o use el 🔍 botón para buscar todos los elementos dentro de la ventana del mapa actual."
|
13
|
+
|
14
|
+
search:
|
15
|
+
filters:
|
16
|
+
coordinates:
|
17
|
+
bbox: 'Cuadro delimitador'
|
18
|
+
point: 'Coordenadas'
|
19
|
+
view:
|
20
|
+
maps: 'Mapa'
|
21
|
+
|
@@ -3,18 +3,18 @@ fr:
|
|
3
3
|
|
4
4
|
maps:
|
5
5
|
interactions:
|
6
|
-
bbox_search: '
|
7
|
-
placename_search: '
|
8
|
-
item: '
|
9
|
-
point_search: '
|
10
|
-
search_ctrl_cue: '
|
6
|
+
bbox_search: 'Afficher les éléments qui coupent avec ce cadre de sélection'
|
7
|
+
placename_search: 'Afficher les éléments de cet emplacement'
|
8
|
+
item: 'article'
|
9
|
+
point_search: 'Afficher les éléments de cet emplacement'
|
10
|
+
search_ctrl_cue: 'Rechercher tous les éléments dans la fenêtre de carte actuelle'
|
11
11
|
title: 'Carte'
|
12
|
-
leader: '
|
12
|
+
leader: 'Cliquez sur un marqueur pour rechercher des éléments à partir de cet emplacement, ou utilisez le 🔍 pour rechercher tous les éléments dans la fenêtre de carte actuelle.'
|
13
13
|
|
14
14
|
search:
|
15
15
|
filters:
|
16
16
|
coordinates:
|
17
|
-
bbox: '
|
18
|
-
point: '
|
17
|
+
bbox: 'Boîte de délimitation'
|
18
|
+
point: 'Coordonnés'
|
19
19
|
view:
|
20
20
|
maps: 'Carte'
|
@@ -0,0 +1,21 @@
|
|
1
|
+
hu:
|
2
|
+
blacklight:
|
3
|
+
|
4
|
+
maps:
|
5
|
+
interactions:
|
6
|
+
bbox_search: 'Tekintse meg azokat az elemeket, amelyek keresztezik ezt a határolódobozt'
|
7
|
+
placename_search: 'Tekintse meg az ezen a helyen található elemeket'
|
8
|
+
item: 'tétel'
|
9
|
+
point_search: 'Tekintse meg az ezen a helyen található elemeket'
|
10
|
+
search_ctrl_cue: 'Az összes elem keresése az aktuális térkép ablakban'
|
11
|
+
title: 'Térkép'
|
12
|
+
leader_html: "Kattintson a jelölőre az adott helyről elemek kereséséhez, vagy használja a 🔍 gombot az összes elem kereséséhez az aktuális térkép ablakban."
|
13
|
+
|
14
|
+
search:
|
15
|
+
filters:
|
16
|
+
coordinates:
|
17
|
+
bbox: 'Határoló doboz'
|
18
|
+
point: 'Koordináták'
|
19
|
+
view:
|
20
|
+
maps: 'Térkép'
|
21
|
+
|
@@ -3,18 +3,18 @@ it:
|
|
3
3
|
|
4
4
|
maps:
|
5
5
|
interactions:
|
6
|
-
bbox_search: '
|
7
|
-
placename_search: '
|
8
|
-
item: '
|
9
|
-
point_search: '
|
10
|
-
search_ctrl_cue: '
|
6
|
+
bbox_search: 'Visualizza gli elementi che si intersecano con questo rettangolo di selezione'
|
7
|
+
placename_search: 'Visualizza articoli da questa posizione'
|
8
|
+
item: 'articolo'
|
9
|
+
point_search: 'Visualizza articoli da questa posizione'
|
10
|
+
search_ctrl_cue: 'Cerca tutti gli elementi nella finestra della mappa corrente'
|
11
11
|
title: 'Mappa'
|
12
|
-
leader: '
|
12
|
+
leader: 'Fai clic su un marcatore per cercare elementi da quella posizione oppure usa 🔍 per cercare tutti gli elementi nella finestra della mappa corrente.'
|
13
13
|
|
14
14
|
search:
|
15
15
|
filters:
|
16
16
|
coordinates:
|
17
|
-
bbox: '
|
18
|
-
point: '
|
17
|
+
bbox: 'Rettangolo di selezione'
|
18
|
+
point: 'Coordinate'
|
19
19
|
view:
|
20
20
|
maps: 'Mappa'
|
@@ -0,0 +1,21 @@
|
|
1
|
+
nl:
|
2
|
+
blacklight:
|
3
|
+
|
4
|
+
maps:
|
5
|
+
interactions:
|
6
|
+
bbox_search: 'Bekijk items die kruisen met dit selectiekader'
|
7
|
+
placename_search: 'Bekijk items van deze locatie'
|
8
|
+
item: 'item'
|
9
|
+
point_search: 'Bekijk items van deze locatie'
|
10
|
+
search_ctrl_cue: 'Zoek naar alle items in het huidige kaartvenster'
|
11
|
+
title: 'Kaart'
|
12
|
+
leader_html: "Klik op een markering om naar items op die locatie te zoeken of gebruik de 🔍 knop om te zoeken naar alle items in het huidige kaartvenster."
|
13
|
+
|
14
|
+
search:
|
15
|
+
filters:
|
16
|
+
coordinates:
|
17
|
+
bbox: 'Begrenzende doos'
|
18
|
+
point: 'Coördinaten'
|
19
|
+
view:
|
20
|
+
maps: 'Kaart'
|
21
|
+
|
@@ -0,0 +1,21 @@
|
|
1
|
+
pt-BR:
|
2
|
+
blacklight:
|
3
|
+
|
4
|
+
maps:
|
5
|
+
interactions:
|
6
|
+
bbox_search: 'Exibir itens que se cruzam com esta caixa delimitadora'
|
7
|
+
placename_search: 'Ver itens deste local'
|
8
|
+
item: 'item'
|
9
|
+
point_search: 'Ver itens deste local'
|
10
|
+
search_ctrl_cue: 'Pesquise todos os itens na janela atual do mapa'
|
11
|
+
title: 'Mapa'
|
12
|
+
leader_html: "Clique em um marcador para procurar itens desse local ou use o 🔍 para procurar todos os itens na janela atual do mapa."
|
13
|
+
|
14
|
+
search:
|
15
|
+
filters:
|
16
|
+
coordinates:
|
17
|
+
bbox: 'Caixa delimitadora'
|
18
|
+
point: 'Coordenadas'
|
19
|
+
view:
|
20
|
+
maps: 'Mapa'
|
21
|
+
|
@@ -0,0 +1,21 @@
|
|
1
|
+
sq:
|
2
|
+
blacklight:
|
3
|
+
|
4
|
+
maps:
|
5
|
+
interactions:
|
6
|
+
bbox_search: 'Shikoni artikujt që kryqëzohen me këtë kuti kufizuese'
|
7
|
+
placename_search: 'Shikoni artikujt nga ky vendndodhje'
|
8
|
+
item: 'artikull'
|
9
|
+
point_search: 'Shikoni artikujt nga ky vendndodhje'
|
10
|
+
search_ctrl_cue: 'Kërkoni për të gjithë artikujt brenda dritares aktuale të hartës'
|
11
|
+
title: 'Hartë'
|
12
|
+
leader_html: "Klikoni në një shënues për të kërkuar artikuj nga ai vend, ose përdorni 🔍 butoni për të kërkuar të gjitha artikujt brenda dritares aktuale të hartës."
|
13
|
+
|
14
|
+
search:
|
15
|
+
filters:
|
16
|
+
coordinates:
|
17
|
+
bbox: 'Kuti kufizuese'
|
18
|
+
point: 'Koordinon'
|
19
|
+
view:
|
20
|
+
maps: 'Hartë'
|
21
|
+
|
data/config/routes.rb
CHANGED
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module BlacklightMaps
|
4
|
+
module Controller
|
5
|
+
extend ActiveSupport::Concern
|
6
|
+
|
7
|
+
included do
|
8
|
+
helper BlacklightMaps::RenderConstraintsOverride
|
9
|
+
end
|
10
|
+
|
11
|
+
def map
|
12
|
+
(@response, @document_list) = search_service.search_results
|
13
|
+
params[:view] = 'maps'
|
14
|
+
respond_to do |format|
|
15
|
+
format.html
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
##
|
20
|
+
# BlacklightMaps override: update to look for spatial query params
|
21
|
+
# Check if any search parameters have been set
|
22
|
+
# @return [Boolean]
|
23
|
+
def has_search_parameters?
|
24
|
+
params[:coordinates].present? || super
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -1,30 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'blacklight'
|
2
|
-
require 'leaflet-rails'
|
3
|
-
require 'leaflet-markercluster-rails'
|
4
4
|
|
5
5
|
module Blacklight
|
6
6
|
module Maps
|
7
7
|
class Engine < Rails::Engine
|
8
|
-
|
9
8
|
# Set some default configurations
|
10
|
-
initializer 'blacklight-maps.default_config' do |
|
11
|
-
Blacklight::Configuration.default_values[:view].maps.geojson_field =
|
12
|
-
Blacklight::Configuration.default_values[:view].maps.placename_property =
|
13
|
-
Blacklight::Configuration.default_values[:view].maps.coordinates_field =
|
14
|
-
Blacklight::Configuration.default_values[:view].maps.search_mode =
|
9
|
+
initializer 'blacklight-maps.default_config' do |_app|
|
10
|
+
Blacklight::Configuration.default_values[:view].maps.geojson_field = 'geojson_ssim'
|
11
|
+
Blacklight::Configuration.default_values[:view].maps.placename_property = 'placename'
|
12
|
+
Blacklight::Configuration.default_values[:view].maps.coordinates_field = 'coordinates_srpt'
|
13
|
+
Blacklight::Configuration.default_values[:view].maps.search_mode = 'placename' # or 'coordinates'
|
15
14
|
Blacklight::Configuration.default_values[:view].maps.spatial_query_dist = 0.5
|
16
|
-
Blacklight::Configuration.default_values[:view].maps.placename_field =
|
17
|
-
Blacklight::Configuration.default_values[:view].maps.coordinates_facet_field =
|
18
|
-
Blacklight::Configuration.default_values[:view].maps.facet_mode =
|
19
|
-
Blacklight::Configuration.default_values[:view].maps.tileurl =
|
15
|
+
Blacklight::Configuration.default_values[:view].maps.placename_field = 'subject_geo_ssim'
|
16
|
+
Blacklight::Configuration.default_values[:view].maps.coordinates_facet_field = 'coordinates_ssim'
|
17
|
+
Blacklight::Configuration.default_values[:view].maps.facet_mode = 'geojson' # or 'coordinates'
|
18
|
+
Blacklight::Configuration.default_values[:view].maps.tileurl = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'
|
20
19
|
Blacklight::Configuration.default_values[:view].maps.mapattribution = 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>'
|
21
20
|
Blacklight::Configuration.default_values[:view].maps.maxzoom = 18
|
22
21
|
Blacklight::Configuration.default_values[:view].maps.show_initial_zoom = 5
|
23
22
|
end
|
24
23
|
|
25
24
|
# Add our helpers
|
26
|
-
initializer 'blacklight-maps.helpers' do |
|
27
|
-
|
25
|
+
initializer 'blacklight-maps.helpers' do |_app|
|
26
|
+
config.after_initialize do
|
27
|
+
ActionView::Base.include BlacklightMapsHelper
|
28
|
+
end
|
28
29
|
end
|
29
30
|
|
30
31
|
# This makes our rake tasks visible.
|