Skip to content

Commit ff02d54

Browse files
committed
it's an app!
1 parent 5f026d8 commit ff02d54

File tree

9 files changed

+670
-17
lines changed

9 files changed

+670
-17
lines changed

Diff for: .gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ node_modules
1212
.vagrant
1313

1414
# JS output
15-
**/frontend/*.js*
1615
dist
1716

1817
# self-signed certs

Diff for: js/index.tsx

+4-10
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
import { createRoot } from 'react-dom/client';
2-
import HelloWorld from './hello.tsx';
2+
import App from './map';
33

4-
const App = () => {
4+
const Index = () => {
55
return (
6-
<body>
7-
<main>
8-
<section>
9-
<HelloWorld />
10-
</section>
11-
</main>
12-
</body>
6+
<App />
137
);
148
}
159

16-
createRoot(document.getElementById('app') as HTMLElement).render(<App />);
10+
createRoot(document.getElementById('app') as HTMLElement).render(<Index />);

Diff for: js/map.tsx

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import React from "react";
2+
import { Map } from 'react-map-gl/maplibre';
3+
import DeckGL from '@deck.gl/react';
4+
import { ScatterplotLayer } from "@deck.gl/layers";
5+
import 'maplibre-gl/dist/maplibre-gl.css';
6+
7+
function App() {
8+
return <DeckGL
9+
initialViewState={{
10+
longitude: 0.45,
11+
latitude: 51.47,
12+
zoom: 7
13+
}}
14+
controller
15+
>
16+
<ScatterplotLayer
17+
data={[
18+
{ position: [-0.05, 51.47], size: 1000 },
19+
{ position: [0.05, 51.47], size: 500 },
20+
{ position: [0.45, 51.47], size: 2000 }
21+
]}
22+
getPosition={d => d.position}
23+
getRadius={d => d.size}
24+
/>
25+
<Map
26+
mapStyle="https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json"
27+
/>
28+
</DeckGL>
29+
}
30+
31+
export default App;

0 commit comments

Comments
 (0)