2018-06-30 16:20:54 +02:00
|
|
|
import '../node_modules/leaflet/dist/leaflet.js';
|
|
|
|
import '../node_modules/leaflet-ajax/dist/leaflet.ajax.min.js';
|
|
|
|
import '../node_modules/leaflet-webgl-heatmap/src/webgl-heatmap/webgl-heatmap.js';
|
|
|
|
import '../node_modules/leaflet-webgl-heatmap/src/leaflet-webgl-heatmap.js';
|
|
|
|
|
|
|
|
import * as gui from './gui';
|
|
|
|
import config from './config';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Self binding with router
|
|
|
|
*/
|
|
|
|
import {ListView} from './view/list';
|
|
|
|
import {MapView} from './view/map';
|
|
|
|
import {StatisticsView} from './view/statistics';
|
2018-08-24 23:34:02 +02:00
|
|
|
import {SettingsView} from './view/settings';
|
2018-06-30 16:20:54 +02:00
|
|
|
|
|
|
|
import {NodeView} from './view/node';
|
|
|
|
|
|
|
|
document.title = config.title;
|
|
|
|
window.onload = () => {
|
|
|
|
const listView = new ListView();
|
|
|
|
const mapView = new MapView();
|
|
|
|
const statisticsView = new StatisticsView();
|
2018-08-24 23:34:02 +02:00
|
|
|
const settingsView = new SettingsView();
|
2018-06-30 16:20:54 +02:00
|
|
|
|
|
|
|
const nodeView = new NodeView();
|
|
|
|
|
|
|
|
gui.router.on({
|
|
|
|
'/list': () => gui.setView(listView),
|
|
|
|
'/map': () => gui.setView(mapView),
|
|
|
|
'/statistics': () => gui.setView(statisticsView),
|
2018-08-24 23:34:02 +02:00
|
|
|
'/settings': () => gui.setView(settingsView),
|
2018-06-30 16:20:54 +02:00
|
|
|
'/n/:nodeID': {
|
|
|
|
'as': 'node',
|
|
|
|
// eslint-disable-next-line func-name-matching
|
|
|
|
'uses': (params) => {
|
|
|
|
nodeView.setNodeID(params.nodeID.toLowerCase());
|
|
|
|
gui.setView(nodeView);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}).on(() => {
|
|
|
|
gui.router.navigate('/list');
|
|
|
|
});
|
|
|
|
|
|
|
|
gui.render();
|
|
|
|
|
|
|
|
}
|