react-three-map 0.2.1 → 0.3.0
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/CHANGELOG.md +6 -0
- package/README.md +14 -13
- package/dist/cjs/main.js.js +1 -1318
- package/dist/es/main.js2.mjs +24 -20
- package/dist/es/main.js2.mjs.map +1 -1
- package/dist/es/main.js3.mjs.map +1 -1
- package/dist/es/main.js4.mjs +12 -24
- package/dist/es/main.js4.mjs.map +1 -1
- package/dist/es/main.js5.mjs +55 -23532
- package/dist/es/main.js5.mjs.map +1 -1
- package/dist/es/main.js6.mjs +13 -2
- package/dist/es/main.js6.mjs.map +1 -1
- package/dist/es/main.js7.mjs +53 -2
- package/dist/es/main.js7.mjs.map +1 -1
- package/dist/es/main.js8.mjs +6 -57
- package/dist/es/main.js8.mjs.map +1 -1
- package/dist/maplibre/cjs/main.js.js +1 -1
- package/dist/maplibre/es/main.js2.mjs +24 -20
- package/dist/maplibre/es/main.js2.mjs.map +1 -1
- package/dist/maplibre/es/main.js3.mjs.map +1 -1
- package/dist/maplibre/es/main.js4.mjs +12 -24
- package/dist/maplibre/es/main.js4.mjs.map +1 -1
- package/dist/maplibre/es/main.js5.mjs.map +1 -1
- package/dist/maplibre/es/main.js6.mjs.map +1 -1
- package/dist/maplibre/es/main.js7.mjs.map +1 -1
- package/dist/maplibre/es/main.js8.mjs.map +1 -1
- package/example-mapbox/package.json +29 -0
- package/example-mapbox/sandbox.config.json +3 -0
- package/example-mapbox/src/canvas.basic.stories.tsx +69 -0
- package/example-mapbox/src/comparison.stories.tsx +24 -0
- package/example-mapbox/src/html-on-top.stories.tsx +24 -0
- package/example-mapbox/src/my-scene.tsx +96 -0
- package/example-mapbox/src/render-on-demand.stories.tsx +32 -0
- package/example-mapbox/src/story-map.tsx +46 -0
- package/example-mapbox/src/vite-env.d.ts +1 -0
- package/example-mapbox/tsconfig.json +27 -0
- package/example-mapbox/tsconfig.node.json +10 -0
- package/example-mapbox/yarn.lock +4154 -0
- package/example-maplibre/package.json +29 -0
- package/example-maplibre/sandbox.config.json +3 -0
- package/example-maplibre/src/canvas.basic.stories.tsx +61 -0
- package/example-maplibre/src/comparison.stories.tsx +22 -0
- package/example-maplibre/src/html-on-top.stories.tsx +24 -0
- package/example-maplibre/src/my-scene.tsx +97 -0
- package/example-maplibre/src/render-on-demand.stories.tsx +32 -0
- package/example-maplibre/src/story-map.tsx +38 -0
- package/example-maplibre/src/vite-env.d.ts +1 -0
- package/example-maplibre/tsconfig.json +25 -0
- package/example-maplibre/tsconfig.node.json +10 -0
- package/example-maplibre/yarn.lock +4181 -0
- package/maplibre/package.json +1 -1
- package/package.json +9 -6
- package/src/{canvas/core → core}/generic-map.ts +15 -2
- package/src/{canvas/core → core}/state-ref.ts +2 -2
- package/src/{canvas/core/internal-canvas.tsx → core/use-canvas.tsx} +6 -18
- package/src/{canvas/core → core}/use-on-add.ts +3 -3
- package/src/{canvas/canvas-mapbox.tsx → mapbox/canvas.tsx} +15 -9
- package/src/mapbox/index.ts +1 -0
- package/src/{canvas/canvas-maplibre.tsx → maplibre/canvas.tsx} +13 -7
- package/src/maplibre/index.ts +1 -0
- package/src/stories/comparison.stories.tsx +13 -30
- package/src/stories/html-on-top.stories.tsx +11 -16
- package/src/stories/mapbox/story-mapbox.tsx +43 -0
- package/src/stories/mapbox-example.stories.tsx +69 -0
- package/src/stories/maplibre/story-maplibre.tsx +32 -0
- package/src/stories/{canvas.basic.stories.tsx → maplibre-example.stories.tsx} +28 -30
- package/src/stories/my-scene.tsx +0 -1
- package/src/stories/render-on-demand.stories.tsx +18 -37
- package/src/stories/story-map.tsx +26 -24
- package/tsconfig.json +5 -0
- package/dist/es/main.js10.mjs +0 -56
- package/dist/es/main.js10.mjs.map +0 -1
- package/dist/es/main.js11.mjs +0 -9
- package/dist/es/main.js11.mjs.map +0 -1
- package/dist/es/main.js9.mjs +0 -16
- package/dist/es/main.js9.mjs.map +0 -1
- package/src/main-mapbox.ts +0 -1
- package/src/main-maplibre.ts +0 -1
- /package/src/{canvas/core → core}/coords-to-matrix.ts +0 -0
- /package/src/{canvas/core → core}/create-events.ts +0 -0
- /package/src/{canvas/core → core}/generic-map.test.ts +0 -0
- /package/src/{canvas/core → core}/use-function.ts +0 -0
- /package/src/{canvas/core → core}/use-render.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# react-three-map
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- f3155c6: Upgrade to `react-map-gl@7.1.0`, which changes how to use Maplibre. Find more in their [changelog](https://github.com/visgl/react-map-gl/releases/tag/v7.1.0).
|
|
8
|
+
|
|
3
9
|
## 0.2.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://npmjs.com/package/@react-three/fiber)
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
⚠️ **Alpha Warning: This library is currently in its alpha phase. While functional, it's still under active development and may have bugs. Please use with caution in production and feel free to report any issues you encounter. Thank you for your understanding!**
|
|
7
|
-
|
|
8
5
|
`react-three-map` is a bridge to use [`react-three-fiber`](https://github.com/pmndrs/react-three-fiber) inside [`react-map-gl`](https://github.com/visgl/react-map-gl).
|
|
9
6
|
|
|
10
7
|
Until now you had:
|
|
@@ -20,9 +17,11 @@ Now with `react-three-map`, you can use them together :fist_right::fist_left:.
|
|
|
20
17
|
npm install react-three-map
|
|
21
18
|
```
|
|
22
19
|
|
|
23
|
-
|
|
20
|
+
## :book: Examples
|
|
24
21
|
|
|
25
|
-
|
|
22
|
+
You can check our examples here [here](https://rodrigohamuy.github.io/react-three-map) (powered by [Ladle](https://ladle.dev/)).
|
|
23
|
+
|
|
24
|
+
## :mag: What does it look like?
|
|
26
25
|
|
|
27
26
|
|
|
28
27
|
<table>
|
|
@@ -77,7 +76,7 @@ function BasicExample() {
|
|
|
77
76
|
}
|
|
78
77
|
```
|
|
79
78
|
|
|
80
|
-
|
|
79
|
+
## :thinking: Why we build this?
|
|
81
80
|
|
|
82
81
|
Look [how complex](https://maplibre.org/maplibre-gl-js-docs/example/add-3d-model/) is to add just one ThreeJS object to a map.
|
|
83
82
|
|
|
@@ -85,7 +84,7 @@ Look [how complex](https://docs.pmnd.rs/react-three-fiber/api/canvas#createroot)
|
|
|
85
84
|
|
|
86
85
|
You can now replace all that complexity and hundreds of lines of code with the `<Canvas>` component exported by `react-three-map`, which includes a tone of extra features and seamless integration, supporting pointer events, raycasting, and much more, all out of the box.
|
|
87
86
|
|
|
88
|
-
## API
|
|
87
|
+
## :gear: API
|
|
89
88
|
|
|
90
89
|
### Canvas
|
|
91
90
|
|
|
@@ -116,17 +115,19 @@ It shares most of the props from R3F `<Canvas>`, so you can check them directly
|
|
|
116
115
|
|
|
117
116
|
#### Render Props
|
|
118
117
|
|
|
119
|
-
| PROP | DESCRIPTION | DEFAULT
|
|
120
|
-
| --------- | ------------------------------------------------ |
|
|
121
|
-
| latitude | The latitude coordinate where to add the scene. |
|
|
122
|
-
| longitude | The longitude coordinate where to add the scene. |
|
|
123
|
-
| altitude | The altitude coordinate where to add the scene. | `0`
|
|
124
|
-
| frameloop | Render mode: always
|
|
118
|
+
| PROP | DESCRIPTION | DEFAULT |
|
|
119
|
+
| --------- | ------------------------------------------------ | ---------- |
|
|
120
|
+
| latitude | The latitude coordinate where to add the scene. | |
|
|
121
|
+
| longitude | The longitude coordinate where to add the scene. | |
|
|
122
|
+
| altitude | The altitude coordinate where to add the scene. | `0` |
|
|
123
|
+
| frameloop | Render mode: `"always"`, `"demand"`. | `"always"` |
|
|
125
124
|
|
|
126
125
|
#### Render Props removed from `@react-three/fiber`
|
|
127
126
|
|
|
128
127
|
Because the scene now lives in a map, we leave a lot of the render and camera control to the map, rather than to R3F.
|
|
129
128
|
|
|
129
|
+
Therefore, the following `<Canvas>` props are ignored:
|
|
130
|
+
|
|
130
131
|
- gl
|
|
131
132
|
- camera
|
|
132
133
|
- resize
|