Class: Geoblacklight::ArcgisComponent

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(document:, action:) ⇒ ArcgisComponent

Returns a new instance of ArcgisComponent.



7
8
9
10
# File 'app/components/geoblacklight/arcgis_component.rb', line 7

def initialize(document:, action:, **)
  @document = document
  super()
end

Instance Attribute Details

#documentObject (readonly)

Returns the value of attribute document.



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

def document
  @document
end

Instance Method Details

Generates an ArcGIS.com viewer url with params that can open content directly See: doc.arcgis.com/en/arcgis-online/reference/use-url-parameters.htm



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

def arcgis_link
  params = URI.encode_www_form(
    urls: document.arcgis_urls
  )
  Settings.ARCGIS_BASE_URL + "?" + params
end

#keyObject



21
22
23
# File 'app/components/geoblacklight/arcgis_component.rb', line 21

def key
  "arcgis"
end