mapcomplete/Logic/Web/CodeGrid.ts

26 lines
609 B
TypeScript
Raw Normal View History

import codegrid from "codegrid-js";
export default class CodeGrid {
2020-10-12 01:25:27 +02:00
private static readonly grid = CodeGrid.InitGrid();
public static getCode(lat: any, lon: any, handle: (error, code) => void) {
CodeGrid.grid.getCode(lat, lon, handle);
}
2020-10-19 12:08:42 +02:00
private static InitGrid(): any {
const grid = codegrid.CodeGrid("./tiles/");
// Heat up the caches
grid.getCode(50.2, 3.2, (error, code) => {
});
grid.getCode(52.5072, 13.4248, (error, code) => {
});
grid.getCode(40.4781, -3.7034, () => {
});
return grid;
}
2020-10-12 01:25:27 +02:00
}