Skip to content

Commit 87cca76

Browse files
Update view docs (visgl#2947)
1 parent 8d002da commit 87cca76

20 files changed

+444
-536
lines changed

docs/api-reference/deck.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ The `onViewStateChange` callback is fired when the user has interacted with the
209209

210210
`onViewStateChange({viewState})`
211211

212-
* `viewState` - An updated [view state](/docs/developer-guide/view-state.md) object containing parameters such as `longitude`, `latitude`, `zoom` etc.
212+
* `viewState` - An updated [view state](/docs/developer-guide/views.md) object containing parameters such as `longitude`, `latitude`, `zoom` etc.
213213

214214
Returns:
215215

docs/api-reference/first-person-state.md

-132
This file was deleted.

docs/api-reference/first-person-view.md

+1-19
Original file line numberDiff line numberDiff line change
@@ -23,31 +23,13 @@ The `position` vector will then be interpreted as meter offsets from this anchor
2323
For more information on using `View` classes, consult the [Views](/docs/developer-guide/views.md) article.
2424

2525

26-
## Usage
27-
28-
Creating a new `FirstPersonView`
29-
30-
```js
31-
const viewport = new FirstPersonView({
32-
// Projection parameters (perspective projection)
33-
fov: 45,
34-
});
35-
```
36-
3726
## Constructor
3827

3928
```js
4029
new FirstPersonView({...});
4130
```
4231

43-
`FirstPersonView` takes the same parameters as the [View](/docs/api-reference/view.md) superclass constructor, with the following additions:
44-
45-
Projection matrix arguments:
46-
47-
* `fov` (Number, optional) - Field of view covered by camera. Default `75`.
48-
* `near` (Number, optional) - Distance of near clipping plane. Default `0.1`.
49-
* `far` (Number, optional) - Distance of far clipping plane. Default `1000`.
50-
32+
`FirstPersonView` takes the same parameters as the [View](/docs/api-reference/view.md) superclass constructor.
5133

5234
## Methods
5335

docs/api-reference/layer.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -198,13 +198,13 @@ Specifies how layer positions and offsets should be geographically interpreted.
198198

199199
The default is to interpret positions as latitude and longitude, however it is also possible to interpret positions as meter offsets added to projection center specified by the `coordinateOrigin` prop.
200200

201-
See the article on Coordinate Systems for details.
201+
See the article on [Coordinate Systems](/docs/developer-guide/coordinate-systems.md) for details.
202202

203203
##### `coordinateOrigin` ([Number, Number], optional)
204204

205205
Required when the `coordinateSystem` is set to `COORDINATE_SYSTEM.METER_OFFSETS`.
206206

207-
Specifies a longitude and a latitude from which meter offsets are calculated. See the article on Coordinate Systems for details
207+
Specifies a longitude and a latitude from which meter offsets are calculated. See the article on [Coordinate Systems](/docs/developer-guide/coordinate-systems.md) for details.
208208

209209
##### `wrapLongitude` (Boolean, optional)
210210

@@ -220,7 +220,7 @@ An optional 4x4 matrix that is multiplied into the affine projection matrices us
220220

221221
Allows local coordinate system transformations to be applied to a layer, which is useful when composing data from multiple sources that use different coordinate systems.
222222

223-
Note that the matrix projection is applied after the non-linear mercator projection calculations are resolved, so be careful when using model matrices with longitude/latitude encoded coordinates. They normally work best with non-mercator viewports or meter offset based mercator layers
223+
Note that the matrix projection is applied after the non-linear mercator projection calculations are resolved, so be careful when using model matrices with longitude/latitude encoded coordinates. They normally work best with non-mercator viewports or meter offset based mercator layers.
224224

225225

226226
### Data Properties

docs/api-reference/map-view.md

+2-9
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,12 @@ For more information on using `View` classes, consult the [Views](/docs/develope
2222

2323
The default controller of a `MapView` is [MapController](/docs/api-reference/map-controller.md).
2424

25-
## Usage
25+
## Constructor
2626

2727
```js
28-
const viewport = new MapView({id: 'primary-map'});
28+
const view = new MapView({...});
2929
```
3030

31-
32-
## Constructor
33-
34-
Creates a new `MapView` instance.
35-
36-
`new MapView({id, ...});`
37-
3831
`MapView` takes the same parameters as the [View](/docs/api-reference/view.md) superclass constructor.
3932

4033

docs/api-reference/orbit-view.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ For more information on using `View` classes, consult the [Views](/docs/develope
2323
## Constructor
2424

2525
```js
26-
new OrbitView({...});
26+
const view = new OrbitView({...});
2727
```
2828

2929
`OrbitView` takes the same parameters as the [View](/docs/api-reference/view.md) superclass constructor.

docs/api-reference/perspective-view.md

-8
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,6 @@ new PerspectiveView({..., fov: 45});
2323

2424
`PerspectiveView` takes the same parameters as the [View](/docs/api-reference/view.md) superclass constructor.
2525

26-
27-
Projection matrix arguments:
28-
29-
* `fov` (Number, optional) - Field of view covered by camera. Default to `75`.
30-
* `near` (Number, optional) - Distance of near clipping plane. Default to `1`.
31-
* `far` (Number, optional) - Distance of far clipping plane. Default to `100`.
32-
33-
3426
## Methods
3527

3628
Inherits all [View methods](/docs/api-reference/view.md#methods).

docs/api-reference/third-person-view.md

+1-24
Original file line numberDiff line numberDiff line change
@@ -22,37 +22,14 @@ The `position` vector will then be interpreted as meter offsets from this anchor
2222
For more information on using `View` classes, consult the [Views](/docs/developer-guide/views.md) article.
2323

2424

25-
## Usage
26-
27-
```js
28-
const view = new ThirdPersonView({
29-
// Projection parameters (perspective projection)
30-
fov: 45
31-
});
32-
```
33-
34-
3525
## Constructor
3626

3727
```js
38-
new ThirdPersonView({fov: 45, width: 500, height: 500, ...});
28+
new ThirdPersonView({...});
3929
```
4030

4131
`ThirdPersonView` takes the same parameters as the [View](/docs/api-reference/view.md) superclass constructor.
4232

43-
Parameters:
44-
45-
* `opts` (Object) - Third person view options
46-
47-
projection matrix arguments:
48-
49-
+ `fov` (Number, optional) - Field of view covered by camera. Default to `75`.
50-
+ `near` (Number, optional) - Distance of near clipping plane. Default to `1`.
51-
+ `far` (Number, optional) - Distance of far clipping plane. Default to `100`.
52-
+ `aspect` (Number, optional) - Aspect ratio. Default to the view's `width/height`.
53-
54-
See [View constructor](/docs/api-reference/view.md#constructor) for additional parameters, especially for specifying alternate projection matrices, geospatial anchor etc.
55-
5633

5734
## Methods
5835

0 commit comments

Comments
 (0)