Skip to content
Permalink
Browse files

Merge 0b62bfc into ced5c79

  • Loading branch information
ibgreen committed Sep 17, 2019
2 parents ced5c79 + 0b62bfc commit 3bcbfb93d8a7e5e0e0b3ebc613f8248cf9ac37cf
@@ -131,7 +131,7 @@ The Tile3DLayer renders the following sublayers based on tile [format](https://g
- `_lighting` is default to `pbr`.
* `pointcloud` - a [PointCloudLayer](/docs/layers/point-cloud-layer.md) rendering all the tiles with Point Cloud format.
- `pointSize` is default to `1.0`.
- `getColor` is default to `[255, 0, 0]`
- `getColor` is default to `[255, 0, 0]`. This value is only applied when no [color properties](https://github.com/AnalyticalGraphicsInc/3d-tiles/blob/master/specification/TileFormats/PointCloud/README.md#point-colors) are defined in point cloud tile file.

## Source

@@ -0,0 +1,30 @@
{
"description": "The deck.gl website tile-3d-layer example",
"websiteUrl": "https://deck.gl/#/examples/geo-layers/tile-3d-layer",
"initialViewState": {
"latitude": 29.99456364445551,
"longitude": 31.131612169432408,
"pitch": 45,
"maxPitch": 60,
"bearing": 0,
"minZoom": 2,
"maxZoom": 30,
"zoom": 12.8
},
"views": [
{
"type": "MapView",
"mapStyle": "mapbox://styles/mapbox/dark-v9",
"controller": true
}
],
"layers": [
{
"type": "Tile3DLayer",
"id": "tiles-cairo-vricon",
"DracoLoader": "DracoLoader",
"_ionAssetId": 29328,
"_ionAccessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJlNGZmZjBjMS04ZGYwLTRhYjAtOWIzYy0wZWJmNzI4OWZhNGEiLCJpZCI6MTYyMywic2NvcGVzIjpbImFzciIsImdjIl0sImFzc2V0cyI6WzI5MzI4LDI5MzMxLDI5MzMyLDI5MzMzLDI5MzM0LDI5MzM1LDEsMiwzLDQsMzk1NF0sImlhdCI6MTU2MDQ0ODA2Nn0.zZPuc5WzTsrKNviCY2jyhmDwJITXzhbRTnJS025_uBw"
}
]
}
@@ -0,0 +1,30 @@
{
"description": "The deck.gl website tile-3d-layer example",
"websiteUrl": "https://deck.gl/#/examples/geo-layers/tile-3d-layer",
"initialViewState": {
"latitude": 40.73380895124223,
"longitude": -73.99557610230511,
"pitch": 45,
"maxPitch": 60,
"bearing": 0,
"minZoom": 2,
"maxZoom": 30,
"zoom": 10.766728129551447
},
"views": [
{
"type": "MapView",
"mapStyle": "mapbox://styles/mapbox/dark-v9",
"controller": true
}
],
"layers": [
{
"type": "Tile3DLayer",
"id": "tiles-new-york",
"DracoLoader": "DracoLoader",
"_ionAssetId": 7162,
"_ionAccessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIzMGY4ODczYy1mNTk4LTRiMDUtYmIxYy0xZWYwOWZmMGY4NjQiLCJpZCI6NDQsInNjb3BlcyI6WyJhc3IiLCJnYyJdLCJhc3NldHMiOlsxLDIsMyw0LDYxOTMsNjI3Myw3MTYyLDczNTMsNzE0Ml0sImlhdCI6MTU0MTYxODM0NX0.lWnGs9ySXO4QK3HagcMsDpZ8L01DpmUDQm38-2QAQuE"
}
]
}
@@ -0,0 +1,29 @@
{
"description": "The deck.gl website tile-3d-layer example",
"websiteUrl": "https://deck.gl/#/examples/geo-layers/tile-3d-layer",
"initialViewState": {
"latitude": -37.80581839466932,
"longitude": 144.97127808879253,
"pitch": 45,
"maxPitch": 60,
"bearing": 0,
"minZoom": 2,
"maxZoom": 20,
"zoom": 17.363371067478802
},
"views": [
{
"type": "MapView",
"mapStyle": "mapbox://styles/mapbox/light-v9",
"controller": true
}
],
"layers": [
{
"type": "Tile3DLayer",
"id": "tiles-royal",
"DracoWorkerLoader": "DracoWorkerLoader",
"tilesetUrl": "https://raw.githubusercontent.com/uber-common/deck.gl-data/master/3d-tiles/RoyalExhibitionBuilding/tileset.json"
}
]
}
@@ -0,0 +1,30 @@
{
"description": "The deck.gl website tile-3d-layer example",
"websiteUrl": "https://deck.gl/#/examples/geo-layers/tile-3d-layer",
"initialViewState": {
"latitude": 46.26,
"longitude": -122,
"pitch": 45,
"maxPitch": 60,
"bearing": 0,
"minZoom": 2,
"maxZoom": 30,
"zoom": 10
},
"views": [
{
"type": "MapView",
"mapStyle": "mapbox://styles/mapbox/dark-v9",
"controller": true
}
],
"layers": [
{
"type": "Tile3DLayer",
"id": "tiles-st-helens",
"DracoWorkerLoader": "DracoWorkerLoader",
"_ionAssetId": 33301,
"_ionAccessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIxN2NhMzkwYi0zNWM4LTRjNTYtYWE3Mi1jMDAxYzhlOGVmNTAiLCJpZCI6OTYxOSwic2NvcGVzIjpbImFzbCIsImFzciIsImFzdyIsImdjIl0sImlhdCI6MTU2MjE4MTMxM30.OkgVr6NaKYxabUMIGqPOYFe0V5JifXLVLfpae63x-tA"
}
]
}
@@ -7,6 +7,10 @@ export default {
'website/Scatterplot (ScatterplotLayer)': require('./scatterplot.json'),
'website/Screen Grid (ScreenGridLayer)': require('./screen-grid.json'),
'website/TagMap (TextLayer)': require('./tagmap.json'),
'website/3D Tiles (Tile3DLayer, Royal)': require('./3d-tiles-royal.json'),
'website/3D Tiles (Tile3DLayer, St Helens)': require('./3d-tiles-st-helens.json'),
'website/3D Tiles (Tile3DLayer, Cairo/vricon)': require('./3d-tiles-cairo-vricon.json'),
'website/3D Tiles (Tile3DLayer, New York)': require('./3d-tiles-new-york.json'),
// GET STARTED EXAMPLES AS JSON PAYLOADS
'get-started/US map (GeoJsonLayer)': require('./us-map.json'),
'get-started/Dot Text (Scatterplot/TextLayer)': require('./dot-text.json')
@@ -13,6 +13,8 @@
"@deck.gl/layers": "^7.3.0-alpha",
"@deck.gl/react": "^7.3.0-alpha",
"@loaders.gl/csv": "^1.3.0",
"@loaders.gl/core": "^1.3.0",
"@loaders.gl/draco": "^1.3.0",
"@luma.gl/constants": "^7.3.0-alpha",
"brace": "^0.11.1",
"react": "~16.9.0",
@@ -14,12 +14,6 @@ import 'brace/theme/github';

import JSON_TEMPLATES from '../json-examples';

import {registerLoaders} from '@loaders.gl/core';
import {CSVLoader} from '@loaders.gl/csv';

// Note: deck already registers JSONLoader...
registerLoaders([CSVLoader]);

const INITIAL_TEMPLATE = Object.keys(JSON_TEMPLATES)[0];

// Set your mapbox token here
@@ -65,7 +59,6 @@ export class App extends Component {
_setJSON(json) {
const jsonProps = this.jsonConverter.convert(json);
this._updateViewState(jsonProps);

this.setState({jsonProps});
}

@@ -9,6 +9,13 @@ import * as MeshLayers from '@deck.gl/mesh-layers';
import {COORDINATE_SYSTEM} from '@deck.gl/core';
import GL from '@luma.gl/constants';

import {registerLoaders} from '@loaders.gl/core';
import {CSVLoader} from '@loaders.gl/csv';
import {DracoLoader, DracoWorkerLoader} from '@loaders.gl/draco';

// Note: deck already registers JSONLoader...
registerLoaders([CSVLoader]);

export default {
// Classes that should be instantiatable by JSON converter
classes: Object.assign(
@@ -28,5 +35,11 @@ export default {
enumerations: {
COORDINATE_SYSTEM,
GL
},

// Constants that should be resolved with the provided values by JSON converter
constants: {
DracoLoader,
DracoWorkerLoader
}
};
@@ -97,7 +97,7 @@ export default class Tile3DLayer extends CompositeLayer {
onTileUnload: this.props.onTileUnload,
onTileLoadFail: this.props.onTileLoadFail,
// TODO: explicit passing should not be needed, registerLoaders should suffice
DracoLoader: this.props.DracoWorkerLoader || this.props.DracoLoader,
DracoLoader: this._getDracoLoader(),
fetchOptions,
...ionMetadata
});
@@ -141,7 +141,7 @@ export default class Tile3DLayer extends CompositeLayer {
for (const tile of tilesWithoutLayer) {
// TODO - why do we call this here? Being "selected" should automatically add it to cache?
tileset3d.addTileToCache(tile);
unpackTile(tile, this.props.DracoLoader);
unpackTile(tile, this._getDracoLoader());

layerMap[tile.fullUri] = {
layer: this._create3DTileLayer(tile),
@@ -153,6 +153,10 @@ export default class Tile3DLayer extends CompositeLayer {
this._selectLayers(frameNumber);
}

_getDracoLoader() {
return this.props.DracoWorkerLoader || this.props.DracoLoader;
}

// Grab only those layers who were selected this frame.
_selectLayers(frameNumber) {
const {layerMap} = this.state;
@@ -21,6 +21,7 @@
"layers": [
{
"type": "ScatterplotLayer",
"id": "SCATTER_PLOT_LAYER_ID",
"data": [{"position": [-122.45, 37.8]}],
"getPosition": "position",
"getFillColor": [255, 0, 0, 255],

0 comments on commit 3bcbfb9

Please sign in to comment.
You can’t perform that action at this time.