@trapar-waves/react-three-maplibre 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,29 +1,107 @@
1
- # Rsbuild Project
1
+ # @trapar-waves/react-three-maplibre
2
2
 
3
- ## Setup
3
+ ![npm version](https://img.shields.io/npm/v/@trapar-waves/react-three-maplibre)
4
+ ![npm dm](https://img.shields.io/npm/dm/@trapar-waves/react-three-maplibre)
5
+ ![License](https://img.shields.io/badge/license-MIT-green)
6
+ ![GitHub last commit](https://img.shields.io/github/last-commit/trapar-waves/react-three-maplibre)
7
+ > A React-based project integrating Three.js and MapLibre for advanced geospatial visualization.
4
8
 
5
- Install the dependencies:
9
+ ## Features
6
10
 
7
- ```bash
8
- pnpm install
9
- ```
11
+ * **3D Geospatial Visualization:** Combines [Three.js](https://threejs.org/) with [MapLibre](https://maplibre.org/) to enable highly interactive and visually rich 3D maps.
12
+ * **React Integration:** Built using [@react-three/fiber](https://github.com/pmndrs/react-three-fiber) and [@react-three/drei](https://github.com/pmndrs/drei) for seamless integration of Three.js within a React environment.
13
+ * **Advanced Mapping Capabilities:** Leverages [@antv/l7](https://l7.antv.vision/en-US) and [@antv/l7-maps](https://l7.antv.vision/en-US) for data-driven geospatial visualizations like heatmaps, choropleth maps, and more.
14
+ * **Utility-First Styling:** Employs [Tailwind CSS](https://tailwindcss.com/) for flexible and rapid styling customization.
15
+ * **Type Safety:** Utilizes TypeScript across the project (via `@types/react`, `@types/three`, etc.) to ensure type safety and improve code reliability.
16
+ * **Fast Development Workflow:** Uses [Rsbuild](https://rsbuild.dev/) as the build tool for optimized builds and fast development cycles with features like HMR (Hot Module Replacement).
17
+ * **Iconography Support:** Integrates [@iconify/tailwind4](https://iconify.design/) for scalable and customizable SVG icons.
18
+ * **Code Quality Focus:** Includes ESLint configurations via [@antfu/eslint-config](https://github.com/antfu/eslint-config) to maintain high code quality standards.
19
+ * **Customizable Maps:** Supports [react-map-gl](https://visgl.github.io/react-map-gl/) for creating interactive and customizable map experiences.
20
+ * **Rich 3D Ecosystem:** Likely includes additional Three.js utilities from [three-stdlib](https://github.com/pmndrs/three-stdlib), offering pre-built helpers and components for common 3D tasks.
10
21
 
11
- ## Get Started
22
+ ## 🚀 Getting Started
12
23
 
13
- Start the dev server:
24
+ Follow these instructions to get the project running locally.
14
25
 
15
- ```bash
16
- pnpm dev
17
- ```
26
+ ### Prerequisites
18
27
 
19
- Build the app for production:
28
+ * Ensure you have the following installed:
29
+ * Node.js (>= 18.x recommended)
30
+ * Package manager (`npm`, `yarn`, or `pnpm`)
31
+ ```bash
32
+ node -v
33
+ npm -v # or yarn -v or pnpm -v
34
+ ```
20
35
 
21
- ```bash
22
- pnpm build
23
- ```
36
+ ### Installation
24
37
 
25
- Preview the production build locally:
38
+ 1. Clone the repository:
39
+ ```bash
40
+ git clone https://github.com/Trapar-waves/react-three-maplibre.git
41
+ cd react-three-maplibre
42
+ ```
43
+ 2. Install dependencies:
44
+ ```bash
45
+ # Use your preferred package manager
46
+ npm install
47
+ # or
48
+ yarn install
49
+ # or
50
+ pnpm install
51
+ ```
26
52
 
53
+ ## 🛠️ Usage
54
+
55
+ ### Available Scripts
56
+
57
+ Common scripts available via `npm run <script>`, `yarn <script>`, or `pnpm <script>`:
58
+
59
+ * `dev`: Starts the development server with automatic browser opening.
60
+ * `build`: Creates a production-ready build.
61
+ * `preview`: Serves the production build locally for testing purposes.
62
+
63
+ Example:
27
64
  ```bash
28
- pnpm preview
65
+ # Start development server
66
+ npm run dev
67
+
68
+ # Create production build
69
+ npm run build
70
+
71
+ # Preview production build
72
+ npm run preview
29
73
  ```
74
+
75
+ ## 💻 Tech Stack
76
+
77
+ Key technologies used in this project include:
78
+
79
+ * **Framework/Library:** React (with [@react-three/fiber](https://github.com/pmndrs/react-three-fiber) for Three.js integration)
80
+ * **UI Toolkit/Styling:** Tailwind CSS
81
+ * **Mapping Libraries:** [@antv/l7](https://l7.antv.vision/en-US), [MapLibre](https://maplibre.org/)
82
+ * **3D Rendering:** Three.js (enhanced by [@react-three/drei](https://github.com/pmndrs/drei) and [three-stdlib](https://github.com/pmndrs/three-stdlib))
83
+ * **Build Tool:** Rsbuild
84
+ * **Language:** TypeScript
85
+ * **Iconography:** Iconify
86
+
87
+ See the [package.json](package.json) for a full list of dependencies.
88
+
89
+ ## 🤝 Contributing
90
+
91
+ Contributions are welcome!
92
+
93
+ ## 📄 License
94
+
95
+ Distributed under the **MIT** License. See `LICENSE` file for more information.
96
+
97
+ ## 👤 Author
98
+
99
+ * **Rikka**
100
+ * Email: [admin@rikka.cc](mailto:admin@rikka.cc)
101
+ * GitHub: [@Muromi-Rikka](https://github.com/Muromi-Rikka)
102
+
103
+ ## 🔗 Links
104
+
105
+ * **Repository:** [https://github.com/Trapar-waves/react-three-maplibre](https://github.com/Trapar-waves/react-three-maplibre)
106
+ * **Homepage:** [https://github.com/Trapar-waves/react-three-maplibre](https://github.com/Trapar-waves/react-three-maplibre)
107
+ * **Issues:** [https://github.com/Trapar-waves/react-three-maplibre/issues](https://github.com/Trapar-waves/react-three-maplibre/issues)
@@ -0,0 +1 @@
1
+ PUBLIC_MAPTILER_KEY="set your key"
package/package.json CHANGED
@@ -1,7 +1,27 @@
1
1
  {
2
2
  "name": "@trapar-waves/react-three-maplibre",
3
3
  "type": "module",
4
- "version": "1.0.0",
4
+ "version": "1.0.2",
5
+ "author": {
6
+ "email": "admin@rikka.cc",
7
+ "name": "Rikka",
8
+ "url": "https://github.com/Muromi-Rikka"
9
+ },
10
+ "homepage": "https://github.com/Trapar-waves/react-three-maplibre",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/Trapar-waves/react-three-maplibre.git"
14
+ },
15
+ "bugs": {
16
+ "url": "https://github.com/Trapar-waves/react-three-maplibre/issues"
17
+ },
18
+ "keywords": [
19
+ "react",
20
+ "antv",
21
+ "maplibre",
22
+ "three",
23
+ "r3f"
24
+ ],
5
25
  "publishConfig": {
6
26
  "access": "public"
7
27
  },
@@ -18,20 +38,20 @@
18
38
  "maplibre-gl": "4.7.1",
19
39
  "react": "^19.1.0",
20
40
  "react-dom": "^19.1.0",
21
- "react-map-gl": "^8.0.2",
41
+ "react-map-gl": "^8.0.3",
22
42
  "react-three-map": "1.0.0-next.2",
23
43
  "three": "^0.175.0",
24
44
  "three-stdlib": "^2.35.15"
25
45
  },
26
46
  "devDependencies": {
27
- "@antfu/eslint-config": "^4.11.0",
28
- "@iconify/json": "^2.2.323",
47
+ "@antfu/eslint-config": "^4.12.0",
48
+ "@iconify/json": "^2.2.326",
29
49
  "@iconify/tailwind4": "^1.0.6",
30
- "@rsbuild/core": "^1.3.4",
31
- "@rsbuild/plugin-react": "^1.1.1",
50
+ "@rsbuild/core": "^1.3.6",
51
+ "@rsbuild/plugin-react": "^1.2.0",
32
52
  "@tailwindcss/postcss": "^4.1.3",
33
- "@types/react": "^19.1.0",
34
- "@types/react-dom": "^19.1.1",
53
+ "@types/react": "^19.1.1",
54
+ "@types/react-dom": "^19.1.2",
35
55
  "@types/three": "^0.175.0",
36
56
  "eslint": "^9.24.0",
37
57
  "mapbox-gl": "^3.11.0",
package/rsbuild.config.ts CHANGED
@@ -1,14 +1,19 @@
1
- import { defineConfig } from '@rsbuild/core';
2
- import { pluginReact } from '@rsbuild/plugin-react';
1
+ import { defineConfig, loadEnv } from "@rsbuild/core";
2
+ import { pluginReact } from "@rsbuild/plugin-react";
3
3
  import tailwind from "@tailwindcss/postcss";
4
4
 
5
+ const { publicVars } = loadEnv({ cwd: "./environments" });
6
+
5
7
  export default defineConfig({
6
8
  plugins: [pluginReact()],
7
- tools:{
8
- postcss:{
9
- postcssOptions:{
10
- plugins:[tailwind]
11
- }
12
- }
13
- }
9
+ source: {
10
+ define: publicVars,
11
+ },
12
+ tools: {
13
+ postcss: {
14
+ postcssOptions: {
15
+ plugins: [tailwind],
16
+ },
17
+ },
18
+ },
14
19
  });
package/src/App.tsx CHANGED
@@ -23,6 +23,7 @@ const latLon = {
23
23
  latitude: 31.215175,
24
24
  longitude: 121.417463,
25
25
  };
26
+ const MAPTILER_KEY = import.meta.env.PUBLIC_MAPTILER_KEY;
26
27
 
27
28
  function App() {
28
29
  const ref = useRef<HTMLDivElement>(null!);
@@ -67,7 +68,7 @@ function App() {
67
68
  zoom: 11,
68
69
  pitch: 64.88,
69
70
  }}
70
- mapStyle="https://api.maptiler.com/maps/streets/style.json?key=YbCPLULzWdf1NplssEIc"
71
+ mapStyle={`https://api.maptiler.com/maps/streets/style.json?key=${MAPTILER_KEY}`}
71
72
  onLoad={initL7}
72
73
  >
73
74
  <Stats className="stats" parent={ref} />
package/src/global.css CHANGED
@@ -1,4 +1,5 @@
1
1
  @import 'tailwindcss';
2
+ @import "maplibre-gl/dist/maplibre-gl.css";
2
3
  @plugin "@iconify/tailwind4";
3
4
  .l7-scene{
4
5
  top: 0;
package/tsconfig.json CHANGED
@@ -1,23 +1,23 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "lib": ["DOM", "ES2020"],
4
- "jsx": "react-jsx",
5
3
  "target": "ES2020",
6
- "noEmit": true,
7
- "skipLibCheck": true,
4
+ "jsx": "react-jsx",
5
+ "lib": ["DOM", "ES2020"],
8
6
  "useDefineForClassFields": true,
9
7
 
10
8
  /* modules */
11
9
  "module": "ESNext",
12
- "isolatedModules": true,
13
- "resolveJsonModule": true,
14
10
  "moduleResolution": "Bundler",
11
+ "resolveJsonModule": true,
15
12
  "allowImportingTsExtensions": true,
16
13
 
17
14
  /* type checking */
18
15
  "strict": true,
19
16
  "noUnusedLocals": true,
20
- "noUnusedParameters": true
17
+ "noUnusedParameters": true,
18
+ "noEmit": true,
19
+ "isolatedModules": true,
20
+ "skipLibCheck": true
21
21
  },
22
22
  "include": ["src"]
23
23
  }