-
Notifications
You must be signed in to change notification settings - Fork 78
Expand file tree
/
Copy pathindex.html
More file actions
53 lines (41 loc) · 1.32 KB
/
index.html
File metadata and controls
53 lines (41 loc) · 1.32 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
41
42
43
44
45
46
47
48
49
50
51
52
53
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Points</title>
<script src="https://openlayers.org/en/v3.20.1/build/ol.js" type="text/javascript"></script>
<link rel="stylesheet" href="https://openlayers.org/en/v3.20.1/css/ol.css" type="text/css">
</head>
<body>
<div style="width: 100%; height: 96vh" id="map"></div>
<script>
const source = new ol.source.Vector({
url: "points.geojson",
format: new ol.format.GeoJSON()
})
const vectorLayer = new ol.layer.Vector({
source: source,
style: new ol.style.Style({
image: new ol.style.Circle({
radius: 10,
fill: new ol.style.Fill({ color: 'rgba(255, 0, 0, 0.4)' }),
stroke: new ol.style.Stroke({ color: 'red', width: 1 }),
}),
})
})
const map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
}),
vectorLayer
],
target: 'map',
view: new ol.View({
center: [-524797, 4776518],
zoom: 6
})
});
</script>
</body>
</html>