Class: KmzDownload

Inherits:
Download 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:900913', format: 'application/vnd.google-earth.kmz', width: 2000, height: 2000 }

Instance Method Summary collapse

Methods inherited from Download

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

Constructor Details

#initialize(document) ⇒ KmzDownload

Returns a new instance of KmzDownload.


4
5
6
7
8
9
10
11
12
13
# File 'lib/geoblacklight/download/kmz_download.rb', line 4

def initialize(document)
  request_params = KMZ_DOWNLOAD_PARAMS.merge(layers: document[:layer_id_s], bbox: document.bounding_box_as_wsen.split(' ').join(', '))
  super(document, {
    type: 'kmz',
    extension: 'kmz',
    request_params: request_params,
    content_type: 'application/vnd.google-earth.kmz',
    service_type: 'wms'
  })
end