Skip to content
This repository has been archived by the owner on Apr 5, 2018. It is now read-only.

Commit

Permalink
issue #25 - Download features in additional formats like ESRI Shapefi…
Browse files Browse the repository at this point in the history
…le; fix form defaults
  • Loading branch information
justb4 committed Nov 14, 2013
1 parent dfb513b commit 044cc3e
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions lib/Editor/Control/DownloadFeature.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ OpenLayers.Editor.Control.DownloadFeature = OpenLayers.Class(OpenLayers.Control,

// Populate the upload Form further using Format option values
var formElm = document.getElementById('download_form');

var filenameBase = this.params['filename'];
this.params['filename'] = filenameBase + option.fileExt;
this.params['mime'] = option.mimeType;
Expand All @@ -234,21 +235,16 @@ OpenLayers.Editor.Control.DownloadFeature = OpenLayers.Class(OpenLayers.Control,
// Example: {name: 'ESRI Shapefile (zipped, WGS84)', fileExt: '.zip', mimeType: 'application/zip',
// formatter: 'OpenLayers.Format.GeoJSON', targetFormat: 'ESRI Shapefile',
// fileProjection: new OpenLayers.Projection('EPSG:4326')}
if (option.targetFormat) {
this.params['target_format'] = option.targetFormat;
}
if (option.assignSrs) {
this.params['assign_srs'] = option.assignSrs;
}
if (option.sourceSrs) {
this.params['source_srs'] = option.sourceSrs;
}
if (option.targetSrs) {
this.params['target_srs'] = option.targetSrs;
}
this.params['target_format'] = option.targetFormat;
this.params['assign_srs'] = option.assignSrs;
this.params['source_srs'] = option.sourceSrs;
this.params['target_srs'] = option.targetSrs;

// Additional user-defined hidden elements from params
for (var param in this.params) {
if (!this.params[param]) {
continue;
}
formElm = this.createInputElm(param, 'hidden', this.params[param], formElm);
}

Expand Down

0 comments on commit 044cc3e

Please sign in to comment.