forked from geops/openlayers-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
87 lines (75 loc) · 2.1 KB
/
index.html
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<html>
<head>
<title>OpenLayers Editor</title>
<link rel="stylesheet" type="text/css" href="style/style.css">
</head>
<body>
<script src="node_modules/openlayers/dist/ol-debug.js"></script>
<script src="dist/ole.js"></script>
<div id="app">
<div id="header">
<nav>
<div id="brand">OpenLayers Editor</div>
<a href="#" class="active" >Demo</a>
<a href="api.html" >API</a>
<a target="_blank" href="https://github.com/geops/ole2">Code</a>
</nav>
</div>
<div id="map">
</div>
</div>
<div id="promo">
<a href="http://geops.de/karriere" target="_blank">
<div id="promo-text">Join the team!</div>
</a>
</div>
<script type="text/javascript">
var editLayer = new ol.layer.Vector({
source: new ol.source.Vector({})
});
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
}),
editLayer
],
target: 'map',
view: new ol.View({
center: [873708.375917, 6105425.847789],
zoom: 15
})
});
var editor = new ole.Editor(map);
var cad = new ole.CadControl({
source: editLayer.getSource()
});
var draw = new ole.DrawControl({
source: editLayer.getSource()
});
var drawLine = new ole.DrawControl({
type: 'LineString',
source: editLayer.getSource()
});
var rotate = new ole.RotateControl({
source: editLayer.getSource()
});
var drawPoly = new ole.DrawControl({
type: 'Polygon',
source: editLayer.getSource()
});
var move = new ole.MoveControl({
type: 'Polygon',
source: editLayer.getSource()
});
var modify = new ole.ModifyControl({
source: editLayer.getSource()
});
var deleteC = new ole.DeleteControl({
source: editLayer.getSource()
});
editor.addControls([cad, draw, drawLine, drawPoly, modify, move,
rotate, deleteC]);
</script>
</body>
</html>