blacklight_allmaps 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,39 +0,0 @@
1
- // map_controller.js
2
- import { Controller } from "@hotwired/stimulus"
3
- import L from 'leaflet'
4
- import { WarpedMapLayer } from '@allmaps/leaflet'
5
-
6
- export default class extends Controller {
7
- static targets = [ "placeholder" ]
8
-
9
- connect(){
10
-
11
- console.log("Map Controller Connected");
12
- console.log(this.element);
13
-
14
- // Grok: Allmaps annotation for center and zoom level?
15
- this.map = L.map('allmaps-map', {
16
- center: [43.063518, -89.3906863],
17
- zoom: 10,
18
- zoomAnimationThreshold: 1
19
- })
20
-
21
- L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
22
- maxZoom: 18,
23
- attribution: '&copy; <a href=https://www.openstreetmap.org/copyright>OpenStreetMap</a> contributors'
24
- }).addTo(this.map)
25
-
26
- const annotationUrl = 'https://annotations.allmaps.org/manifests/c2f9fc8490151424'
27
- const warpedMapLayer = new WarpedMapLayer(annotationUrl)
28
- .addTo(this.map)
29
-
30
- const bounds = warpedMapLayer.getBounds();
31
- this.map.fitBounds(bounds, {
32
- padding
33
- });
34
- }
35
-
36
- disconnect(){
37
- this.map.remove()
38
- }
39
- }
@@ -1,58 +0,0 @@
1
- <% if Blacklight::VERSION.to_i > 8 %>
2
- <%= render blacklight_config.track_search_session.item_pagination_component.new(search_context: @search_context, search_session: search_session, current_document: @document) if blacklight_config.track_search_session.item_pagination_component %>
3
- <% @page_title = t('blacklight.search.show.title', document_title: document_presenter(@document).html_title, application_name: application_name).html_safe %>
4
- <% content_for(:head) { render_link_rel_alternates } %>
5
-
6
- <% document_component = blacklight_config.view_config(:show).document_component -%>
7
- <%= render (document_component).new(document_component.collection_parameter => document_presenter(@document), component: :div, show: true, partials: blacklight_config.view_config(:show).partials) do |component| %>
8
- <% component.with_title(as: 'h1', classes: '', link_to_document: false, actions: false) %>
9
- <% component.with_footer do %>
10
-
11
- <% unless defined?(Geoblacklight) %>
12
- <% if @document.sidecar_allmaps.georeferenced? %>
13
- <%= render partial: 'allmaps/show/blacklight', locals: { document: @document } %>
14
- <% end %>
15
- <% end %>
16
-
17
- <% if @document.respond_to?(:export_as_openurl_ctx_kev) %>
18
- <!-- COinS, for Zotero among others. -->
19
- <span class="Z3988" title="<%= @document.export_as_openurl_ctx_kev(document_presenter(@document).display_type) %>"></span>
20
- <% end %>
21
- <% end %>
22
- <% end %>
23
-
24
- <% else %>
25
- <%= render(Blacklight::SearchContextComponent.new(search_context: @search_context, search_session: search_session)) if search_session['document_id'] == @document.id %>
26
-
27
- <% @page_title = t('blacklight.search.show.title', document_title: Deprecation.silence(Blacklight::BlacklightHelperBehavior) { document_show_html_title }, application_name: application_name).html_safe %>
28
- <% content_for(:head) { render_link_rel_alternates } %>
29
-
30
- <%= render (blacklight_config.view_config(:show).document_component || Blacklight::DocumentComponent).new(presenter: document_presenter(@document), component: :div, title_component: :h1, show: true) do |component| %>
31
- <% component.with_footer do %>
32
-
33
- <% unless defined?(Geoblacklight) %>
34
- <% if @document.sidecar_allmaps.georeferenced? %>
35
- <%= render partial: 'allmaps/show/blacklight', locals: { document: @document } %>
36
- <% end %>
37
- <% end %>
38
-
39
- <% if @document.respond_to?(:export_as_openurl_ctx_kev) %>
40
- <!--
41
- // COinS, for Zotero among others.
42
- // This document_partial_name(@document) business is not quite right,
43
- // but has been there for a while.
44
- -->
45
- <span class="Z3988" title="<%= @document.export_as_openurl_ctx_kev(Deprecation.silence(Blacklight::RenderPartialsHelperBehavior) { document_partial_name(@document) }) %>"></span>
46
- <% end %>
47
- <% end %>
48
-
49
- <%# Use :body for complete backwards compatibility (overriding the component body markup),
50
- but if the app explicitly opted-in to components, make the partials data available as :partials to ease migrations pain %>
51
- <% component.public_send(blacklight_config.view_config(:show).document_component.blank? && blacklight_config.view_config(:show).partials.any? ? :with_body : :with_partial) do %>
52
- <div id="doc_<%= @document.id.to_s.parameterize %>">
53
- <%= render_document_partials @document, blacklight_config.view_config(:show).partials, component: component %>
54
- </div>
55
- <% end %>
56
- <% end %>
57
- <% end %>
58
-