-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
40 lines (34 loc) · 1.04 KB
/
main.js
File metadata and controls
40 lines (34 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import './style.css';
import { Map, View } from 'ol';
import LeftSidebar from './widget/LeftSidebar';
import LayersAndStyle from './MapElement/LayersAndStyle'
import { MAP_SETTINGS } from './Miscellaneous/enum'
import { fromLonLat } from 'ol/proj'
import Attribution from 'ol/control/Attribution.js';
import ApiRequestor from './Services/ApiRequestor';
class MainMap {
constructor() {
//if (serverStatus) {
this.map = new Map({
target: 'map',
controls: [new Attribution({collapsible: true})],
view: new View({
center: fromLonLat(MAP_SETTINGS.CENTER),
zoom: MAP_SETTINGS.ZOOM
})
});
new LayersAndStyle({
map: this.map
});
new LeftSidebar({
target: this.map
});
//}
//else {
//document.getElementById('map').appendChild(document.createTextNode("Le serveur de donnée est indisponible, impossible d'afficher la page"))
//}
}
}
let serverStatus = await ApiRequestor.getFeatureServerStatus()
new MainMap();
export default MainMap;