Add missing function after cherry-picking

This commit is contained in:
Yohan Boniface 2023-10-13 12:00:59 +02:00
parent a94cac53ac
commit 3c234ead5b

View file

@ -832,6 +832,25 @@ L.U.Map.include({
document.body.removeChild(el) document.body.removeChild(el)
}, },
processFileToImport: function (file, layer, type) {
type = type || L.Util.detectFileType(file)
if (!type) {
this.ui.alert({
content: L._('Unable to detect format of file {filename}', {
filename: file.name,
}),
level: 'error',
})
return
}
if (type === 'umap') {
this.importFromFile(file, 'umap')
} else {
if (!layer) layer = this.createDataLayer({ name: file.name })
layer.importFromFile(file, type)
}
},
importRaw: function (rawData) { importRaw: function (rawData) {
const importedData = JSON.parse(rawData) const importedData = JSON.parse(rawData)