Skip to content

Commit

Permalink
add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Pessimistress committed May 15, 2020
1 parent 13cfca6 commit 4bedbff
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
11 changes: 11 additions & 0 deletions docs/api-reference/viewport.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,17 @@ Returns:
* `[longitude, latitude, altitude]`


##### `getBounds`

Extracts the axis-aligned bounding box of the current visible area.

* `options` (Object, optional)
+ `options.z` (Number, optional) - To calculate a bounding volume for fetching 3D data, this option can be used to get the bounding box at a specific elevation. Default `0`.

Returns:
* `[minX, minY, maxX, maxY]` that defines the smallest orthogonal bounds that encompasses the visible region.


##### `getFrustumPlanes`

Extract view frustum planes of the current camera. Each plane is defined by its normal `normal` and distance from
Expand Down
8 changes: 4 additions & 4 deletions modules/geo-layers/src/tile-layer/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ function getBoundingBox(viewport, zRange, extent) {
const bounds0 = viewport.getBounds({z: minZ});
const bounds1 = viewport.getBounds({z: maxZ});
bounds = [
Math.min(bounds0[0], bounds1[0], extent[0]),
Math.min(bounds0[1], bounds1[1], extent[1]),
Math.max(bounds0[2], bounds1[2], extent[2]),
Math.max(bounds0[3], bounds1[3], extent[3])
Math.min(bounds0[0], bounds1[0]),
Math.min(bounds0[1], bounds1[1]),
Math.max(bounds0[2], bounds1[2]),
Math.max(bounds0[3], bounds1[3])
];
} else {
bounds = viewport.getBounds();
Expand Down

0 comments on commit 4bedbff

Please sign in to comment.