forked from MapComplete/MapComplete
Utils.ts
This commit is contained in:
parent
4e6a26abae
commit
7b0293d7e2
4 changed files with 1315 additions and 1639 deletions
9
Utils.ts
9
Utils.ts
|
@ -285,6 +285,15 @@ export class Utils {
|
|||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static downloadTxtFile (contents: string, fileName: string = "download.txt") {
|
||||
const element = document.createElement("a");
|
||||
const file = new Blob([contents], {type: 'text/plain'});
|
||||
element.href = URL.createObjectURL(file);
|
||||
element.download = fileName;
|
||||
document.body.appendChild(element); // Required for this to work in FireFox
|
||||
element.click();
|
||||
}
|
||||
}
|
||||
|
||||
export interface TileRange{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue