-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Zoom and Compass widgets (#8072)
* Adding Zoom widget * Adding Compass widget * Adding globe viewport rotation * add(widgets) zoom icons and horizontal option * add(widgets) compass icon, button group component * add(widgets) test app and simpler getting started * add(widgets) compass and zoom docs --------- Signed-off-by: Chris Gervang <chris@gervang.com> Co-authored-by: Chris Gervang <chris.gervang@joby.aero> Co-authored-by: Chris Gervang <chrisgervang@users.noreply.github.com> Co-authored-by: Ib Green <ib@foursquare.com> Co-authored-by: Xiaoji Chen <cxiaoji@gmail.com> Co-authored-by: Chris Gervang <chris@gervang.com>
- Loading branch information
1 parent
77c2bf1
commit 2571bc2
Showing
19 changed files
with
714 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# CompassWidget | ||
|
||
This widget visualizes bearing and pitch. Click it once to reset bearing to 0, click it a second time to reset pitch to 0. Supports Map and Globe view. | ||
|
||
## Props | ||
|
||
### `id` (String) {#id} | ||
|
||
Default: `'fullscreen'` | ||
|
||
Unique identifier of the widget. | ||
|
||
### `viewId` (String, optional) {#viewid} | ||
|
||
Default: `null` | ||
|
||
The widget is attached to the view identified by this `viewId`. When assigned, the widget is placed within the specified view, and exclusively interacts with it. Required when using [multiple views](../../developer-guide/views.md#using-multiple-views). | ||
|
||
### `placement` (String, optional) {#placement} | ||
|
||
Default: `'top-left'` | ||
|
||
Widget position within the view relative to the map container. Valid options are `top-left`, `top-right`, `bottom-left`, `bottom-right`, or `fill`. | ||
|
||
### `label` (String, optional) {#label} | ||
|
||
Tooltip message displayed while hovering a mouse over the widget. | ||
|
||
Default: `'Compass'` | ||
|
||
### `transitionDuration` (Number, optional) {#transitionduration} | ||
|
||
Default: `200` | ||
|
||
Bearing and pitch reset transition duration in milliseconds. | ||
|
||
### `style` (Object, optional) {#style} | ||
|
||
Default: `{}` | ||
|
||
Additional CSS styles for the canvas. | ||
|
||
### `className` (String, optional) {#classname} | ||
|
||
Default: `undefined` | ||
|
||
Class name to attach to the widget element. The element has the default class name of `deck-widget deck-fullscreen-widget`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# ZoomWidget | ||
|
||
This widget controls the zoom level of a deck.gl view. Click '+' to zoom in by 1, click '-' to zoom out by 1. Supports controlling Map and Globe views. | ||
|
||
## Props | ||
|
||
### `id` (String) {#id} | ||
|
||
Default: `'zoom'` | ||
|
||
Unique identifier of the widget. | ||
|
||
### `viewId` (String, optional) {#viewid} | ||
|
||
Default: `null` | ||
|
||
The widget is attached to the view identified by this `viewId`. When assigned, the widget is placed within the specified view, and exclusively interacts with it. Required when using [multiple views](../../developer-guide/views.md#using-multiple-views). | ||
|
||
### `placement` (String, optional) {#placement} | ||
|
||
Default: `'top-left'` | ||
|
||
Widget position within the view relative to the map container. Valid options are `top-left`, `top-right`, `bottom-left`, `bottom-right`, or `fill`. | ||
|
||
### `orientation` (String, optional) {#orientation} | ||
|
||
Default: `'vertical'` | ||
|
||
Widget button orientation. Valid options are `vertical` or `horizontal`. | ||
|
||
### `container` (HTMLElement, optional) {#container} | ||
|
||
Default: `undefined` | ||
|
||
A [compatible DOM element](https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullScreen#Compatible_elements) which should be made full screen. By default, the map container element will be made full screen. | ||
|
||
### `zoomInLabel` (String, optional) {#zoominlabel} | ||
|
||
Tooltip message displayed while hovering a mouse over the zoom in button. | ||
|
||
Default: `'Zoom In'` | ||
|
||
### `zoomOutLabel` (String, optional) {#zoomoutlabel} | ||
|
||
Tooltip message displayed while hovering a mouse over the zoom out button. | ||
|
||
Default: `'Zoom Out'` | ||
|
||
### `transitionDuration` (Number, optional) {#transitionduration} | ||
|
||
Default: `200` | ||
|
||
Zoom transition duration in milliseconds. | ||
|
||
### `style` (Object, optional) {#style} | ||
|
||
Default: `{}` | ||
|
||
Additional CSS styles for the canvas. | ||
|
||
### `className` (String, optional) {#classname} | ||
|
||
Default: `undefined` | ||
|
||
Class name to attach to the widget element. The element has the default class name of `deck-widget deck-fullscreen-widget`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.