Skip to content

Commit

Permalink
docs(ol-context-menu-control): improve documentation for ol-contextmenu
Browse files Browse the repository at this point in the history
relatesto #325
  • Loading branch information
d-koppenhagen committed Apr 3, 2024
1 parent bd59b53 commit e7a9316
Showing 1 changed file with 35 additions and 16 deletions.
51 changes: 35 additions & 16 deletions docs/componentsguide/mapcontrols/contextmenu/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,49 @@ Add context menu to map

## Properties

### eventType
### Props from OpenLayers

- **Type**: `String`
- **Default**: `contextmenu`
Properties are passed-trough from `ol-contextmenu` directly.
Their types and default values can be checked-out [in the official docs](https://github.com/jonataswalker/ol-contextmenu).
Only some properties deviate caused by reserved keywords from Vue / HTML.
This deviating props are described in the section below.

The listening event type (You could use 'click', 'dblclick')
### Deviating Properties

### defaultItems
None.

- **Type**: `Boolean`
- **Default**: `true`
## Events

Whether the default items (which are: Zoom In/Out) are enabled
You have access to all Events from the underlying control.
Check out [the official docs](https://github.com/jonataswalker/ol-contextmenu) to see the available events tht will be fired.

### width
```html
<ol-videorecorder-control @error="handleEvent" />
```

- **Type**: `Number`
- **Default**: `150`
## Methods

The menu's width
You have access to all Methods from the underlying control.
Check out [the official docs](https://github.com/jonataswalker/ol-contextmenu) to see the available methods.

### items
To access the source, you can use a `ref()` as shown below:

- **Type**: `Array`
- **Default**: `[]`
```vue
<template>
<!-- ... -->
<ol-videorecorder-control ref="controlRef" @error="handleEvent" />
<!-- ... -->
</template>
An array of object|string
<script setup lang="ts">
import { ref, onMounted } from "vue";
import type ContextMenu from "ol-contextmenu";
const controlRef = ref<{ control: ContextMenu }>(null);
onMounted(() => {
const contextmenu: ContextMenu = controlRef.value?.control;
// call your method on `contextmenu`
});
</script>
```

0 comments on commit e7a9316

Please sign in to comment.