File tree 5 files changed +120
-4
lines changed
componentsguide/mapcontrols/controlbar 5 files changed +120
-4
lines changed Original file line number Diff line number Diff line change @@ -333,6 +333,10 @@ export default defineConfig({
333
333
text : "Map Controls" ,
334
334
collapsed : true ,
335
335
items : [
336
+ {
337
+ text : "ol-control-bar" ,
338
+ link : "/componentsguide/mapcontrols/controlbar/" ,
339
+ } ,
336
340
{
337
341
text : "ol-attribution-control" ,
338
342
link : "/componentsguide/mapcontrols/attribution/" ,
Original file line number Diff line number Diff line change
1
+ # ol-control-bar
2
+
3
+ > A group of controls
4
+
5
+ <script setup >
6
+ import ControlBarDemo from " @demos/ControlBarDemo.vue"
7
+ </script >
8
+ <ClientOnly >
9
+ <ControlBarDemo />
10
+ </ClientOnly >
11
+
12
+ ## Usage
13
+
14
+ ::: code-group
15
+
16
+ <<< ../../../../src/demos/ControlBarDemo.vue
17
+
18
+ :::
19
+
20
+ ## Properties
Original file line number Diff line number Diff line change 307
307
<lastmod >2021-08-15T21:05:05+00:00</lastmod >
308
308
<priority >0.80</priority >
309
309
</url >
310
+ <url >
311
+ <loc >https://vue3openlayers.netlify.app/componentsguide/mapcontrols/controlbar/</loc >
312
+ <lastmod >2023-09-19T23:00:00+00:00</lastmod >
313
+ <priority >0.80</priority >
314
+ </url >
310
315
<url >
311
316
<loc >https://vue3openlayers.netlify.app/componentsguide/mapcontrols/contextmenu/</loc >
312
317
<lastmod >2021-08-15T21:05:05+00:00</lastmod >
Original file line number Diff line number Diff line change 42
42
43
43
<ol-control-bar >
44
44
<ol-toggle-control
45
- html =" <i class='fas fa-map-marker'></i> "
45
+ html =" 🔘 "
46
46
className =" edit"
47
47
title =" Point"
48
48
:onToggle =" (active) => changeDrawType(active, 'Point')"
49
49
/>
50
50
<ol-toggle-control
51
- html =" <i class='fas fa-draw-polygon'></i> "
51
+ html =" 🔹 "
52
52
className =" edit"
53
53
title =" Polygon"
54
54
:onToggle =" (active) => changeDrawType(active, 'Polygon')"
55
55
/>
56
56
<ol-toggle-control
57
- html =" <i class='fas fa-circle'></i> "
57
+ html =" 🟢 "
58
58
className =" edit"
59
59
title =" Circle"
60
60
:onToggle =" (active) => changeDrawType(active, 'Circle')"
61
61
/>
62
62
<ol-toggle-control
63
- html =" <i class='fas fa-grip-lines'></i> "
63
+ html =" 〰️ "
64
64
className =" edit"
65
65
title =" LineString"
66
66
:onToggle =" (active) => changeDrawType(active, 'LineString')"
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <ol-map
3
+ ref =" map"
4
+ :loadTilesWhileAnimating =" true"
5
+ :loadTilesWhileInteracting =" true"
6
+ style =" height : 800px "
7
+ >
8
+ <ol-view
9
+ ref =" view"
10
+ :center =" center"
11
+ :rotation =" rotation"
12
+ :zoom =" zoom"
13
+ :projection =" projection"
14
+ />
15
+ <ol-tile-layer ref =" osmLayer" title =" OSM" >
16
+ <ol-source-osm />
17
+ </ol-tile-layer >
18
+
19
+ <ol-control-bar >
20
+ <ol-toggle-control
21
+ html =" 🔘"
22
+ className =" edit"
23
+ title =" Point"
24
+ :onToggle =" (active) => changeDrawType(active, 'Point')"
25
+ />
26
+ <ol-toggle-control
27
+ html =" 🔹"
28
+ className =" edit"
29
+ title =" Polygon"
30
+ :onToggle =" (active) => changeDrawType(active, 'Polygon')"
31
+ />
32
+ <ol-toggle-control
33
+ html =" 🟢"
34
+ className =" edit"
35
+ title =" Circle"
36
+ :onToggle =" (active) => changeDrawType(active, 'Circle')"
37
+ />
38
+ <ol-toggle-control
39
+ html =" 〰️"
40
+ className =" edit"
41
+ title =" LineString"
42
+ :onToggle =" (active) => changeDrawType(active, 'LineString')"
43
+ />
44
+ <ol-videorecorder-control @stop =" videoStopped" />
45
+ <ol-printdialog-control />
46
+ </ol-control-bar >
47
+
48
+ <ol-interaction-draw
49
+ :type =" drawType"
50
+ @drawend =" drawend"
51
+ @drawstart =" drawstart"
52
+ >
53
+ </ol-interaction-draw >
54
+ </ol-map >
55
+ </template >
56
+
57
+ <script setup>
58
+ import { ref } from " vue" ;
59
+
60
+ const center = ref ([34 , 39.13 ]);
61
+ const projection = ref (" EPSG:4326" );
62
+ const zoom = ref (6 );
63
+ const rotation = ref (0 );
64
+ const view = ref (null );
65
+
66
+ const drawEnable = ref (false );
67
+ const drawType = ref (" Point" );
68
+
69
+ const changeDrawType = (active , draw ) => {
70
+ drawEnable .value = active;
71
+ drawType .value = draw;
72
+ };
73
+
74
+ const drawstart = (event ) => {
75
+ console .log (event );
76
+ };
77
+
78
+ const drawend = (event ) => {
79
+ console .log (event );
80
+ };
81
+
82
+ const videoStopped = (event ) => {
83
+ console .log (event );
84
+ };
85
+
86
+ const osmLayer = ref (null );
87
+ </script >
You can’t perform that action at this time.
0 commit comments