forked from MapComplete/MapComplete
removed geojson
This commit is contained in:
parent
4d0f0e55f2
commit
d5b614fc44
88 changed files with 1835 additions and 4874 deletions
26
Utils.ts
26
Utils.ts
|
@ -1,5 +1,4 @@
|
|||
import * as colors from "./assets/colors.json"
|
||||
import {TileRange} from "./Models/TileRange";
|
||||
|
||||
export class Utils {
|
||||
|
||||
|
@ -135,7 +134,7 @@ export class Utils {
|
|||
}
|
||||
return newArr;
|
||||
}
|
||||
|
||||
|
||||
public static MergeTags(a: any, b: any) {
|
||||
const t = {};
|
||||
for (const k in a) {
|
||||
|
@ -359,12 +358,9 @@ export class Utils {
|
|||
* @param contents
|
||||
* @param fileName
|
||||
*/
|
||||
public static offerContentsAsDownloadableFile(contents: string | Blob, fileName: string = "download.txt") {
|
||||
public static offerContentsAsDownloadableFile(contents: string, fileName: string = "download.txt") {
|
||||
const element = document.createElement("a");
|
||||
let file;
|
||||
if(typeof(contents) === "string"){
|
||||
file = new Blob([contents], {type: 'text/plain'});
|
||||
}else {file = contents;}
|
||||
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
|
||||
|
@ -451,12 +447,14 @@ export class Utils {
|
|||
b: parseInt(hex.substr(5, 2), 16),
|
||||
}
|
||||
}
|
||||
|
||||
public static setDefaults(options, defaults){
|
||||
for (let key in defaults){
|
||||
if (!(key in options)) options[key] = defaults[key];
|
||||
}
|
||||
return options;
|
||||
}
|
||||
}
|
||||
|
||||
export interface TileRange {
|
||||
xstart: number,
|
||||
ystart: number,
|
||||
xend: number,
|
||||
yend: number,
|
||||
total: number,
|
||||
zoomlevel: number
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue