-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
app.jsx
43 lines (38 loc) · 993 Bytes
/
app.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import React, {Component} from 'react';
import {createRoot} from 'react-dom/client';
import DeckGL from '@deck.gl/react';
import {MapView} from '@deck.gl/core';
import * as layers from '@deck.gl/layers';
import JSONLayer from './json-layer/json-layer';
import LAYERS_JSON from './layers.json';
const INITIAL_VIEW_STATE = {
latitude: 49.254,
longitude: -123.13,
zoom: 11,
maxZoom: 16,
pitch: 45,
bearing: 0
};
export default class App extends Component {
render() {
const {data = LAYERS_JSON} = this.props;
return (
<DeckGL
width="100%"
height="100%"
initialViewState={INITIAL_VIEW_STATE}
controller={true}
views={[new MapView()]}
layers={[
new JSONLayer({
data,
configuration: {classes: layers}
})
]}
/>
);
}
}
/* global document */
const container = document.body.appendChild(document.createElement('div'));
createRoot(container).render(<App />);