Class: Geoblacklight::ItemMapViewerComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/geoblacklight/item_map_viewer_component.rb

Instance Method Summary collapse

Constructor Details

#initialize(document:) ⇒ ItemMapViewerComponent

Returns a new instance of ItemMapViewerComponent.



5
6
7
8
# File 'app/components/geoblacklight/item_map_viewer_component.rb', line 5

def initialize(document:)
  super()
  @document = document
end

Instance Method Details

#display_tagObject

If the conditions for this being IIIF content are met, dislay the IIIF viewer If it is oembed content, display the oembed viewer Otherwise display the base viewer which will take into account if it is open layers or generic content.



14
15
16
17
18
19
20
# File 'app/components/geoblacklight/item_map_viewer_component.rb', line 14

def display_tag
  return iiif_manifest_tag if iiif_manifest?
  return iiif_image_tag if iiif_image?
  return oembed_tag if protocol == "Oembed"

  base_tag
end

#render?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'app/components/geoblacklight/item_map_viewer_component.rb', line 22

def render?
  @document
end