Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
onDrop(event: DragEvent) {
const {
map
} = this.props;
event.preventDefault();
const files = event.dataTransfer.files;
if (files.length > 0) {
for (let i = 0; i < files.length; ++i) {
const file = files[i];
if (file.name.match(/\.zip$/g)) {
FileUtil.addShpLayerFromFile(file, map);
} else {
FileUtil.addGeojsonLayerFromFile(file, map);
}
}
}
}