Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
JSZipUtils.getBinaryContent(url, function(err, data) {
let URL = window.URL || window.webkitURL || window.mozURL || window.msURL
let shpString, dbfString, prjString;
let zip = new JSZip.default();
zip.loadAsync(data)
.then(function(zipFiles) {
shpString = zipFiles.file(/.shp$/i)[0].name;
dbfString = zipFiles.file(/.dbf$/i)[0].name;
zipFiles.file(shpString).async('arraybuffer').then(function (content) {
SHPParser.load(URL.createObjectURL(new Blob([content])), shpLoader, returnData);
});
zipFiles.file(dbfString).async('arraybuffer').then(function (content) {
DBFParser.load(URL.createObjectURL(new Blob([content])), encoding, dbfLoader, returnData);
});
})
});
}