You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api-reference/core/controller.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,8 @@ The base Controller class supports the following options:
15
15
*`dragPan` (boolean) - enable panning with pointer drag. Default `true`
16
16
*`dragRotate` (boolean) - enable rotating with pointer drag. Default `true`
17
17
*`doubleClickZoom` (boolean) - enable zooming with double click. Default `true`
18
-
*`touchZoom` (boolean) - enable zooming with multi-touch. Default `true`
18
+
*`doubleClickDragZoom` (boolean) - enable zooming by double clicking/tapping and dragging. Default `true`
19
+
*`touchZoom` (boolean) - enable zooming with multi-touch pinch. Default `true`
19
20
*`touchRotate` (boolean) - enable rotating with multi-touch. Use two-finger rotating gesture for horizontal and three-finger swiping gesture for vertical rotation. Default `false`
20
21
*`keyboard` (boolean | object) - enable interaction with keyboard. Default `true`. If an object is supplied, it may contain the following fields to customize the keyboard behavior:
21
22
*`zoomSpeed` (number) - speed of zoom using +/- keys. Default `2`.
@@ -26,6 +27,8 @@ The base Controller class supports the following options:
26
27
*`inertia` (boolean | number) - Enable inertia after panning/pinching. If a number is provided, indicates the duration of time over which the velocity reduces to zero, in milliseconds. Default `false`.
27
28
*`maxBounds` (`[min: number[], max: number[]]`) - constrain camera to the specified bounding box. Different type of views may handle this constraint differently.
28
29
30
+
> **Mobile users:** See [Optimization for Mobile](../../developer-guide/tips-and-tricks.md#optimization-for-mobile) for CSS and browser event guards that help prevent native selection, tap highlight, and touch callout UI during repeated touch gestures.
31
+
29
32
## Methods
30
33
31
34
> A controller is not meant to be instantiated by the application. The following methods are documented for creating custom controllers that extend the base Controller class.
@@ -116,6 +119,7 @@ Note that the following events are always toggled on/off by user options:
Copy file name to clipboardExpand all lines: docs/developer-guide/tips-and-tricks.md
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,6 +59,36 @@ If this is an issue, set the `isolation` CSS prop on the `DeckGL` parent element
59
59
60
60
## Optimization for Mobile
61
61
62
+
### Mobile Browser Touch UI
63
+
64
+
For mobile experiences using a deck.gl [Controller](../api-reference/core/controller.md), use CSS guards on the Deck canvas/root element so repeated touch gestures do not trigger browser selection, tap highlight, or WebKit touch callouts:
65
+
66
+
```css
67
+
#deck-root,
68
+
#deck-rootcanvas {
69
+
touch-action: none;
70
+
user-select: none;
71
+
-webkit-user-select: none;
72
+
-webkit-touch-callout: none;
73
+
-webkit-tap-highlight-color: transparent;
74
+
}
75
+
```
76
+
77
+
Some iOS embeds may still surface native callout UI during long-press or rapid double-tap gestures. In those cases, prevent the browser-native UI events that originate from the canvas without stopping pointer event propagation. The controller still needs deck.gl's pointer events to receive the gesture sequence.
78
+
79
+
```js
80
+
constroot=document.getElementById('deck-root');
81
+
constpreventCanvasBrowserUI=event=> {
82
+
if (event.targetinstanceofHTMLCanvasElement) {
83
+
event.preventDefault();
84
+
}
85
+
};
86
+
87
+
for (consttypeof ['contextmenu', 'selectstart', 'gesturestart', 'gesturechange', 'gestureend']) {
0 commit comments