Skip to content

Commit 5622d23

Browse files
committed
fix(demo): use correct component names for controls
1 parent 56a1601 commit 5622d23

File tree

4 files changed

+81
-25
lines changed

4 files changed

+81
-25
lines changed

docs/componentsguide/mapcontrols/contextmenu/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ol-context-menu
1+
# ol-context-menu-control
22

33
> A contextmenu extension for OpenLayers.
44

docs/componentsguide/mapcontrols/index.md

Lines changed: 68 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ aside: false
44

55
# Map Controls
66

7-
A control is a visible widget with a DOM element in a fixed position on the screen. They can involve user input (buttons), or be informational only; the position is determined using CSS. By default these are placed in the container with CSS class name ol-overlaycontainer-stopevent, but can use any outside DOM element.
7+
A control is a visible widget with a DOM element in a fixed position on the screen.
8+
They can involve user input (buttons), or be informational only;
9+
the position is determined using CSS.
10+
By default these are placed in the container with CSS class name ol-overlaycontainer-stopevent, but can use any outside DOM element.
811

912
<script setup>
1013
import MapControlDemo from "@demos/MapControlDemo.vue"
@@ -15,17 +18,7 @@ import MapControlDemo from "@demos/MapControlDemo.vue"
1518

1619
## Control List
1720

18-
- `ol-attribution-control`
19-
- `ol-context-menu`
20-
- `ol-fullscreen-control`
21-
- `ol-mouseposition-control`
22-
- `ol-overviewmap-control`
23-
- `ol-rotate-control`
24-
- `ol-scaleline-control`
25-
- `ol-swipe-control`
26-
- `ol-zoom-control`
27-
- `ol-zoomslider-control`
28-
- `ol-zoomtoextent-control`
21+
See menu items on the left.
2922

3023
## Usage
3124

