-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: This method has been removed in JSZip 3.0, please check the upgrade guide. #48
Comments
Do you have solved it? |
no, unfortunately not. I still don't have the shape write implement. Until now I can live with geojson... |
I have this issue as well. |
I fixed it by hand. // ##### replace this:
var generateOptions = { compression:'STORE' };
if (!process.browser) {
generateOptions.type = 'nodebuffer';
}
return zip.generate(generateOptions);
// ##### with this:
var generateOptions = { compression:'STORE', type:'base64' };
if (!process.browser) {
generateOptions.type = 'nodebuffer';
}
return zip.generateAsync(generateOptions);
// ##### and this:
module.exports = function(gj, options) {
var content = zip(gj, options);
location.href = 'data:application/zip;base64,' + content;
};
// ##### with this:
module.exports = function(gj, options) {
zip(gj, options).then(function(content) {
location.href = 'data:application/zip;base64,' + content;
});
}; Look at: https://stuk.github.io/jszip/documentation/upgrade_guide.html Edit: shpwrite.zip(data, options).then(function(content) {
saveAs(content, 'export.zip');
}); |
Does it make sense to introduce this change via a PR? |
Há a possibilidade posterior de desenvolvimento do traçado em shapefiles. Deixei os scripts de importacao da biblioteca shp-write do mapbox comentados no footer. Encontrei alguns problemas que aparentemente nao foram solucionados pelos mantenedores do código. mapbox/shp-write#48 Implementei o download somente em geoJson. Testes abrindo os desenhos no QGIS funcionam beleza!
JSZip ahs been upgraded in the latest tagged version (v0.4.0). Will be released on npm soon. |
Hi,
I'm using the latest version 0.3.2 and when executing shpwrite.download() I get following Error:
Error: This method has been removed in JSZip 3.0, please check the upgrade guide.
Do I do something wrong or is it a bug? Is there a work-around?
Here is my code;:
var shp_options = {
folder: 'shapefiles',
types: {
point: 'points',
polygon: 'polygons',
polyline: 'polyline'
}};
var geojson_format = new OpenLayers.Format.GeoJSON();
var features_geojson = JSON.parse(geojson_format.write(drawLayer.features,false));
shpwrite.download(features_geojson,shp_options);
Cheers,
Steffen
The text was updated successfully, but these errors were encountered: