New methods refactored

This commit is contained in:
GRL 2021-06-23 11:32:11 +02:00
parent b50df10a49
commit bdb32a29e1
16 changed files with 246 additions and 141 deletions

View file

@ -66,16 +66,15 @@ WA.room.onLeaveZone('myZone', () => {
});
```
### register additional menu entries
adds an additional Entry to the main menu , these exist until the map is unloaded
### Add custom menu
```typescript
WA.ui.registerMenuCommand(menuCommand: string, callback: (menuCommand: string) => void): void
```
Example:
Add a custom menu item containing the text `commandDescriptor` in the main menu. A click on the menu will trigger the `callback`.
Custom menu exist only until the map is unloaded, or you leave the iframe zone of the script.
Example:
```javascript