Source Code
import { AutkMap } from 'autk-map';
export class StandaloneGeojsonMap {
protected map!: AutkMap;
public async run(canvas: HTMLCanvasElement): Promise {
this.map = new AutkMap(canvas);
await this.map.init();
const geojson = await fetch('http://localhost:5173/data/mnt_neighs_proj.geojson').then(res => res.json());
this.map.loadGeoJsonLayer('neighborhoods', geojson);
this.map.draw();
}
}
async function main() {
const example = new StandaloneGeojsonMap();
const canvas = document.querySelector('canvas');
if (!canvas) {
console.error('Canvas element not found');
return;
}
await example.run(canvas);
}
main();