Skip to content

Commit 9dfe4f6

Browse files
authored
Remove turf dependency and avoid parallel rendering in overlay mode (#90)
1 parent 047860f commit 9dfe4f6

35 files changed

+4547
-3999
lines changed

.changeset/chatty-snails-call.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-three-map": patch
3+
---
4+
5+
Remove `turf` dependency.

.changeset/nine-beans-love.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-three-map": patch
3+
---
4+
5+
Map to wait for r3f to finish rendering before the next render in overlay mode.

.codesandbox/ci.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"sandboxes": ["/example-mapbox", "/example-maplibre", "/stories"],
3-
"node": "16"
3+
"node": "18"
44
}

.github/workflows/build.yml

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,10 @@ jobs:
1212
runs-on: ubuntu-latest
1313
timeout-minutes: 10
1414
steps:
15-
- name: Checkout Repo
16-
uses: actions/checkout@v3
17-
18-
- name: Setup Node.js 16.x
19-
uses: actions/setup-node@v3
15+
- uses: actions/checkout@v3
16+
- uses: actions/setup-node@v3
2017
with:
21-
node-version: 16.x
22-
23-
- name: Install Dependencies
24-
run: yarn install --frozen-lockfile
25-
26-
- name: TS Check
27-
run: yarn ts:check
28-
29-
- name: Build
30-
run: yarn build
18+
node-version-file: '.nvmrc'
19+
- run: yarn install --frozen-lockfile
20+
- run: yarn ts:check
21+
- run: yarn build

.github/workflows/coverage.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,12 @@ jobs:
1717
issues: write # to post issue comments (changesets/action)
1818
pull-requests: write # to create pull request (changesets/action)
1919
steps:
20-
- name: Checkout Repo
21-
uses: actions/checkout@v3
22-
23-
- name: Setup Node.js 16.x
24-
uses: actions/setup-node@v3
20+
- uses: actions/checkout@v3
21+
- uses: actions/setup-node@v3
2522
with:
26-
node-version: 16.x
27-
28-
- name: Install Dependencies
29-
run: yarn install --frozen-lockfile
30-
31-
- name: Create Release Pull Request or Publish to npm
32-
id: changesets
23+
node-version-file: '.nvmrc'
24+
- run: yarn install --frozen-lockfile
25+
- id: changesets
3326
uses: changesets/action@v1
3427
with:
3528
publish: yarn release

.github/workflows/static.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ jobs:
3030
- uses: actions/checkout@v3
3131
- uses: actions/setup-node@v3
3232
with:
33-
node-version: "18.16.0"
34-
registry-url: "https://registry.npmjs.org"
33+
node-version-file: '.nvmrc'
3534
- run: yarn install --frozen-lockfile
3635
- run: yarn build:stories
3736
- uses: actions/configure-pages@v3

.github/workflows/test.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,9 @@ jobs:
1212
runs-on: ubuntu-latest
1313
timeout-minutes: 10
1414
steps:
15-
- name: Checkout Repo
16-
uses: actions/checkout@v3
17-
18-
- name: Setup Node.js 16.x
19-
uses: actions/setup-node@v3
15+
- uses: actions/checkout@v3
16+
- uses: actions/setup-node@v3
2017
with:
21-
node-version: 16.x
22-
23-
- name: Install Dependencies
24-
run: yarn install --frozen-lockfile
25-
26-
- name: Test
27-
run: yarn test
18+
node-version-file: '.nvmrc'
19+
- run: yarn install --frozen-lockfile
20+
- run: yarn test

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20.11.1

README.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,24 @@ This utility function converts geographic coordinates into a `Vector3Tuple`, whi
211211
Similar to `NearCoordinates` it has a relatively good precision at city distances, but is not recommended if your distances are too big.
212212

213213

214-
| Parameter | Description |
215-
| -------------- | ----------------------------------------------------------------- |
214+
| Parameter | Description |
215+
| ---------------- | --------------------------------------------------------------- |
216216
| `point: Coords` | The geographic coordinates of the point to convert. |
217217
| `origin: Coords` | The geographic coordinates used as the origin for calculations. |
218218

219-
Returns a `Vector3Tuple` representing the 3D position of the point relative to the origin.
219+
Returns a `Vector3Tuple` representing the 3D position of the point relative to the origin.
220+
221+
### vector3ToCoords
222+
223+
[![](https://img.shields.io/badge/-demo-%23ff69b4)](https://rodrigohamuy.github.io/react-three-map/?story=pivot-controls--default)
224+
225+
This utility function converts a `Vector3Tuple`, which represents a 3D vector in meters, back into geographic coordinates.
226+
227+
It is the inverse of `coordsToVector3` and maintains the same level of precision. It is not recommended for use with very large distances.
228+
229+
| Parameter | Description |
230+
| ------------------------ | --------------------------------------------------------------- |
231+
| `position: Vector3Tuple` | The 3D vector to convert back into geographic coordinates. |
232+
| `origin: Coords` | The geographic coordinates used as the origin for calculations. |
233+
234+
Returns a `Coords` object representing the geographic coordinates of the point relative to the origin.

0 commit comments

Comments
 (0)