Replies: 1 comment
-
The layers you create in the application are just small descriptor objects, that are diffed by deck to see if changes need to be made. All the expensive state (allocated memory, GPU resources etc) is managed under the hood by deck. This is very similar to components in react which are also just descriptors holding props. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I am new to this engine and thanks for the awesome work! I have a little question that when I use the framework, I created layers according to input data from upper layer, give the example of SimpleMeshLayer: let newLayer = new SimpleMeshLayer({
id: 'multi-cube-layer',
data: cubeData,
mesh: cubeGeometry,
getPosition: d => d.position,
getColor: d => d.color,
getOrientation: d => d.orientation,
getScale: d => d.scale,
material: {
ambient: 0.8,
specularColor: [0.3, 0.3, 0.3],
transparent: true,
opacity: 0.8
},
pickable: true,
coordinateSystem: COORDINATE_SYSTEM.METER_OFFSETS,
coordinateOrigin: [0, 0, 0]
});
layerList.push(this.cubeLayer); and I use the layer return :<DeckGL
width="100%"
height="100%"
ref={this.deckRef}
effects={[LIGHTS]}
views={views}
viewState={viewStates}
layers={newLayer }
layerFilter={this._layerFilter}
getCursor={
this._getCursor
// ()=> (this.props.customData?.isDrawing == true && !this.props.customData?.pickable) ? 'crosshair' : this.isHovering ? 'pointer' : 'default' // this.state.cursor
// (this.props.customData?.isDrawing == true && !this.props.customData?.pickable) ? 'crosshair' : this.isHovering ? 'pointer' : 'default'
}
onLoad={this._onDeckLoad}
onHover={this._onLayerHover}
onClick={this._onLayerClick}
controller={{
doubleClickZoom: false,
keyboard: false, // added to disable keyboard control
// getCursor: this._getCursor
}}
onViewStateChange={this._onViewStateChange}
ContextProvider={MapContext.Provider}
_onMetrics={this._onMetrics}
// style={{background:'#9d9d9d'}}
>
{showMap && (
<StaticMap
reuseMap={true}
attributionControl={false}
mapboxApiAccessToken={mapboxApiAccessToken}
mapStyle={mapStyle}
visible={frame && frame.origin && !viewMode.firstPerson}
onLoad={this._onMapLoad}
/>
)}
Beta Was this translation helpful? Give feedback.
All reactions