-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
35 lines (33 loc) · 954 Bytes
/
main.js
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
import Map from '/node_modules/ol/Map.js';
import {defaults as defaultControls} from '/node_modules/ol/control.js';
import Stamen from '/node_modules/ol/source/Stamen.js';
import TileLayer from '/node_modules/ol/layer/Tile.js';
import View from '/node_modules/ol/View.js';
import TileWMS from '/node_modules/ol/source/TileWMS.js';
const map = new Map({
target: 'map',
controls:defaultControls({ attribution: false }),
layers: [
new TileLayer({
source: new Stamen({layer: 'terrain',}),
}),
new TileLayer({
source: new TileWMS({
url: 'http://127.0.0.1:8080/geoserver/wms',
params: {'LAYERS': 'beacon:dams'},
ratio: 1,
serverType: 'geoserver',
})
})
],
view: new View({
center: [0, 0],
zoom: 3,
}),
});
function w3_open() {
document.getElementById("sidebar").style.display = "block";
}
function w3_close() {
document.getElementById("sidebar").style.display = "none";
}