Class: GeoblacklightAdmin::ItemViewer
- Inherits:
-
Object
- Object
- GeoblacklightAdmin::ItemViewer
- Defined in:
- app/services/geoblacklight_admin/item_viewer.rb
Instance Method Summary collapse
-
#initialize(references) ⇒ ItemViewer
constructor
A new instance of ItemViewer.
- #reference_uri_2_key(value) ⇒ Object
- #viewer_endpoint ⇒ Object
- #viewer_preference ⇒ Object
- #viewer_protocol ⇒ Object
- #viewer_protocol_2_endpoint ⇒ Object
Constructor Details
#initialize(references) ⇒ ItemViewer
Returns a new instance of ItemViewer.
5 6 7 8 |
# File 'app/services/geoblacklight_admin/item_viewer.rb', line 5 def initialize(references) @references = references @keys = references.keys.collect { |k| reference_uri_2_key(k) } end |
Instance Method Details
#reference_uri_2_key(value) ⇒ Object
18 19 20 |
# File 'app/services/geoblacklight_admin/item_viewer.rb', line 18 def reference_uri_2_key(value) Geoblacklight::Constants::URI.key(value) end |
#viewer_endpoint ⇒ Object
14 15 16 |
# File 'app/services/geoblacklight_admin/item_viewer.rb', line 14 def viewer_endpoint @references[viewer_protocol_2_endpoint] end |
#viewer_preference ⇒ Object
26 27 28 29 |
# File 'app/services/geoblacklight_admin/item_viewer.rb', line 26 def viewer_preference [:cog, :pmtiles, :oembed, :index_map, :tilejson, :xyz, :wmts, :tms, :wms, :iiif_manifest, :iiif, :tiled_map_layer, :dynamic_map_layer, :image_map_layer, :feature_layer] end |
#viewer_protocol ⇒ Object
10 11 12 |
# File 'app/services/geoblacklight_admin/item_viewer.rb', line 10 def viewer_protocol viewer_preference.find { |vp| @keys.include?(vp) } || :map end |
#viewer_protocol_2_endpoint ⇒ Object
22 23 24 |
# File 'app/services/geoblacklight_admin/item_viewer.rb', line 22 def viewer_protocol_2_endpoint Geoblacklight::Constants::URI[viewer_protocol] end |