Module: GeoblacklightAdmin::ImageService::Wms

Defined in:
app/services/geoblacklight_admin/image_service/wms.rb

Class Method Summary collapse

Class Method Details

.image_url(document, size) ⇒ String

Formats and returns a thumbnail url from a Web Map Service endpoint. This utilizes the GeoServer specific ‘reflect’ service to generate parameters like bbox that are difficult to tweak without more detailed information about the layer.

Parameters:

  • (SolrDocument)
  • thumbnail (Integer)

    size

Returns:

  • (String)

    wms thumbnail url



14
15
16
17
18
19
20
21
22
# File 'app/services/geoblacklight_admin/image_service/wms.rb', line 14

def self.image_url(document, size)
  endpoint = document.viewer_endpoint
  "#{endpoint}/reflect?" \
    "&FORMAT=image%2Fpng" \
    "&TRANSPARENT=TRUE" \
    "&LAYERS=#{document["gbl_wxsIdentifier_s"]}" \
    "&WIDTH=#{size}" \
    "&HEIGHT=#{size}"
end