1
0
forked from MTSR/mapserver
mapserver/public/js/main.js
2021-04-12 13:03:10 +02:00

22 lines
519 B
JavaScript

import { getConfig } from './api.js';
import routes from './routes.js';
import wsChannel from './WebSocketChannel.js';
import config from './config.js';
import { hashCompat } from './compat.js';
import layerManager from './LayerManager.js';
// hash route compat
hashCompat();
getConfig()
.then(cfg => {
layerManager.setup(cfg.layers);
config.set(cfg);
wsChannel.connect();
m.route(document.getElementById("app"), "/map/0/12/0/0", routes);
})
.catch(e => {
document.getElementById("app").innerHTML = e;
});