Skip to content

Instantly share code, notes, and snippets.

@ibgreen
Created May 11, 2018 01:15
Show Gist options
  • Save ibgreen/8d9aca1cd9cfe537cc6bd85101652202 to your computer and use it in GitHub Desktop.
Save ibgreen/8d9aca1cd9cfe537cc6bd85101652202 to your computer and use it in GitHub Desktop.
deck.gl child component auto positioning
import DeckGL, {MapView, FirstPersonView} from 'deck.gl';
// Multiple views and an auto-positioned base map
const views = [
new FirstPersonView({...}),
new MapView({id: 'basemap', ...})
];
render() {
return (
<DeckGL
width={width}
height={height}
layers={this._renderLayers()}
views={views} />
<StaticMap
viewId='basemap'
{...viewState}/>
</DeckGL>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment