Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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: 3 additions & 2 deletions docs/api-reference/core/globe-controller.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ new Deck({
Supports all [Controller options](./controller.md#options) with the following default behavior:

- `dragPan`: default `'pan'` (drag to pan)
- `dragRotate`: not effective, this view does not currently support rotation
- `touchRotate`: not effective, this view does not currently support rotation
- `dragRotate`: shift+drag or right-click drag to change bearing and pitch
- `touchRotate`: multi-touch rotate to change bearing
- `keyboard`: arrow keys to pan, +/- to zoom
- `inertia`: when set to a number (milliseconds), the globe continues spinning after a fling gesture with exponential decay
- `maxBounds` - constrains the viewport to the specified bounding box `[[minLng, minLat], [maxLng, maxLat]]`

## Custom GlobeController
Expand Down
8 changes: 6 additions & 2 deletions docs/api-reference/core/globe-view.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ It's recommended that you read the [Views and Projections guide](../../developer
## Limitations

The goal of `GlobeView` is to provide a generic solution to rendering and navigating data in the 3D space.
In the initial release, this class mainly addresses the need to render an overview of the entire globe. The following limitations apply, as features are still under development:

- No support for rotation (`pitch` or `bearing`). The camera always points towards the center of the earth, with north up.
- No high-precision rendering at high zoom levels (> 12). Features at the city-block scale may not be rendered accurately.
- Only supports `'lnglat'` (the default value of the `coordinateSystem` prop).
- Known rendering issues when using multiple views mixing `GlobeView` and `MapView`, or switching between the two.
Expand Down Expand Up @@ -72,8 +70,14 @@ To render, `GlobeView` needs to be used together with a `viewState` with the fol
- `longitude` (number) - longitude at the viewport center
- `latitude` (number) - latitude at the viewport center
- `zoom` (number) - zoom level
- `bearing` (number, optional) - bearing angle in degrees. Default `0` (north up).
- `pitch` (number, optional) - pitch angle in degrees. `0` looks straight down at the earth. Default `0`.
- `maxZoom` (number, optional) - max zoom level. Default `20`.
- `minZoom` (number, optional) - min zoom level. Default `0`.
- `maxPitch` (number, optional) - max pitch angle. Default `60`.
- `minPitch` (number, optional) - min pitch angle. Default `0`.

When `bearing` is `0` (the default), north is always kept pointing up and the globe behaves like a traditional desk globe — horizontal drag changes longitude, vertical drag changes latitude, and the polar axis stays fixed. When the user changes the bearing (via shift+drag or right-click drag), the globe enters free rotation mode where bearing evolves naturally to avoid orientation discontinuities near the poles.


## Controller
Expand Down
8 changes: 5 additions & 3 deletions docs/api-reference/core/globe-viewport.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# GlobeViewport (Experimental)

The `GlobeViewport` class takes globe view states (`latitude`, `longitude`, and `zoom`), and performs projections between world and screen coordinates. It is a helper class for visualizing the earth as a 3D globe.
The `GlobeViewport` class takes globe view states (`latitude`, `longitude`, `zoom`, `bearing`, and `pitch`), and performs projections between world and screen coordinates. It is a helper class for visualizing the earth as a 3D globe.

## Usage

Expand All @@ -25,7 +25,7 @@ viewport.project([-122.45, 37.78]);
## Constructor

```js
new GlobeViewport({width, height, longitude, latitude, zoom});
new GlobeViewport({width, height, longitude, latitude, zoom, bearing, pitch});
```

Parameters:
Expand All @@ -40,11 +40,13 @@ Parameters:
+ `latitude` (number, optional) - Latitude of the viewport center on map. Default to `0`.
+ `longitude` (number, optional) - Longitude of the viewport center on map. Default to `0`.
+ `zoom` (number, optional) - Map zoom (scale is calculated as `2^zoom`). Default to `11`.
+ `bearing` (number, optional) - Bearing angle in degrees. Default to `0`.
+ `pitch` (number, optional) - Pitch angle in degrees. Default to `0`.
+ `altitude` (number, optional) - Altitude of camera, 1 unit equals to the height of the viewport. Default to `1.5`.

projection matrix arguments:

+ `nearZMultiplier` (number, optional) - Scaler for the near plane, 1 unit equals to the height of the viewport. Default to `0.1`.
+ `nearZMultiplier` (number, optional) - Scaler for the near plane, 1 unit equals to the height of the viewport. Default to `0.01`.
+ `farZMultiplier` (number, optional) - Scaler for the far plane, 1 unit equals to the distance from the camera to the top edge of the screen. Default to `1`.

Remarks:
Expand Down
Loading
Loading