Skip to content

Commit

Permalink
download as shapefile (kind of), #170
Browse files Browse the repository at this point in the history
  • Loading branch information
mapsam committed Sep 12, 2015
1 parent 99c50f5 commit a3eecde
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/js/ops.file.dropchop.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,24 @@ var dropchop = (function(dc) {
minFeatures: 1,
description: 'Save as Shapefile',
icon: '<i class="fa fa-file"></i>',
execute: function() {
$(dc.selection.list).each(function(i) {
try {
var options = {
folder: 'dropchop_' + dc.selection.list[i].name,
types: {
point: 'dropchop_' + dc.selection.list[i].name + '_point',
polygon: 'dropchop_' + dc.selection.list[i].name + '_poly',
line: 'dropchop_' + dc.selection.list[i].name + '_line'
}
};
shpwrite.download(dc.selection.list[i].raw, options);
} catch (err) {
dc.notify('Error', 'There was a problem downloading the shapefile.' + err);
throw err;
}
});
},
createsLayer: false
},

Expand Down

0 comments on commit a3eecde

Please sign in to comment.