Class: Geoblacklight::KmzDownload

Inherits:
Download
  • Object
show all
Defined in:
lib/geoblacklight/download/kmz_download.rb

Constant Summary collapse

KMZ_DOWNLOAD_PARAMS =
{service: "wms",
version: "1.1.0",
request: "GetMap",
srsName: "EPSG:3857",
format: "application/vnd.google-earth.kmz",
width: 2000, height: 2000}.freeze

Instance Method Summary collapse

Methods inherited from Download

#create_download_file, #download_exists?, #downloadable?, #file_name, file_path, #file_path_and_name, #get, #initiate_download, #url_with_params

Constructor Details

#initialize(document, options = {}) ⇒ KmzDownload

Returns a new instance of KmzDownload.



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/geoblacklight/download/kmz_download.rb', line 12

def initialize(document, options = {})
  bbox_wsen = document.geometry.bounding_box
  request_params = KMZ_DOWNLOAD_PARAMS.merge(layers: document[Settings.FIELDS.WXS_IDENTIFIER], bbox: bbox_wsen)
  super(document, {
    type: "kmz",
    extension: "kmz",
    request_params: request_params,
    content_type: "application/vnd.google-earth.kmz",
    service_type: "wms"
  }.merge(options))
end