6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'app/services/geoblacklight_sidecar_images/image_service/wms.rb', line 6
def self.image_url(document, size)
endpoint = document.viewer_endpoint.to_s
proxy = Settings.PROXY_GEOSERVER_URL.to_s
institution = Settings.INSTITUTION_GEOSERVER_URL.to_s
if proxy.present? && institution.present?
endpoint = endpoint.gsub(proxy, institution)
end
layer = document[wxs_identifier_field] || document["gbl_wxsIdentifier_s"]
"#{endpoint}/reflect?" \
"&FORMAT=image%2Fpng" \
"&TRANSPARENT=TRUE" \
"&LAYERS=#{layer}" \
"&WIDTH=#{size}" \
"&HEIGHT=#{size}"
end
|