Skip to content

Commit

Permalink
docs(ol-*-control): move demos to separate pages
Browse files Browse the repository at this point in the history
  • Loading branch information
d-koppenhagen committed Sep 19, 2023
1 parent 8cad716 commit 8b201f5
Show file tree
Hide file tree
Showing 32 changed files with 562 additions and 267 deletions.
4 changes: 4 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,10 @@ export default defineConfig({
text: "ol-toggle-control",
link: "/componentsguide/mapcontrols/toggle/",
},
{
text: "ol-videorecorder-control",
link: "/componentsguide/mapcontrols/videorecorder/",
},
{
text: "ol-zone-control",
link: "/componentsguide/mapcontrols/zone/",
Expand Down
2 changes: 0 additions & 2 deletions docs/componentsguide/mapcontrols/attribution/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import AttributionControlDemo from "@demos/AttributionControlDemo.vue"

## Usage

Add context menu to map

::: code-group

<<< ../../../../src/demos/AttributionControlDemo.vue
Expand Down
15 changes: 13 additions & 2 deletions docs/componentsguide/mapcontrols/fullscreen/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,20 @@

> A Fullscreen control for OpenLayers.
## Demo
<script setup>
import FullscreenControlDemo from "@demos/FullscreenControlDemo.vue"
</script>
<ClientOnly>
<FullscreenControlDemo />
</ClientOnly>

See [Demo page for all Map Controls](../index.md)
## Usage

::: code-group

<<< ../../../../src/demos/FullscreenControlDemo.vue

:::

## Properties

Expand Down
17 changes: 1 addition & 16 deletions docs/componentsguide/mapcontrols/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,8 @@ aside: false
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.

<script setup>
import MapControlDemo from "@demos/MapControlDemo.vue"
</script>
<ClientOnly>
<MapControlDemo />
</ClientOnly>
By default these are placed in the container with CSS class name `ol-overlaycontainer-stopevent`, but can use any outside DOM element.

## Control List

See menu items on the left.

## Usage

::: code-group

<<< ../../../src/demos/MapControlDemo.vue

:::
15 changes: 13 additions & 2 deletions docs/componentsguide/mapcontrols/layerswitcher/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,20 @@

> A control for switching between layers.
## Demo
<script setup>
import LayerswitcherControlDemo from "@demos/LayerswitcherControlDemo.vue"
</script>
<ClientOnly>
<LayerswitcherControlDemo />
</ClientOnly>

See [Demo page for all Map Controls](../index.md)
## Usage

::: code-group

<<< ../../../../src/demos/LayerswitcherControlDemo.vue

:::

## Properties

Expand Down
15 changes: 13 additions & 2 deletions docs/componentsguide/mapcontrols/layerswitcherimage/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,20 @@
To see the correct thumbnail images, you may have to set the property `imagerySet` (e. g. for usage with [BingMaps](../../sources/bing/)).

## Demo
<script setup>
import LayerswitcherimageControlDemo from "@demos/LayerswitcherimageControlDemo.vue"
</script>
<ClientOnly>
<LayerswitcherimageControlDemo />
</ClientOnly>

See [Demo page for all Map Controls](../index.md)
## Usage

::: code-group

<<< ../../../../src/demos/LayerswitcherimageControlDemo.vue

:::

## Properties

Expand Down
15 changes: 13 additions & 2 deletions docs/componentsguide/mapcontrols/mouseposition/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,20 @@

> A Mouse Position control for OpenLayers.
## Demo
<script setup>
import MousepositionControlDemo from "@demos/MousepositionControlDemo.vue"
</script>
<ClientOnly>
<MousepositionControlDemo />
</ClientOnly>

See [Demo page for all Map Controls](../index.md)
## Usage

::: code-group

<<< ../../../../src/demos/MousepositionControlDemo.vue

:::

## Properties

Expand Down
15 changes: 13 additions & 2 deletions docs/componentsguide/mapcontrols/printdialog/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,20 @@

> A print dialog to print the current map canvas content.
## Demo
<script setup>
import PrintdialogControlDemo from "@demos/PrintdialogControlDemo.vue"
</script>
<ClientOnly>
<PrintdialogControlDemo />
</ClientOnly>

See [Demo page for all Map Controls](../index.md)
## Usage

::: code-group

<<< ../../../../src/demos/PrintdialogControlDemo.vue

:::

## Properties

Expand Down
15 changes: 13 additions & 2 deletions docs/componentsguide/mapcontrols/rotate/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,20 @@

> A Rotate control for OpenLayers.
## Demo
<script setup>
import RotateControlDemo from "@demos/RotateControlDemo.vue"
</script>
<ClientOnly>
<RotateControlDemo />
</ClientOnly>

See [Demo page for all Map Controls](../index.md)
## Usage

::: code-group

<<< ../../../../src/demos/RotateControlDemo.vue

:::

## Properties

Expand Down
15 changes: 13 additions & 2 deletions docs/componentsguide/mapcontrols/scaleline/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,20 @@

> A Scale Line control for OpenLayers.
## Demo
<script setup>
import ScalelineControlDemo from "@demos/ScalelineControlDemo.vue"
</script>
<ClientOnly>
<ScalelineControlDemo />
</ClientOnly>

See [Demo page for all Map Controls](../index.md)
## Usage

::: code-group

<<< ../../../../src/demos/ScalelineControlDemo.vue

:::

## Properties

Expand Down
15 changes: 13 additions & 2 deletions docs/componentsguide/mapcontrols/swipe/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,20 @@

> A Swipe control for OpenLayers.
## Demo
<script setup>
import SwipeControlDemo from "@demos/SwipeControlDemo.vue"
</script>
<ClientOnly>
<SwipeControlDemo />
</ClientOnly>

See [Demo page for all Map Controls](../index.md)
## Usage

::: code-group

<<< ../../../../src/demos/SwipeControlDemo.vue

:::

## Properties

Expand Down
15 changes: 13 additions & 2 deletions docs/componentsguide/mapcontrols/toggle/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,20 @@

> A simple toggle control The control can be created with an interaction to control its activation.
## Demo
<script setup>
import ToggleControlDemo from "@demos/ToggleControlDemo.vue"
</script>
<ClientOnly>
<ToggleControlDemo />
</ClientOnly>

See [Demo page for all Map Controls](../index.md)
## Usage

::: code-group

<<< ../../../../src/demos/ToggleControlDemo.vue

:::

## Properties

Expand Down
15 changes: 13 additions & 2 deletions docs/componentsguide/mapcontrols/videorecorder/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,20 @@

> A simple toggle control The control can be created with an interaction to control its activation.
## Demo
<script setup>
import VideorecorderControlDemo from "@demos/VideorecorderControlDemo.vue"
</script>
<ClientOnly>
<VideorecorderControlDemo />
</ClientOnly>

See [Demo page for all Map Controls](../index.md)
## Usage

::: code-group

<<< ../../../../src/demos/VideorecorderControlDemo.vue

:::

## Properties

Expand Down
15 changes: 13 additions & 2 deletions docs/componentsguide/mapcontrols/zoom/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,20 @@

> A Zoom control for OpenLayers.
## Demo
<script setup>
import ZoomControlDemo from "@demos/ZoomControlDemo.vue"
</script>
<ClientOnly>
<ZoomControlDemo />
</ClientOnly>

## Usage

::: code-group

<<< ../../../../src/demos/ZoomControlDemo.vue

See [Demo page for all Map Controls](../index.md)
:::

## Properties

Expand Down
15 changes: 13 additions & 2 deletions docs/componentsguide/mapcontrols/zoomslider/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,20 @@

> A Zoom Slider control for OpenLayers.
## Demo
<script setup>
import ZoomsliderControlDemo from "@demos/ZoomsliderControlDemo.vue"
</script>
<ClientOnly>
<ZoomsliderControlDemo />
</ClientOnly>

See [Demo page for all Map Controls](../index.md)
## Usage

::: code-group

<<< ../../../../src/demos/ZoomsliderControlDemo.vue

:::

## Properties

Expand Down
15 changes: 13 additions & 2 deletions docs/componentsguide/mapcontrols/zoomtoextent/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,20 @@

> A Zoom to extent control for OpenLayers.
## Demo
<script setup>
import ZoomtoextentControlDemo from "@demos/ZoomtoextentControlDemo.vue"
</script>
<ClientOnly>
<ZoomtoextentControlDemo />
</ClientOnly>

See [Demo page for all Map Controls](../index.md)
## Usage

::: code-group

<<< ../../../../src/demos/ZoomtoextentControlDemo.vue

:::

## Properties

Expand Down
5 changes: 5 additions & 0 deletions docs/public/sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,11 @@
<lastmod>2021-08-15T21:05:05+00:00</lastmod>
<priority>0.80</priority>
</url>
<url>
<loc>https://vue3openlayers.netlify.app/componentsguide/mapcontrols/videorecorder/</loc>
<lastmod>2023-09-19T23:00:00+00:00</lastmod>
<priority>0.80</priority>
</url>
<url>
<loc>https://vue3openlayers.netlify.app/componentsguide/mapcontrols/zoom/</loc>
<lastmod>2021-08-15T21:05:05+00:00</lastmod>
Expand Down
3 changes: 1 addition & 2 deletions src/demos/AppDemo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@
title="LineString"
:onToggle="(active) => changeDrawType(active, 'LineString')"
/>
<ol-videorecorder-control @stop="videoStopped">
</ol-videorecorder-control>
<ol-videorecorder-control @stop="videoStopped" />
<ol-printdialog-control />
</ol-control-bar>

Expand Down
23 changes: 23 additions & 0 deletions src/demos/FullscreenControlDemo.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<template>
<ol-map ref="map" style="height: 400px">
<ol-view
ref="view"
:center="center"
:rotation="rotation"
:zoom="zoom"
:projection="projection"
/>

<ol-tile-layer>
<ol-source-osm />
</ol-tile-layer>
<ol-fullscreen-control />
</ol-map>
</template>

<script setup>
import { ref } from "vue";
const center = ref([40, 40]);
const projection = ref("EPSG:4326");
const zoom = ref(8);
</script>
Loading

0 comments on commit 8b201f5

Please sign in to comment.