Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
repositoryUrl: https://github.com/dynamsoft-docs/camera-enhancer-docs-js/blob/main
repositoryUrlJS: https://github.com/dynamsoft-docs/camera-enhancer-docs-js/blob/main
repository: dynamsoft-docs/camera-enhancer-docs-js
docFullPath: https://www.dynamsoft.com/camera-enhancer/docs/web/
firstLevelUrl: /camera-enhancer/docs/web
Expand Down Expand Up @@ -69,7 +68,7 @@ defaults:
- scope:
path: "programming/javascript"
values:
category: "js-repo"
edition: "js"
docRootName: "Camera Enhancer JavaScript Edition"
docHomePage: "/camera-enhancer/docs/web/programming/javascript/"

url: "https://www.dynamsoft.com" # sitemap root
48 changes: 47 additions & 1 deletion programming/javascript/api-reference/drawinglayer.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ permalink: /programming/javascript/api-reference/drawinglayer.html
| [removeDrawingItems()](#removedrawingitems) | Removes specified `DrawingItem` objects from the layer. |
| [setDrawingItems()](#setdrawingitems) | Sets the layer's `DrawingItem` objects, replacing any existing items. |
| [getDrawingItems()](#getdrawingitems) | Retrieves `DrawingItem` objects from the layer, optionally filtered by a custom function. |
| [hasDrawingItem()](#hasDrawingItem) | Checks if a specific `DrawingItem` exists within the layer. |
| [hasDrawingItem()](#hasdrawingitem) | Checks if a specific `DrawingItem` exists within the layer. |
| [clearDrawingItems()](#cleardrawingitems) | Clears all `DrawingItem` objects from the layer. |
| [onSelectionChanged()](#onselectionchanged) | Event triggered whenever there is a change in which `DrawingItem` objects are selected or deselected. |
| [renderAll()](#renderall) | Forces a re-render of all `DrawingItem` objects on the layer. |
| [setMode()](#setmode) | Changes the mode of the layer. |
| [getMode()](#getmode) | Returns the current mode. |

**Special Notice**

Expand Down Expand Up @@ -525,3 +527,47 @@ drawingLayer.onSelectionChanged = (selected, deselected) => {
//Do something based on the selection change.
}
```

## setMode

Changes the mode of the layer.

```typescript
setMode(newMode: string): void;
```

**Parameters**

`newMode`: specifies the new mode. At present, the allowed values are "editor" and "viewer" and the default is "viewer".

> Compared with the "viewer" mode, the "editor" mode shows the "corners" and a "rotate control point" for a selected DrawingItem, which, when dragged, modify the original shape in different ways.

**Code Snippet**

```javascript
let cameraView = cameraEnhancer.getCameraView();
//Gets the `DrawingLayer` used by Dynamsoft Label Recognizer.
let drawingLayer = cameraView.getDrawingLayer(3);
drawingLayer.setMode("editor");
```

## getMode

Returns the current mode.

```typescript
getMode(): "editor" | "viewer";
```

**Return value**

The mode of current `DrawingLayer` .

**Code Snippet**

```javascript
let cameraView = cameraEnhancer.getCameraView();
//Gets the `DrawingLayer` used by Dynamsoft Label Recognizer.
let drawingLayer = cameraView.getDrawingLayer(3);
let mode = drawingLayer.getMode();
```
4 changes: 2 additions & 2 deletions programming/javascript/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ permalink: /programming/javascript/index.html
## Release Notes

* [Version 4.x](release-note/release-notes-4.x.html)
* [Version 3.x](release-note/release-notes-3.x.html)
* [Version 2.x](release-note/release-notes-2.x.html)
<!-- * [Version 3.x](release-note/release-notes-3.x.html)
* [Version 2.x](release-note/release-notes-2.x.html) -->
4 changes: 2 additions & 2 deletions programming/javascript/release-note/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ permalink: /programming/javascript/release-note/index.html
* [4.0.2 (04/01/2024)](release-notes-4.x.html#402-04012024)
* [4.0.1 (01/11/2024)](release-notes-4.x.html#401-01112024)
* [4.0.0 (08/24/2023)](release-notes-4.x.html#400-08242023)
* [3.3.10 (02/05/2024)](release-notes-3.x.html#3310-02052024)
<!-- * [3.3.10 (02/05/2024)](release-notes-3.x.html#3310-02052024)
* [3.3.9 (12/06/2023)](release-notes-3.x.html#339-12062023)
* [3.3.8 (10/12/2023)](release-notes-3.x.html#338-10122023)
* [3.3.7 (10/11/2023)](release-notes-3.x.html#337-10112023)
Expand All @@ -34,4 +34,4 @@ permalink: /programming/javascript/release-note/index.html
* [2.1.0 (01/20/2022)](release-notes-2.x.html#210-01202022)
* [2.0.3 (10/29/2021)](release-notes-2.x.html#203-10292021)
* [2.0.1 (10/26/2021)](release-notes-2.x.html#201-10262021)
* [2.0.0 (10/20/2021)](release-notes-2.x.html#200-10202021)
* [2.0.0 (10/20/2021)](release-notes-2.x.html#200-10202021) -->
5 changes: 2 additions & 3 deletions programming/javascript/user-guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ In this guide, you will learn step by step on how to integrate the Dynamsoft Cam
- [Why can't I use my camera?](#why-cant-i-use-my-camera)
- [API Documentation](#api-documentation)
- [System Requirements](#system-requirements)
- [Release Notes](#release-notes)
- [Next Steps](#next-steps)

## Adding the SDK
Expand Down Expand Up @@ -362,9 +361,9 @@ The following table is a list of supported browsers based on the above requireme

Apart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK. Browser compatibility ultimately depends on whether the browser on that particular operating system supports the features listed above.

## Release Notes
<!-- ## Release Notes

Learn about what are included in each release at [https://www.dynamsoft.com/camera-enhancer/docs/programming/javascript/release-note/index.html](https://www.dynamsoft.com/camera-enhancer/docs/web/programming/javascript/release-note/index.html).
Learn about what are included in each release at [https://www.dynamsoft.com/camera-enhancer/docs/programming/javascript/release-note/index.html](https://www.dynamsoft.com/camera-enhancer/docs/web/programming/javascript/release-note/index.html). -->

## Next Steps

Expand Down