Skip to content

Commit

Permalink
Merge 0ac3711 into d61afe1
Browse files Browse the repository at this point in the history
  • Loading branch information
Xintong Xia committed Mar 31, 2020
2 parents d61afe1 + 0ac3711 commit e9f7983
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 8 deletions.
7 changes: 5 additions & 2 deletions modules/3d-tiles/docs/api-reference/tiles-3d-loader.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Parses a [3D tile](https://github.com/AnalyticalGraphicsInc/3d-tiles).

## Usage

As a tileset contains multiple file formats, `Tiles3DLoader` is needed to be explicitly specified when using [`load`](https://loaders.gl/modules/core/docs/api-reference/load) function.

Load a tileset file.

```js
Expand All @@ -29,11 +31,12 @@ const tilesetJson = await load(tilesetUrl, Tiles3DLoader);
To decompress tiles containing Draco compressed glTF models or Draco compressed point clouds:

```js
import {load} from '@loaders.gl/core';
import {load, registerLoaders} from '@loaders.gl/core';
import {Tiles3DLoader} from '@loaders.gl/3d-tiles';
import {DracoWorkerLoader} from '@loaders.gl/draco';
registerLoaders(DracoWorkerLoader);
const tileUrl = 'https://assets.cesium.com/43978/1.pnts';
const tile = await load(tileUrl, Tiles3DLoader, {DracoWorkerLoader, decompress: true});
const tile = await load(tileUrl, Tiles3DLoader, {decompress: true});
```

Load a tileset and dynamically load/unload tiles based on viewport with helper class `Tileset3D` (`@loaders.gl/tiles`)
Expand Down
4 changes: 2 additions & 2 deletions modules/3d-tiles/src/tiles-3d-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ const Tiles3DLoader = {
id: '3d-tiles',
name: '3D Tiles',
version: VERSION,
extensions: ['json', 'cmpt', 'pnts', 'b3dm', 'i3dm'],
extensions: ['cmpt', 'pnts', 'b3dm', 'i3dm'],
mimeType: 'application/octet-stream',
test: ['json', 'cmpt', 'pnts', 'b3dm', 'i3dm'],
test: ['cmpt', 'pnts', 'b3dm', 'i3dm'],
parse,
options: {
'3d-tiles': {
Expand Down
2 changes: 1 addition & 1 deletion modules/3d-tiles/test/tiles-3d-loader.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const TILE_B3DM_WITH_DRACO_URL = '@loaders.gl/3d-tiles/test/data/143.b3dm';

test('Tiles3DLoader#Tileset file', async t => {
const response = await fetchFile(TILESET_URL);
const tileset = await parse(response, [Tiles3DLoader]);
const tileset = await parse(response, Tiles3DLoader);
t.ok(tileset);

t.equals(tileset.type, 'TILES3D');
Expand Down
2 changes: 1 addition & 1 deletion modules/core/docs/api-reference/load.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The `load` function is used to load and parse data with a specific _loader objec
The `loaders` parameter can also be omitted, in which case any _loader objects_ previously registered with [`registerLoaders`](docs/api-reference/core/register-loaders) will be used.

- `url` - Urls can be data urls (`data://`) or a request (`http://` or `https://`) urls, or a file name (Node.js only). Also accepts `File` or `Blob` object (Browser only). Can also accept any format that is accepted by [`parse`](https://github.com/uber-web/loaders.gl/blob/master/docs/api-reference/core/parse.md), with the exception of strings that are interpreted as urls.
- `loaders` - can be a single loader or an array of loaders. If ommitted, will use the list of registered loaders (see `registerLoaders`)
- `loaders` - can be a single loader or an array of loaders. If single loader is provided, will force to use it. If ommitted, will use the list of pre-registered loaders (see `registerLoaders`)
- `options` - optional, contains both options for the read process and options for the loader (see documentation of the specific loader).

Returns:
Expand Down
2 changes: 1 addition & 1 deletion modules/core/docs/api-reference/parse.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Parses data asynchronously either using the provided loader or loaders, or using
- `File` - A browser file object (from drag-and-drop or file selection operations).
- `Promise` - A promise that resolves to any of the other supported data types can also be supplied.

- `loaders` - can be a single loader or an array of loaders. If ommitted, will use the list of pre-registered loaders (see `registerLoaders`)
- `loaders` - can be a single loader or an array of loaders. If single loader is provided, will force to use it. If ommitted, will use the list of pre-registered loaders (see `registerLoaders`)

- `options`: optional, options for the loader (see documentation of the specific loader).

Expand Down
2 changes: 2 additions & 0 deletions modules/i3s/docs/api-reference/i3s-loader.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ The terms and concepts used in `i3s` module have the corresponding parts [I3S Sp

## Usage

As an I3S tileset contains multiple file formats, `I3SLoader` is needed to be explicitly specified when using [`load`](https://loaders.gl/modules/core/docs/api-reference/load) function.

**Load I3S tileset and render with [deck.gl](https://deck.gl/#/)**

A simple react app uses `I3SLoader` to load [San Francisco Buildings](https://www.arcgis.com/home/item.html?id=d3344ba99c3f4efaa909ccfbcc052ed5), render with [deck.gl's](https://deck.gl/) [`Tile3Dlayer`](https://deck.gl/#/documentation/deckgl-api-reference/layers/tile-3d-layer) and dynamically load/unload tiles based on current viewport and adjust the level of details when zooming in and out.
Expand Down
1 change: 0 additions & 1 deletion modules/i3s/src/i3s-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ const I3SLoader = {
id: 'i3s',
name: 'I3S 3D Tiles',
version: VERSION,
extensions: ['json', 'bin'],
mimeType: 'application/octet-stream',
parse,
options: {
Expand Down

0 comments on commit e9f7983

Please sign in to comment.