mapserver/public/js/main.js

22 lines
519 B
JavaScript
Raw Normal View History

2019-06-11 16:01:16 +03:00
import { getConfig } from './api.js';
2019-08-26 11:17:08 +03:00
import routes from './routes.js';
import wsChannel from './WebSocketChannel.js';
import config from './config.js';
2019-08-30 11:59:55 +03:00
import { hashCompat } from './compat.js';
2019-09-18 12:53:58 +03:00
import layerManager from './LayerManager.js';
2019-06-11 16:01:16 +03:00
2019-08-30 11:59:55 +03:00
// hash route compat
hashCompat();
2019-08-26 11:17:08 +03:00
2019-12-01 20:26:35 +03:00
getConfig()
.then(cfg => {
2019-09-01 12:56:45 +03:00
layerManager.setup(cfg.layers);
2019-08-26 11:17:08 +03:00
config.set(cfg);
wsChannel.connect();
2019-08-30 11:59:55 +03:00
m.route(document.getElementById("app"), "/map/0/12/0/0", routes);
2019-12-01 20:26:35 +03:00
})
.catch(e => {
2019-12-01 22:00:51 +03:00
document.getElementById("app").innerHTML = e;
2019-08-26 11:17:08 +03:00
});