@maplibre/maplibre-react-native 10.0.0-alpha.6 → 10.0.0-alpha.7
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/.eslintrc.js +3 -1
- package/.yarn/sdks/eslint/bin/eslint.js +8 -1
- package/.yarn/sdks/eslint/lib/api.js +8 -1
- package/.yarn/sdks/eslint/lib/unsupported-api.js +8 -1
- package/.yarn/sdks/prettier/bin/prettier.cjs +8 -1
- package/.yarn/sdks/prettier/index.cjs +8 -1
- package/.yarn/sdks/typescript/bin/tsc +8 -1
- package/.yarn/sdks/typescript/bin/tsserver +8 -1
- package/.yarn/sdks/typescript/lib/tsc.js +8 -1
- package/.yarn/sdks/typescript/lib/tsserver.js +20 -6
- package/.yarn/sdks/typescript/lib/tsserverlibrary.js +20 -6
- package/.yarn/sdks/typescript/lib/typescript.js +8 -1
- package/CHANGELOG.md +4 -0
- package/CONTRIBUTING.md +10 -9
- package/docs/Camera.md +3 -3
- package/docs/MapView.md +9 -33
- package/docs/UserLocation.md +10 -2
- package/docs/docs.json +16 -31
- package/javascript/Maplibre.ts +5 -1
- package/javascript/components/BackgroundLayer.tsx +27 -20
- package/javascript/components/Callout.tsx +40 -40
- package/javascript/components/Camera.tsx +421 -478
- package/javascript/components/CircleLayer.tsx +29 -22
- package/javascript/components/FillExtrusionLayer.tsx +23 -23
- package/javascript/components/FillLayer.tsx +22 -19
- package/javascript/components/HeatmapLayer.tsx +21 -19
- package/javascript/components/ImageSource.tsx +25 -32
- package/javascript/components/Images.tsx +36 -35
- package/javascript/components/Light.tsx +20 -47
- package/javascript/components/LineLayer.tsx +23 -20
- package/javascript/components/MapView.tsx +604 -554
- package/javascript/components/MarkerView.tsx +23 -38
- package/javascript/components/NativeUserLocation.tsx +3 -5
- package/javascript/components/PointAnnotation.tsx +111 -87
- package/javascript/components/RasterLayer.tsx +21 -18
- package/javascript/components/RasterSource.tsx +39 -42
- package/javascript/components/ShapeSource.tsx +287 -239
- package/javascript/components/Style.tsx +1 -1
- package/javascript/components/SymbolLayer.tsx +34 -28
- package/javascript/components/UserLocation.tsx +164 -151
- package/javascript/components/VectorSource.tsx +128 -117
- package/javascript/components/annotations/Annotation.tsx +105 -79
- package/javascript/{components/AbstractLayer.tsx → hooks/useAbstractLayer.ts} +54 -37
- package/javascript/hooks/useAbstractSource.ts +34 -0
- package/javascript/hooks/useNativeBridge.ts +125 -0
- package/javascript/hooks/useNativeRef.ts +13 -0
- package/javascript/hooks/useOnce.ts +12 -0
- package/javascript/utils/Logger.ts +3 -3
- package/package.json +2 -1
- package/javascript/components/AbstractSource.tsx +0 -27
- package/javascript/components/NativeBridgeComponent.tsx +0 -117
package/.eslintrc.js
CHANGED
|
@@ -159,8 +159,10 @@ module.exports = {
|
|
|
159
159
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
160
160
|
'no-unused-vars': 'off',
|
|
161
161
|
'no-use-before-define': 'off',
|
|
162
|
-
'@typescript-eslint/no-use-before-define':
|
|
162
|
+
'@typescript-eslint/no-use-before-define': 'off',
|
|
163
163
|
'react/prop-types': 'off',
|
|
164
|
+
'react-hooks/rules-of-hooks': 'error',
|
|
165
|
+
'react-hooks/exhaustive-deps': 'warn',
|
|
164
166
|
},
|
|
165
167
|
},
|
|
166
168
|
],
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const {existsSync} = require(`fs`);
|
|
4
|
-
const {createRequire} = require(`module`);
|
|
4
|
+
const {createRequire, register} = require(`module`);
|
|
5
5
|
const {resolve} = require(`path`);
|
|
6
|
+
const {pathToFileURL} = require(`url`);
|
|
6
7
|
|
|
7
8
|
const relPnpApiPath = "../../../../.pnp.cjs";
|
|
8
9
|
|
|
9
10
|
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
|
10
11
|
const absRequire = createRequire(absPnpApiPath);
|
|
11
12
|
|
|
13
|
+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
|
|
14
|
+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
|
15
|
+
|
|
12
16
|
if (existsSync(absPnpApiPath)) {
|
|
13
17
|
if (!process.versions.pnp) {
|
|
14
18
|
// Setup the environment to be able to require eslint/bin/eslint.js
|
|
15
19
|
require(absPnpApiPath).setup();
|
|
20
|
+
if (isPnpLoaderEnabled && register) {
|
|
21
|
+
register(pathToFileURL(absPnpLoaderPath));
|
|
22
|
+
}
|
|
16
23
|
}
|
|
17
24
|
}
|
|
18
25
|
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const {existsSync} = require(`fs`);
|
|
4
|
-
const {createRequire} = require(`module`);
|
|
4
|
+
const {createRequire, register} = require(`module`);
|
|
5
5
|
const {resolve} = require(`path`);
|
|
6
|
+
const {pathToFileURL} = require(`url`);
|
|
6
7
|
|
|
7
8
|
const relPnpApiPath = "../../../../.pnp.cjs";
|
|
8
9
|
|
|
9
10
|
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
|
10
11
|
const absRequire = createRequire(absPnpApiPath);
|
|
11
12
|
|
|
13
|
+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
|
|
14
|
+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
|
15
|
+
|
|
12
16
|
if (existsSync(absPnpApiPath)) {
|
|
13
17
|
if (!process.versions.pnp) {
|
|
14
18
|
// Setup the environment to be able to require eslint
|
|
15
19
|
require(absPnpApiPath).setup();
|
|
20
|
+
if (isPnpLoaderEnabled && register) {
|
|
21
|
+
register(pathToFileURL(absPnpLoaderPath));
|
|
22
|
+
}
|
|
16
23
|
}
|
|
17
24
|
}
|
|
18
25
|
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const {existsSync} = require(`fs`);
|
|
4
|
-
const {createRequire} = require(`module`);
|
|
4
|
+
const {createRequire, register} = require(`module`);
|
|
5
5
|
const {resolve} = require(`path`);
|
|
6
|
+
const {pathToFileURL} = require(`url`);
|
|
6
7
|
|
|
7
8
|
const relPnpApiPath = "../../../../.pnp.cjs";
|
|
8
9
|
|
|
9
10
|
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
|
10
11
|
const absRequire = createRequire(absPnpApiPath);
|
|
11
12
|
|
|
13
|
+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
|
|
14
|
+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
|
15
|
+
|
|
12
16
|
if (existsSync(absPnpApiPath)) {
|
|
13
17
|
if (!process.versions.pnp) {
|
|
14
18
|
// Setup the environment to be able to require eslint/use-at-your-own-risk
|
|
15
19
|
require(absPnpApiPath).setup();
|
|
20
|
+
if (isPnpLoaderEnabled && register) {
|
|
21
|
+
register(pathToFileURL(absPnpLoaderPath));
|
|
22
|
+
}
|
|
16
23
|
}
|
|
17
24
|
}
|
|
18
25
|
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const {existsSync} = require(`fs`);
|
|
4
|
-
const {createRequire} = require(`module`);
|
|
4
|
+
const {createRequire, register} = require(`module`);
|
|
5
5
|
const {resolve} = require(`path`);
|
|
6
|
+
const {pathToFileURL} = require(`url`);
|
|
6
7
|
|
|
7
8
|
const relPnpApiPath = "../../../../.pnp.cjs";
|
|
8
9
|
|
|
9
10
|
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
|
10
11
|
const absRequire = createRequire(absPnpApiPath);
|
|
11
12
|
|
|
13
|
+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
|
|
14
|
+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
|
15
|
+
|
|
12
16
|
if (existsSync(absPnpApiPath)) {
|
|
13
17
|
if (!process.versions.pnp) {
|
|
14
18
|
// Setup the environment to be able to require prettier/bin/prettier.cjs
|
|
15
19
|
require(absPnpApiPath).setup();
|
|
20
|
+
if (isPnpLoaderEnabled && register) {
|
|
21
|
+
register(pathToFileURL(absPnpLoaderPath));
|
|
22
|
+
}
|
|
16
23
|
}
|
|
17
24
|
}
|
|
18
25
|
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const {existsSync} = require(`fs`);
|
|
4
|
-
const {createRequire} = require(`module`);
|
|
4
|
+
const {createRequire, register} = require(`module`);
|
|
5
5
|
const {resolve} = require(`path`);
|
|
6
|
+
const {pathToFileURL} = require(`url`);
|
|
6
7
|
|
|
7
8
|
const relPnpApiPath = "../../../.pnp.cjs";
|
|
8
9
|
|
|
9
10
|
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
|
10
11
|
const absRequire = createRequire(absPnpApiPath);
|
|
11
12
|
|
|
13
|
+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
|
|
14
|
+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
|
15
|
+
|
|
12
16
|
if (existsSync(absPnpApiPath)) {
|
|
13
17
|
if (!process.versions.pnp) {
|
|
14
18
|
// Setup the environment to be able to require prettier
|
|
15
19
|
require(absPnpApiPath).setup();
|
|
20
|
+
if (isPnpLoaderEnabled && register) {
|
|
21
|
+
register(pathToFileURL(absPnpLoaderPath));
|
|
22
|
+
}
|
|
16
23
|
}
|
|
17
24
|
}
|
|
18
25
|
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const {existsSync} = require(`fs`);
|
|
4
|
-
const {createRequire} = require(`module`);
|
|
4
|
+
const {createRequire, register} = require(`module`);
|
|
5
5
|
const {resolve} = require(`path`);
|
|
6
|
+
const {pathToFileURL} = require(`url`);
|
|
6
7
|
|
|
7
8
|
const relPnpApiPath = "../../../../.pnp.cjs";
|
|
8
9
|
|
|
9
10
|
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
|
10
11
|
const absRequire = createRequire(absPnpApiPath);
|
|
11
12
|
|
|
13
|
+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
|
|
14
|
+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
|
15
|
+
|
|
12
16
|
if (existsSync(absPnpApiPath)) {
|
|
13
17
|
if (!process.versions.pnp) {
|
|
14
18
|
// Setup the environment to be able to require typescript/bin/tsc
|
|
15
19
|
require(absPnpApiPath).setup();
|
|
20
|
+
if (isPnpLoaderEnabled && register) {
|
|
21
|
+
register(pathToFileURL(absPnpLoaderPath));
|
|
22
|
+
}
|
|
16
23
|
}
|
|
17
24
|
}
|
|
18
25
|
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const {existsSync} = require(`fs`);
|
|
4
|
-
const {createRequire} = require(`module`);
|
|
4
|
+
const {createRequire, register} = require(`module`);
|
|
5
5
|
const {resolve} = require(`path`);
|
|
6
|
+
const {pathToFileURL} = require(`url`);
|
|
6
7
|
|
|
7
8
|
const relPnpApiPath = "../../../../.pnp.cjs";
|
|
8
9
|
|
|
9
10
|
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
|
10
11
|
const absRequire = createRequire(absPnpApiPath);
|
|
11
12
|
|
|
13
|
+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
|
|
14
|
+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
|
15
|
+
|
|
12
16
|
if (existsSync(absPnpApiPath)) {
|
|
13
17
|
if (!process.versions.pnp) {
|
|
14
18
|
// Setup the environment to be able to require typescript/bin/tsserver
|
|
15
19
|
require(absPnpApiPath).setup();
|
|
20
|
+
if (isPnpLoaderEnabled && register) {
|
|
21
|
+
register(pathToFileURL(absPnpLoaderPath));
|
|
22
|
+
}
|
|
16
23
|
}
|
|
17
24
|
}
|
|
18
25
|
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const {existsSync} = require(`fs`);
|
|
4
|
-
const {createRequire} = require(`module`);
|
|
4
|
+
const {createRequire, register} = require(`module`);
|
|
5
5
|
const {resolve} = require(`path`);
|
|
6
|
+
const {pathToFileURL} = require(`url`);
|
|
6
7
|
|
|
7
8
|
const relPnpApiPath = "../../../../.pnp.cjs";
|
|
8
9
|
|
|
9
10
|
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
|
10
11
|
const absRequire = createRequire(absPnpApiPath);
|
|
11
12
|
|
|
13
|
+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
|
|
14
|
+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
|
15
|
+
|
|
12
16
|
if (existsSync(absPnpApiPath)) {
|
|
13
17
|
if (!process.versions.pnp) {
|
|
14
18
|
// Setup the environment to be able to require typescript/lib/tsc.js
|
|
15
19
|
require(absPnpApiPath).setup();
|
|
20
|
+
if (isPnpLoaderEnabled && register) {
|
|
21
|
+
register(pathToFileURL(absPnpLoaderPath));
|
|
22
|
+
}
|
|
16
23
|
}
|
|
17
24
|
}
|
|
18
25
|
|
|
@@ -1,14 +1,28 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const {existsSync} = require(`fs`);
|
|
4
|
-
const {createRequire} = require(`module`);
|
|
4
|
+
const {createRequire, register} = require(`module`);
|
|
5
5
|
const {resolve} = require(`path`);
|
|
6
|
+
const {pathToFileURL} = require(`url`);
|
|
6
7
|
|
|
7
8
|
const relPnpApiPath = "../../../../.pnp.cjs";
|
|
8
9
|
|
|
9
10
|
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
|
10
11
|
const absRequire = createRequire(absPnpApiPath);
|
|
11
12
|
|
|
13
|
+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
|
|
14
|
+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
|
15
|
+
|
|
16
|
+
if (existsSync(absPnpApiPath)) {
|
|
17
|
+
if (!process.versions.pnp) {
|
|
18
|
+
// Setup the environment to be able to require typescript/lib/tsserver.js
|
|
19
|
+
require(absPnpApiPath).setup();
|
|
20
|
+
if (isPnpLoaderEnabled && register) {
|
|
21
|
+
register(pathToFileURL(absPnpLoaderPath));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
12
26
|
const moduleWrapper = tsserver => {
|
|
13
27
|
if (!process.versions.pnp) {
|
|
14
28
|
return tsserver;
|
|
@@ -214,11 +228,11 @@ const moduleWrapper = tsserver => {
|
|
|
214
228
|
return tsserver;
|
|
215
229
|
};
|
|
216
230
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
231
|
+
const [major, minor] = absRequire(`typescript/package.json`).version.split(`.`, 2).map(value => parseInt(value, 10));
|
|
232
|
+
// In TypeScript@>=5.5 the tsserver uses the public TypeScript API so that needs to be patched as well.
|
|
233
|
+
// Ref https://github.com/microsoft/TypeScript/pull/55326
|
|
234
|
+
if (major > 5 || (major === 5 && minor >= 5)) {
|
|
235
|
+
moduleWrapper(absRequire(`typescript`));
|
|
222
236
|
}
|
|
223
237
|
|
|
224
238
|
// Defer to the real typescript/lib/tsserver.js your application uses
|
|
@@ -1,14 +1,28 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const {existsSync} = require(`fs`);
|
|
4
|
-
const {createRequire} = require(`module`);
|
|
4
|
+
const {createRequire, register} = require(`module`);
|
|
5
5
|
const {resolve} = require(`path`);
|
|
6
|
+
const {pathToFileURL} = require(`url`);
|
|
6
7
|
|
|
7
8
|
const relPnpApiPath = "../../../../.pnp.cjs";
|
|
8
9
|
|
|
9
10
|
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
|
10
11
|
const absRequire = createRequire(absPnpApiPath);
|
|
11
12
|
|
|
13
|
+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
|
|
14
|
+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
|
15
|
+
|
|
16
|
+
if (existsSync(absPnpApiPath)) {
|
|
17
|
+
if (!process.versions.pnp) {
|
|
18
|
+
// Setup the environment to be able to require typescript/lib/tsserverlibrary.js
|
|
19
|
+
require(absPnpApiPath).setup();
|
|
20
|
+
if (isPnpLoaderEnabled && register) {
|
|
21
|
+
register(pathToFileURL(absPnpLoaderPath));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
12
26
|
const moduleWrapper = tsserver => {
|
|
13
27
|
if (!process.versions.pnp) {
|
|
14
28
|
return tsserver;
|
|
@@ -214,11 +228,11 @@ const moduleWrapper = tsserver => {
|
|
|
214
228
|
return tsserver;
|
|
215
229
|
};
|
|
216
230
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
231
|
+
const [major, minor] = absRequire(`typescript/package.json`).version.split(`.`, 2).map(value => parseInt(value, 10));
|
|
232
|
+
// In TypeScript@>=5.5 the tsserver uses the public TypeScript API so that needs to be patched as well.
|
|
233
|
+
// Ref https://github.com/microsoft/TypeScript/pull/55326
|
|
234
|
+
if (major > 5 || (major === 5 && minor >= 5)) {
|
|
235
|
+
moduleWrapper(absRequire(`typescript`));
|
|
222
236
|
}
|
|
223
237
|
|
|
224
238
|
// Defer to the real typescript/lib/tsserverlibrary.js your application uses
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const {existsSync} = require(`fs`);
|
|
4
|
-
const {createRequire} = require(`module`);
|
|
4
|
+
const {createRequire, register} = require(`module`);
|
|
5
5
|
const {resolve} = require(`path`);
|
|
6
|
+
const {pathToFileURL} = require(`url`);
|
|
6
7
|
|
|
7
8
|
const relPnpApiPath = "../../../../.pnp.cjs";
|
|
8
9
|
|
|
9
10
|
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
|
|
10
11
|
const absRequire = createRequire(absPnpApiPath);
|
|
11
12
|
|
|
13
|
+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
|
|
14
|
+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
|
|
15
|
+
|
|
12
16
|
if (existsSync(absPnpApiPath)) {
|
|
13
17
|
if (!process.versions.pnp) {
|
|
14
18
|
// Setup the environment to be able to require typescript
|
|
15
19
|
require(absPnpApiPath).setup();
|
|
20
|
+
if (isPnpLoaderEnabled && register) {
|
|
21
|
+
register(pathToFileURL(absPnpLoaderPath));
|
|
22
|
+
}
|
|
16
23
|
}
|
|
17
24
|
}
|
|
18
25
|
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,10 @@ Please add unreleased changes in the following style:
|
|
|
5
5
|
PR Title ([#123](link to my pr))
|
|
6
6
|
```
|
|
7
7
|
|
|
8
|
+
## 10.0.0-alpha.7
|
|
9
|
+
|
|
10
|
+
feat: [Migrate MapView to react function component (#408)](https://github.com/maplibre/maplibre-react-native/pull/408)
|
|
11
|
+
|
|
8
12
|
## 10.0.0-alpha.6
|
|
9
13
|
fix: [cameraRef?.current?.setCamera causing markerpoint get detached from maps-base](https://github.com/maplibre/maplibre-react-native/issues/409)
|
|
10
14
|
fix: round compass margins and attribution position to nearest integers [android] ([#294](https://github.com/maplibre/maplibre-react-native/pull/294))
|
package/CONTRIBUTING.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Contributing
|
|
2
2
|
|
|
3
3
|
PRs are most welcome! This doc covers some basic things you'll need to know to set up
|
|
4
|
-
your dev environment and streamline the review process.
|
|
4
|
+
your dev environment and streamline the review process.
|
|
5
5
|
|
|
6
6
|
## Environment Setup
|
|
7
7
|
|
|
@@ -12,6 +12,8 @@ This project uses `yarn` as a package manager. DO NOT install `yarn` using `npm`
|
|
|
12
12
|
the outdated 1.x branch. Full instructions are in the [yarn docs](https://yarnpkg.com/getting-started/install),
|
|
13
13
|
but here's the quick checklist at the time of this writing.
|
|
14
14
|
|
|
15
|
+
Make sure to correctly configure your Editor following [this docs](https://yarnpkg.com/getting-started/editor-sdks).
|
|
16
|
+
|
|
15
17
|
1. `corepack enable`
|
|
16
18
|
2. `corepack prepare yarn@stable --activate`
|
|
17
19
|
3. On first install, the above may change your yarn config away from `pnp`; check your git working copy for changes and revert if necessary.
|
|
@@ -19,8 +21,8 @@ but here's the quick checklist at the time of this writing.
|
|
|
19
21
|
|
|
20
22
|
## Testing
|
|
21
23
|
|
|
22
|
-
The metro bundler under `/example` is set up to use the libraries files under root.
|
|
23
|
-
Which means, when you change something within `javascript/components/UserLocation.js`
|
|
24
|
+
The metro bundler under `/example` is set up to use the libraries files under root.
|
|
25
|
+
Which means, when you change something within `javascript/components/UserLocation.js`
|
|
24
26
|
it will be reflected in any scene in example that uses that component.
|
|
25
27
|
|
|
26
28
|
TODO: A better overview of how we use jest, detox, etc. (issue #22)
|
|
@@ -33,7 +35,6 @@ While it's not easy to do this out of the box with `yarn` or `npm`.
|
|
|
33
35
|
[`yalc`](https://www.viget.com/articles/how-to-use-local-unpublished-node-packages-as-project-dependencies/)
|
|
34
36
|
can mitigate some of the pain with this.
|
|
35
37
|
|
|
36
|
-
|
|
37
38
|
## Best practices for PRs
|
|
38
39
|
|
|
39
40
|
- If you add a feature, make sure you add it to the documentation
|
|
@@ -45,10 +46,10 @@ can mitigate some of the pain with this.
|
|
|
45
46
|
|
|
46
47
|
## Documentation
|
|
47
48
|
|
|
48
|
-
Documentation is generated from code blocks and comments.
|
|
49
|
-
It will be auto-generated when you commit changes.
|
|
50
|
-
If any changes are generated from your edits, the changed files will need to be added using `git add` before attempting the commit again.
|
|
51
|
-
To manually generate the changes, run `yarn generate`.
|
|
49
|
+
Documentation is generated from code blocks and comments.
|
|
50
|
+
It will be auto-generated when you commit changes.
|
|
51
|
+
If any changes are generated from your edits, the changed files will need to be added using `git add` before attempting the commit again.
|
|
52
|
+
To manually generate the changes, run `yarn generate`.
|
|
52
53
|
|
|
53
|
-
Notice, that changing the documentation in the individual <COMPONENT>.md within `/docs` will not suffice.
|
|
54
|
+
Notice, that changing the documentation in the individual <COMPONENT>.md within `/docs` will not suffice.
|
|
54
55
|
The correct way is the above described
|
package/docs/Camera.md
CHANGED
|
@@ -34,9 +34,9 @@ Map camera transitions to fit provided bounds
|
|
|
34
34
|
##### arguments
|
|
35
35
|
| Name | Type | Required | Description |
|
|
36
36
|
| ---- | :--: | :------: | :----------: |
|
|
37
|
-
| `northEastCoordinates` | `
|
|
38
|
-
| `southWestCoordinates` | `
|
|
39
|
-
| `padding` | `
|
|
37
|
+
| `northEastCoordinates` | `GeoJSON.Position` | `Yes` | North east coordinate of bound |
|
|
38
|
+
| `southWestCoordinates` | `GeoJSON.Position` | `Yes` | South west coordinate of bound |
|
|
39
|
+
| `padding` | `Number \| Array` | `No` | Padding for the bounds |
|
|
40
40
|
| `animationDuration` | `Number` | `No` | Duration of camera animation |
|
|
41
41
|
|
|
42
42
|
|
package/docs/MapView.md
CHANGED
|
@@ -16,40 +16,16 @@
|
|
|
16
16
|
| pitchEnabled | `boolean` | `true` | `false` | Enable/Disable pitch on map |
|
|
17
17
|
| rotateEnabled | `boolean` | `true` | `false` | Enable/Disable rotation on map |
|
|
18
18
|
| attributionEnabled | `boolean` | `true` | `false` | Enable/Disable attribution on map.<br/><br/>This must be enabled for Mapbox-hosted tiles and styles. Please refer to the Mapbox Terms of Service.<br/>Other providers do not require this. |
|
|
19
|
-
| attributionPosition | `\| {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
\| {
|
|
24
|
-
top?: number;
|
|
25
|
-
right?: number;
|
|
26
|
-
}
|
|
27
|
-
\| {
|
|
28
|
-
bottom?: number;
|
|
29
|
-
left?: number;
|
|
30
|
-
}
|
|
31
|
-
\| {
|
|
32
|
-
bottom?: number;
|
|
33
|
-
right?: number;
|
|
34
|
-
}` | `none` | `false` | Adds attribution offset, e.g. `{top: 8, left: 8}` will put attribution button in top-left corner of the map |
|
|
19
|
+
| attributionPosition | `\| {top?: number; left?: number}
|
|
20
|
+
\| {top?: number; right?: number}
|
|
21
|
+
\| {bottom?: number; left?: number}
|
|
22
|
+
\| {bottom?: number; right?: number}` | `none` | `false` | Adds attribution offset, e.g. `{top: 8, left: 8}` will put attribution button in top-left corner of the map |
|
|
35
23
|
| tintColor | `string \| unknown[]` | `none` | `false` | MapView's tintColor |
|
|
36
24
|
| logoEnabled | `boolean` | `false` | `false` | Enable/Disable the logo on the map. |
|
|
37
|
-
| logoPosition | `\| {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
\| {
|
|
42
|
-
top?: number;
|
|
43
|
-
right?: number;
|
|
44
|
-
}
|
|
45
|
-
\| {
|
|
46
|
-
bottom?: number;
|
|
47
|
-
left?: number;
|
|
48
|
-
}
|
|
49
|
-
\| {
|
|
50
|
-
bottom?: number;
|
|
51
|
-
right?: number;
|
|
52
|
-
}` | `none` | `false` | Adds logo offset, e.g. `{top: 8, left: 8}` will put the logo in top-left corner of the map |
|
|
25
|
+
| logoPosition | `\| {top?: number; left?: number}
|
|
26
|
+
\| {top?: number; right?: number}
|
|
27
|
+
\| {bottom?: number; left?: number}
|
|
28
|
+
\| {bottom?: number; right?: number}` | `none` | `false` | Adds logo offset, e.g. `{top: 8, left: 8}` will put the logo in top-left corner of the map |
|
|
53
29
|
| compassEnabled | `boolean` | `none` | `false` | Enable/Disable the compass from appearing on the map |
|
|
54
30
|
| compassViewPosition | `number` | `none` | `false` | Change corner of map the compass starts at. 0: TopLeft, 1: TopRight, 2: BottomLeft, 3: BottomRight |
|
|
55
31
|
| compassViewMargins | `object` | `none` | `false` | Add margins to the compass with x and y values |
|
|
@@ -115,7 +91,7 @@ Returns an array of rendered map features that intersect with a given point.
|
|
|
115
91
|
##### arguments
|
|
116
92
|
| Name | Type | Required | Description |
|
|
117
93
|
| ---- | :--: | :------: | :----------: |
|
|
118
|
-
| `point` | `tuple` | `Yes` |
|
|
94
|
+
| `point` | `tuple` | `Yes` | undefined |
|
|
119
95
|
| `filter` | `FilterExpression` | `No` | A set of strings that correspond to the names of layers defined in the current style. Only the features contained in these layers are included in the returned array. |
|
|
120
96
|
| `layerIDs` | `Array` | `No` | A array of layer id's to filter the features by |
|
|
121
97
|
|
package/docs/UserLocation.md
CHANGED
|
@@ -14,14 +14,22 @@
|
|
|
14
14
|
| children | `ReactElement \| ReactElement[]` | `none` | `false` | Custom location icon of type mapbox-gl-native components<br/><br/>NOTE: Forking maintainer does not understand the above comment. |
|
|
15
15
|
|
|
16
16
|
### methods
|
|
17
|
-
#### setLocationManager({
|
|
17
|
+
#### setLocationManager({
|
|
18
|
+
running,
|
|
19
|
+
}: {
|
|
20
|
+
running: boolean;
|
|
21
|
+
})
|
|
18
22
|
|
|
19
23
|
Whether to start or stop listening to the locationManager<br/><br/>Notice, that listening will start automatically when<br/>either `onUpdate` or `visible` are set
|
|
20
24
|
|
|
21
25
|
##### arguments
|
|
22
26
|
| Name | Type | Required | Description |
|
|
23
27
|
| ---- | :--: | :------: | :----------: |
|
|
24
|
-
| `{
|
|
28
|
+
| `{
|
|
29
|
+
running,
|
|
30
|
+
}: {
|
|
31
|
+
running: boolean;
|
|
32
|
+
}` | `{running:boolean;}` | `Yes` | undefined |
|
|
25
33
|
|
|
26
34
|
|
|
27
35
|
#### needsLocationManagerRunning()
|
package/docs/docs.json
CHANGED
|
@@ -25,24 +25,9 @@
|
|
|
25
25
|
{
|
|
26
26
|
"name": "symbolStyle",
|
|
27
27
|
"docblock": null,
|
|
28
|
-
"modifiers": [
|
|
29
|
-
"get"
|
|
30
|
-
],
|
|
28
|
+
"modifiers": [],
|
|
31
29
|
"params": [],
|
|
32
|
-
"returns":
|
|
33
|
-
"type": {
|
|
34
|
-
"name": "union",
|
|
35
|
-
"raw": "SymbolLayerStyleProps | undefined",
|
|
36
|
-
"elements": [
|
|
37
|
-
{
|
|
38
|
-
"name": "SymbolLayerStyleProps"
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
"name": "undefined"
|
|
42
|
-
}
|
|
43
|
-
]
|
|
44
|
-
}
|
|
45
|
-
}
|
|
30
|
+
"returns": null
|
|
46
31
|
}
|
|
47
32
|
],
|
|
48
33
|
"props": [
|
|
@@ -268,14 +253,14 @@
|
|
|
268
253
|
"methods": [
|
|
269
254
|
{
|
|
270
255
|
"name": "fitBounds",
|
|
271
|
-
"docblock": "Map camera transitions to fit provided bounds\n\n@example\nthis.camera.fitBounds([lng, lat], [lng, lat])\nthis.camera.fitBounds([lng, lat], [lng, lat], 20, 1000) // padding for all sides\nthis.camera.fitBounds([lng, lat], [lng, lat], [verticalPadding, horizontalPadding], 1000)\nthis.camera.fitBounds([lng, lat], [lng, lat], [top, right, bottom, left], 1000)\n\n@param {Array<Number>} northEastCoordinates - North east coordinate of bound\n@param {Array<Number>} southWestCoordinates - South west coordinate of bound\n@param {Number|Array<Number
|
|
256
|
+
"docblock": "Map camera transitions to fit provided bounds\n\n@example\nthis.camera.fitBounds([lng, lat], [lng, lat])\nthis.camera.fitBounds([lng, lat], [lng, lat], 20, 1000) // padding for all sides\nthis.camera.fitBounds([lng, lat], [lng, lat], [verticalPadding, horizontalPadding], 1000)\nthis.camera.fitBounds([lng, lat], [lng, lat], [top, right, bottom, left], 1000)\n\n@param {Array<Number>} northEastCoordinates - North east coordinate of bound\n@param {Array<Number>} southWestCoordinates - South west coordinate of bound\n@param {Number|Array<Number>|undefined} padding - Padding for the bounds\n@param {Number=} animationDuration - Duration of camera animation\n@return {void}",
|
|
272
257
|
"modifiers": [],
|
|
273
258
|
"params": [
|
|
274
259
|
{
|
|
275
260
|
"name": "northEastCoordinates",
|
|
276
261
|
"description": "North east coordinate of bound",
|
|
277
262
|
"type": {
|
|
278
|
-
"name": "
|
|
263
|
+
"name": "GeoJSON.Position"
|
|
279
264
|
},
|
|
280
265
|
"optional": false
|
|
281
266
|
},
|
|
@@ -283,7 +268,7 @@
|
|
|
283
268
|
"name": "southWestCoordinates",
|
|
284
269
|
"description": "South west coordinate of bound",
|
|
285
270
|
"type": {
|
|
286
|
-
"name": "
|
|
271
|
+
"name": "GeoJSON.Position"
|
|
287
272
|
},
|
|
288
273
|
"optional": false
|
|
289
274
|
},
|
|
@@ -291,7 +276,7 @@
|
|
|
291
276
|
"name": "padding",
|
|
292
277
|
"description": "Padding for the bounds",
|
|
293
278
|
"type": {
|
|
294
|
-
"name":
|
|
279
|
+
"name": "Number \\| Array"
|
|
295
280
|
},
|
|
296
281
|
"optional": true
|
|
297
282
|
},
|
|
@@ -1586,7 +1571,8 @@
|
|
|
1586
1571
|
}
|
|
1587
1572
|
],
|
|
1588
1573
|
"composes": [
|
|
1589
|
-
"BaseProps"
|
|
1574
|
+
"BaseProps",
|
|
1575
|
+
"BaseLayerProps"
|
|
1590
1576
|
],
|
|
1591
1577
|
"fileNameWithExt": "Light.tsx",
|
|
1592
1578
|
"name": "Light",
|
|
@@ -2136,7 +2122,7 @@
|
|
|
2136
2122
|
},
|
|
2137
2123
|
{
|
|
2138
2124
|
"name": "getVisibleBounds",
|
|
2139
|
-
"docblock": "The coordinate bounds(ne, sw) visible in the users’s viewport.\n\n@example\nconst visibleBounds = await this._map.getVisibleBounds();\n\n@return {
|
|
2125
|
+
"docblock": "The coordinate bounds(ne, sw) visible in the users’s viewport.\n\n@example\nconst visibleBounds = await this._map.getVisibleBounds();\n\n@return {Array}",
|
|
2140
2126
|
"modifiers": [
|
|
2141
2127
|
"async"
|
|
2142
2128
|
],
|
|
@@ -2169,18 +2155,17 @@
|
|
|
2169
2155
|
},
|
|
2170
2156
|
{
|
|
2171
2157
|
"name": "queryRenderedFeaturesAtPoint",
|
|
2172
|
-
"docblock": "Returns an array of rendered map features that intersect with a given point.\n\n@example\nthis._map.queryRenderedFeaturesAtPoint([30, 40], ['==', 'type', 'Point'], ['id1', 'id2'])\n\n@
|
|
2158
|
+
"docblock": "Returns an array of rendered map features that intersect with a given point.\n\n@example\nthis._map.queryRenderedFeaturesAtPoint([30, 40], ['==', 'type', 'Point'], ['id1', 'id2'])\n\n@param {Array<Number>} coordinate - A point expressed in the map view’s coordinate system.\n@param {Array=} filter - A set of strings that correspond to the names of layers defined in the current style. Only the features contained in these layers are included in the returned array.\n@param {Array=} layerIDs - A array of layer id's to filter the features by\n@return {GeoJSON.FeatureCollection}",
|
|
2173
2159
|
"modifiers": [
|
|
2174
2160
|
"async"
|
|
2175
2161
|
],
|
|
2176
2162
|
"params": [
|
|
2177
2163
|
{
|
|
2178
2164
|
"name": "point",
|
|
2179
|
-
"
|
|
2165
|
+
"optional": false,
|
|
2180
2166
|
"type": {
|
|
2181
2167
|
"name": "tuple"
|
|
2182
|
-
}
|
|
2183
|
-
"optional": false
|
|
2168
|
+
}
|
|
2184
2169
|
},
|
|
2185
2170
|
{
|
|
2186
2171
|
"name": "filter",
|
|
@@ -2500,7 +2485,7 @@
|
|
|
2500
2485
|
{
|
|
2501
2486
|
"name": "attributionPosition",
|
|
2502
2487
|
"required": false,
|
|
2503
|
-
"type": "\\| {
|
|
2488
|
+
"type": "\\| {top?: number; left?: number}\n\\| {top?: number; right?: number}\n\\| {bottom?: number; left?: number}\n\\| {bottom?: number; right?: number}",
|
|
2504
2489
|
"default": "none",
|
|
2505
2490
|
"description": "Adds attribution offset, e.g. `{top: 8, left: 8}` will put attribution button in top-left corner of the map"
|
|
2506
2491
|
},
|
|
@@ -2521,7 +2506,7 @@
|
|
|
2521
2506
|
{
|
|
2522
2507
|
"name": "logoPosition",
|
|
2523
2508
|
"required": false,
|
|
2524
|
-
"type": "\\| {
|
|
2509
|
+
"type": "\\| {top?: number; left?: number}\n\\| {top?: number; right?: number}\n\\| {bottom?: number; left?: number}\n\\| {bottom?: number; right?: number}",
|
|
2525
2510
|
"default": "none",
|
|
2526
2511
|
"description": "Adds logo offset, e.g. `{top: 8, left: 8}` will put the logo in top-left corner of the map"
|
|
2527
2512
|
},
|
|
@@ -4778,10 +4763,10 @@
|
|
|
4778
4763
|
],
|
|
4779
4764
|
"params": [
|
|
4780
4765
|
{
|
|
4781
|
-
"name": "{running}: {running: boolean}",
|
|
4766
|
+
"name": "{\n running,\n}: {\n running: boolean;\n}",
|
|
4782
4767
|
"optional": false,
|
|
4783
4768
|
"type": {
|
|
4784
|
-
"name": "{running:boolean}"
|
|
4769
|
+
"name": "{running:boolean;}"
|
|
4785
4770
|
}
|
|
4786
4771
|
}
|
|
4787
4772
|
],
|