This commit is contained in:
Max Tobias Weber
2026-03-22 13:49:17 +01:00
commit 87d1670df4
20 changed files with 12729 additions and 0 deletions

14
.eslintrc.cjs Normal file
View File

@@ -0,0 +1,14 @@
module.exports = {
env: { browser: true, es2020: true, node: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': 'warn',
},
}

24
.gitignore vendored Normal file
View File

@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

11
Dockerfile Normal file
View File

@@ -0,0 +1,11 @@
FROM node:22 as node_builder
WORKDIR /usr/src/app
COPY . /usr/src/app
RUN yarn
RUN yarn build
FROM nginxinc/nginx-unprivileged:1.29
COPY --from=node_builder /usr/src/app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

51
README.md Normal file
View File

@@ -0,0 +1,51 @@
# FossGIS Workshop 2016
Dieses Repository enthält Beispiele, die im FossGIS Workshop "Open Source 3D-GIS im Browser: Einstieg in 3D Tiles mit deck.gl und MapComponents" verwendet werden.
## Einrichtung
Für die Einrichtung des Repositories wurden folgende Befehle ausgeführt:
```bash
npm create mapcomponents-app fossgis-workshop-2016-3dtiles
cd fossgis-workshop-2016-3dtiles
```
Anschließend wurde mit `npm` das deck.gl-Package installiert:
```bash
npm i @mapcomponents/deck-gl
```
In der Datei `src/main.tsx` wurde der DeckGlContextProvider, als Kinder des MapComponentsProvider, hinzugefügt:
```tsx
<MapComponentsProvider>
<DeckGlContextProvider>
<App />
</DeckGlContextProvider>
</MapComponentsProvider>
```
# So verwendest du dieses Repository
Dieses Repository basiert auf dem vite ts-react Template und fügt alle
erforderlichen Basiskomponenten für eine MapComponents-Anwendung hinzu.
## Pakete installieren
```bash
npm i
```
## Entwicklungsserver starten
```bash
npm run dev
```
## Für Produktion bauen
```bash
npm run build
```

16
index.html Normal file
View File

@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="manifest" href="/manifest.json">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/png" sizes="196x196" href="favicon-196.png">
<link rel="apple-touch-icon" href="apple-icon-180.png">
<meta name="apple-mobile-web-app-capable" content="yes">
<title>MapComponents + Vite + React + TS</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>

12463
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

30
package.json Normal file
View File

@@ -0,0 +1,30 @@
{
"name": "app_title",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
"dependencies": {
"@mapcomponents/deck-gl": "^1.8.9",
"@mapcomponents/react-maplibre": "^1.8.5",
"react": "^19.2.4",
"react-dom": "^19.2.4"
},
"devDependencies": {
"@types/react": "^19.2.11",
"@types/react-dom": "^19.2.3",
"@typescript-eslint/eslint-plugin": "^8.54.0",
"@typescript-eslint/parser": "^8.54.0",
"@vitejs/plugin-react": "^5.1.3",
"eslint": "^9.39.2",
"eslint-plugin-react-hooks": "^7.0.1",
"eslint-plugin-react-refresh": "^0.5.0",
"typescript": "^5.9.3",
"vite": "^7.3.1"
}
}

BIN
public/apple-icon-180.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
public/favicon-196.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

39
public/manifest.json Normal file
View File

@@ -0,0 +1,39 @@
{
"short_name": "MapComponents app",
"name": "MapComponents + TypeScript + React App",
"icons": [
{
"src": "manifest-icon-192.maskable.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "any"
},
{
"src": "manifest-icon-192.maskable.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "manifest-icon-512.maskable.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "any"
},
{
"src": "manifest-icon-512.maskable.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}

0
src/App.css Normal file
View File

18
src/App.tsx Normal file
View File

@@ -0,0 +1,18 @@
import "./App.css";
import { MapLibreMap } from "@mapcomponents/react-maplibre";
function App() {
return (
<>
<MapLibreMap
options={{
style: "https://wms.wheregroup.com/tileserver/style/osm-bright.json",
zoom: 4,
}}
style={{ position: "absolute", top: 0, bottom: 0, left: 0, right: 0 }}
/>
</>
);
}
export default App;

3
src/index.css Normal file
View File

@@ -0,0 +1,3 @@
body {
padding: 0;
}

16
src/main.tsx Normal file
View File

@@ -0,0 +1,16 @@
import React from "react";
import ReactDOM from "react-dom/client";
import { MapComponentsProvider } from "@mapcomponents/react-maplibre";
import App from "./App";
import "./index.css";
import { DeckGlContextProvider } from "@mapcomponents/deck-gl";
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
<React.StrictMode>
<MapComponentsProvider>
<DeckGlContextProvider>
<App />
</DeckGlContextProvider>
</MapComponentsProvider>
</React.StrictMode>,
);

1
src/vite-env.d.ts vendored Normal file
View File

@@ -0,0 +1 @@
/// <reference types="vite/client" />

26
tsconfig.json Normal file
View File

@@ -0,0 +1,26 @@
{
"compilerOptions": {
"target": "ES2023",
"useDefineForClassFields": true,
"lib": ["ES2023", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,
"noImplicitAny": false,
/* Bundler mode */
"moduleResolution": "node",
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
},
"include": ["src"],
"references": [{ "path": "./tsconfig.node.json" }]
}

10
tsconfig.node.json Normal file
View File

@@ -0,0 +1,10 @@
{
"compilerOptions": {
"composite": true,
"skipLibCheck": true,
"module": "ESNext",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true
},
"include": ["vite.config.ts"]
}

7
vite.config.ts Normal file
View File

@@ -0,0 +1,7 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
})