@@ -81,6 +74,43 @@ import MapControlDemo from "@demos/MapControlDemo.vue"
8174
<input type="checkbox" id="swipecontrol" v-model="showSwipeControl" />
8275
<label for="swipecontrol">swipe-control</label>
8376
</li>
77+
<li>
78+
<input
79+
type="checkbox"
80+
id="layerswitchercontrol"
81+
v-model="showLayerSwitcherControl"
82+
/>
83+
<label for="layerswitchercontrol">layerswitcher-control</label>
84+
</li>
85+
<li>
86+
<input
87+
type="checkbox"
88+
id="layerswitcherimagecontrol"
89+
v-model="showLayerSwitcherImageControl"
90+
/>
91+
<label for="layerswitcherimagecontrol">layerswitcherimage-control</label>
92+
</li>
93+
<li>
94+
<input
95+
type="checkbox"
96+
id="printdialogcontrol"
97+
v-model="showPrintDialogControl"
98+
/>
99+
<label for="printdialogcontrol">printdialog-control</label>
100+
</li>
101+
<li>
102+
<input type="checkbox" id="togglecontrol" v-model="showToggleControl" />
103+
<label for="togglecontrol">toggle-control</label>
104+
</li>
105+
106+
<li>
107+
<input
108+
type="checkbox"
109+
id="videorecordercontrol"
110+
v-model="showVideoRecorderControl"
111+
/>
112+
<label for="videorecordercontrol">videorecorder-control</label>
113+
</li>
84114
</ul>
85115
86116
<ol-map
@@ -123,6 +153,23 @@ import MapControlDemo from "@demos/MapControlDemo.vue"
123153
:layerList="layerList"
124154
/>
125155
156+
<ol-layerswitcher-control
157+
v-if="showLayerSwitcherControl && layerList.length > 0"
158+
/>
159+
160+
<ol-layerswitcherimage-control
161+
v-if="showLayerSwitcherImageControl && layerList.length > 0"
162+
/>
163+
164+
<ol-printdialog-control v-if="showPrintDialogControl" />
165+
166+
<ol-toggle-control v-if="showToggleControl" />
167+
168+
<ol-videorecorder-control
169+
v-if="showVideoRecorderControl"
170+
@stop="videoStopped"
171+
/>
172+
126173
<ol-tile-layer ref="jawgLayer" title="JAWG">
127174
<ol-source-xyz
128175
crossOrigin="anonymous"
@@ -157,6 +204,15 @@ const overviewmapcontrol = ref(true);
157204
const mousepositioncontrol = ref(true);
158205
const rotatecontrol = ref(true);
159206
const showSwipeControl = ref(true);
207+
const showLayerSwitcherControl = ref(true);
208+
const showLayerSwitcherImageControl = ref(true);
209+
const showPrintDialogControl = ref(true);
210+
const showToggleControl = ref(true);
211+
const showVideoRecorderControl = ref(true);
212+
213+
const videoStopped = (event) => {
214+
console.log(event);
215+
};
160216
161217
onMounted(() => {
162218
layerList.value.push(jawgLayer.value.tileLayer);

docs/demo.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,33 +59,33 @@ import AppDemo from "@demos/AppDemo.vue"
5959
</ol-tile-layer>
6060
6161
<ol-control-bar>
62-
<ol-control-toggle
62+
<ol-toggle-control
6363
html="<i class='fas fa-map-marker'></i>"
6464
className="edit"
6565
title="Point"
6666
:onToggle="(active) => changeDrawType(active, 'Point')"
6767
/>
68-
<ol-control-toggle
68+
<ol-toggle-control
6969
html="<i class='fas fa-draw-polygon'></i>"
7070
className="edit"
7171
title="Polygon"
7272
:onToggle="(active) => changeDrawType(active, 'Polygon')"
7373
/>
74-
<ol-control-toggle
74+
<ol-toggle-control
7575
html="<i class='fas fa-circle'></i>"
7676
className="edit"
7777
title="Circle"
7878
:onToggle="(active) => changeDrawType(active, 'Circle')"
7979
/>
80-
<ol-control-toggle
80+
<ol-toggle-control
8181
html="<i class='fas fa-grip-lines'></i>"
8282
className="edit"
8383
title="LineString"
8484
:onToggle="(active) => changeDrawType(active, 'LineString')"
8585
/>
8686
<ol-videorecorder-control @stop="videoStopped">
8787
</ol-videorecorder-control>
88-
<ol-control-printdialog />
88+
<ol-printdialog-control />
8989
</ol-control-bar>
9090
9191
<ol-mouseposition-control />
@@ -105,7 +105,7 @@ import AppDemo from "@demos/AppDemo.vue"
105105
tipLabel="Fit to Turkey"
106106
/>
107107
108-
<ol-context-menu :items="contextMenuItems" />
108+
<ol-context-menu-control :items="contextMenuItems" />
109109
110110
<ol-interaction-clusterselect @select="featureSelected" :pointRadius="20">
111111
<ol-style>

src/demos/AppDemo.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,33 +41,33 @@
4141
</ol-tile-layer>
4242

4343
<ol-control-bar>
44-
<ol-control-toggle
44+
<ol-toggle-control
4545
html="<i class='fas fa-map-marker'></i>"
4646
className="edit"
4747
title="Point"
4848
:onToggle="(active) => changeDrawType(active, 'Point')"
4949
/>
50-
<ol-control-toggle
50+
<ol-toggle-control
5151
html="<i class='fas fa-draw-polygon'></i>"
5252
className="edit"
5353
title="Polygon"
5454
:onToggle="(active) => changeDrawType(active, 'Polygon')"
5555
/>
56-
<ol-control-toggle
56+
<ol-toggle-control
5757
html="<i class='fas fa-circle'></i>"
5858
className="edit"
5959
title="Circle"
6060
:onToggle="(active) => changeDrawType(active, 'Circle')"
6161
/>
62-
<ol-control-toggle
62+
<ol-toggle-control
6363
html="<i class='fas fa-grip-lines'></i>"
6464
className="edit"
6565
title="LineString"
6666
:onToggle="(active) => changeDrawType(active, 'LineString')"
6767
/>
6868
<ol-videorecorder-control @stop="videoStopped">
6969
</ol-videorecorder-control>
70-
<ol-control-printdialog />
70+
<ol-printdialog-control />
7171
</ol-control-bar>
7272

7373
<ol-mouseposition-control />
@@ -87,7 +87,7 @@
8787
tipLabel="Fit to Turkey"
8888
/>
8989

90-
<ol-context-menu :items="contextMenuItems" />
90+
<ol-context-menu-control :items="contextMenuItems" />
9191

9292
<ol-interaction-clusterselect @select="featureSelected" :pointRadius="20">
9393
<ol-style>

0 commit comments

Comments
 (0)