@maplibre/maplibre-react-native 10.0.0-alpha.26 → 10.0.0-alpha.27
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 +4 -0
- package/android/src/main/java/com/maplibre/rctmln/components/styles/RCTMLNStyleFactory.java +1 -1
- package/docs/Annotation.md +1 -1
- package/docs/BackgroundLayer.md +1 -1
- package/docs/Callout.md +1 -1
- package/docs/Camera.md +1 -1
- package/docs/CircleLayer.md +1 -1
- package/docs/FillExtrusionLayer.md +1 -1
- package/docs/FillLayer.md +1 -1
- package/docs/HeadingIndicator.md +1 -1
- package/docs/HeatmapLayer.md +1 -1
- package/docs/ImageSource.md +1 -1
- package/docs/Images.md +1 -1
- package/docs/Light.md +1 -1
- package/docs/LineLayer.md +1 -1
- package/docs/MapView.md +1 -1
- package/docs/MarkerView.md +1 -1
- package/docs/NativeUserLocation.md +1 -1
- package/docs/PointAnnotation.md +1 -1
- package/docs/RasterLayer.md +1 -1
- package/docs/RasterSource.md +1 -1
- package/docs/ShapeSource.md +1 -1
- package/docs/Style.md +1 -1
- package/docs/SymbolLayer.md +1 -1
- package/docs/UserLocation.md +1 -1
- package/docs/VectorSource.md +1 -1
- package/docs/coordinates.md +1 -1
- package/docs/location.md +1 -1
- package/docs/offlineManager.md +1 -1
- package/docs/snapshotManager.md +1 -1
- package/ios/RCTMLN/RCTMLNStyle.h +1 -1
- package/ios/RCTMLN/RCTMLNStyle.m +1 -1
- package/javascript/utils/MaplibreStyles.d.ts +3 -1
- package/javascript/utils/index.ts +8 -7
- package/javascript/utils/styleMap.ts +1 -1
- package/package.json +1 -1
- package/scripts/codegen.ts +12 -8
- package/scripts/templates/MaplibreStyles.ts.ejs +3 -1
- package/scripts/templates/RCTMLNStyle.h.ejs +2 -2
- package/scripts/templates/RCTMLNStyle.m.ejs +2 -2
- package/scripts/templates/RCTMLNStyleFactory.java.ejs +2 -2
- package/scripts/templates/component.md.ejs +2 -2
- package/scripts/templates/styleMap.ts.ejs +2 -2
- package/scripts/utils/MarkdownBuilder.ts +4 -4
- package/scripts/utils/TemplateHelpers.ts +6 -0
- package/ios/RCTMLN/index.d.ts +0 -1183
- package/scripts/templates/index.d.ts.ejs +0 -86
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,10 @@ PR Title ([#123](link to my pr))
|
|
|
6
6
|
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
+
## 10.0.0-alpha.27
|
|
10
|
+
|
|
11
|
+
fix: use UIManager exported from react-native ([#511](https://github.com/maplibre/maplibre-react-native/pull/511))
|
|
12
|
+
|
|
9
13
|
## 10.0.0-alpha.26
|
|
10
14
|
|
|
11
15
|
chore: upgrade Expo SDK 52 ([489](https://github.com/maplibre/maplibre-react-native/pull/489))
|
package/docs/Annotation.md
CHANGED
package/docs/BackgroundLayer.md
CHANGED
package/docs/Callout.md
CHANGED
package/docs/Camera.md
CHANGED
package/docs/CircleLayer.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- DO NOT MODIFY
|
|
1
|
+
<!-- DO NOT MODIFY -->
|
|
2
2
|
<!-- This file is auto-generated from javascript/components/FillExtrusionLayer.tsx -->
|
|
3
3
|
# `<MapLibreGL.FillExtrusionLayer />`
|
|
4
4
|
FillExtrusionLayer is a style layer that renders one or more 3D extruded polygons on the map.
|
package/docs/FillLayer.md
CHANGED
package/docs/HeadingIndicator.md
CHANGED
package/docs/HeatmapLayer.md
CHANGED
package/docs/ImageSource.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- DO NOT MODIFY
|
|
1
|
+
<!-- DO NOT MODIFY -->
|
|
2
2
|
<!-- This file is auto-generated from javascript/components/ImageSource.tsx -->
|
|
3
3
|
# `<MapLibreGL.ImageSource />`
|
|
4
4
|
ImageSource is a content source that is used for a georeferenced raster image to be shown on the map.<br/>The georeferenced image scales and rotates as the user zooms and rotates the map
|
package/docs/Images.md
CHANGED
package/docs/Light.md
CHANGED
package/docs/LineLayer.md
CHANGED
package/docs/MapView.md
CHANGED
package/docs/MarkerView.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- DO NOT MODIFY
|
|
1
|
+
<!-- DO NOT MODIFY -->
|
|
2
2
|
<!-- This file is auto-generated from javascript/components/MarkerView.tsx -->
|
|
3
3
|
# `<MapLibreGL.MarkerView />`
|
|
4
4
|
MarkerView allows you to place a interactive react native marker to the map.<br/><br/>If you have static view consider using PointAnnotation or SymbolLayer they'll offer much better performance<br/>.<br/>This is based on [MakerView plugin](https://docs.mapbox.com/android/plugins/overview/markerview/) on Android<br/>and PointAnnotation on iOS.
|
package/docs/PointAnnotation.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- DO NOT MODIFY
|
|
1
|
+
<!-- DO NOT MODIFY -->
|
|
2
2
|
<!-- This file is auto-generated from javascript/components/PointAnnotation.tsx -->
|
|
3
3
|
# `<MapLibreGL.PointAnnotation />`
|
|
4
4
|
PointAnnotation represents a one-dimensional shape located at a single geographical coordinate.<br/><br/>Consider using ShapeSource and SymbolLayer instead, if you have many points and you have static images,<br/>they'll offer much better performance<br/><br/>.<br/>If you need interctive views please use MarkerView,<br/>as with PointAnnotation on Android child views are rendered onto a bitmap for better performance.
|
package/docs/RasterLayer.md
CHANGED
package/docs/RasterSource.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- DO NOT MODIFY
|
|
1
|
+
<!-- DO NOT MODIFY -->
|
|
2
2
|
<!-- This file is auto-generated from javascript/components/RasterSource.tsx -->
|
|
3
3
|
# `<MapLibreGL.RasterSource />`
|
|
4
4
|
RasterSource is a map content source that supplies raster image tiles to be shown on the map.<br/>The location of and metadata about the tiles are defined either by an option dictionary<br/>or by an external file that conforms to the TileJSON specification.
|
package/docs/ShapeSource.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- DO NOT MODIFY
|
|
1
|
+
<!-- DO NOT MODIFY -->
|
|
2
2
|
<!-- This file is auto-generated from javascript/components/ShapeSource.tsx -->
|
|
3
3
|
# `<MapLibreGL.ShapeSource />`
|
|
4
4
|
ShapeSource is a map content source that supplies vector shapes to be shown on the map.<br/>The shape may be a url or a GeoJSON object
|
package/docs/Style.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- DO NOT MODIFY
|
|
1
|
+
<!-- DO NOT MODIFY -->
|
|
2
2
|
<!-- This file is auto-generated from javascript/components/Style.tsx -->
|
|
3
3
|
# `<MapLibreGL.Style />`
|
|
4
4
|
Style is a component that automatically adds sources / layers to the map using MapLibre Style Spec.<br/>Only [`sources`](https://maplibre.org/maplibre-gl-js-docs/style-spec/sources/) & [`layers`](https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/) are supported.<br/>Other fields such as `sprites`, `glyphs` etc. will be ignored. Not all layer / source attributes from the style spec are supported, in general the supported attributes will be mentioned under https://github.com/maplibre/maplibre-react-native/tree/main/docs.<br/><br/>TODO: Maintainer forking this project does not understand the above comment regarding what is supported.
|
package/docs/SymbolLayer.md
CHANGED
package/docs/UserLocation.md
CHANGED
package/docs/VectorSource.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- DO NOT MODIFY
|
|
1
|
+
<!-- DO NOT MODIFY -->
|
|
2
2
|
<!-- This file is auto-generated from javascript/components/VectorSource.tsx -->
|
|
3
3
|
# `<MapLibreGL.VectorSource />`
|
|
4
4
|
VectorSource is a map content source that supplies tiled vector data in Mapbox Vector Tile format to be shown on the map.<br/>The location of and metadata about the tiles are defined either by an option dictionary or by an external file that conforms to the TileJSON specification.
|
package/docs/coordinates.md
CHANGED
package/docs/location.md
CHANGED
package/docs/offlineManager.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- DO NOT MODIFY
|
|
1
|
+
<!-- DO NOT MODIFY -->
|
|
2
2
|
<!-- This file is auto-generated from javascript/modules/offline/offlineManager.ts -->
|
|
3
3
|
# `<MapLibreGL.offlineManager />`
|
|
4
4
|
OfflineManager implements a singleton (shared object) that manages offline packs.<br/>All of this class’s instance methods are asynchronous, reflecting the fact that offline resources are stored in a database.<br/>The shared object maintains a canonical collection of offline packs.
|
package/docs/snapshotManager.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- DO NOT MODIFY
|
|
1
|
+
<!-- DO NOT MODIFY -->
|
|
2
2
|
<!-- This file is auto-generated from javascript/modules/snapshot/snapshotManager.ts -->
|
|
3
3
|
# `<MapLibreGL.snapshotManager />`
|
|
4
4
|
The snapshotManager generates static raster images of the map.<br/>Each snapshot image depicts a portion of a map defined by an SnapshotOptions object you provide.<br/>The snapshotter generates the snapshot asynchronous.
|
package/ios/RCTMLN/RCTMLNStyle.h
CHANGED
package/ios/RCTMLN/RCTMLNStyle.m
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
// DO NOT MODIFY
|
|
2
|
+
// This file is auto-generated from scripts/templates/MaplibreStyles.ts.ejs
|
|
3
|
+
|
|
2
4
|
import { type ImageSourcePropType } from "react-native";
|
|
3
5
|
|
|
4
6
|
export type Translation = { x: number; y: number } | [number, number];
|
|
@@ -5,14 +5,11 @@ import {
|
|
|
5
5
|
findNodeHandle,
|
|
6
6
|
Platform,
|
|
7
7
|
ImageSourcePropType,
|
|
8
|
+
UIManager,
|
|
8
9
|
} from "react-native";
|
|
9
10
|
|
|
10
|
-
function getAndroidManagerInstance(module: string)
|
|
11
|
-
|
|
12
|
-
NativeModules.UIManager && NativeModules.UIManager.getViewManagerConfig;
|
|
13
|
-
return haveViewManagerConfig
|
|
14
|
-
? NativeModules.UIManager.getViewManagerConfig(module)
|
|
15
|
-
: NativeModules.UIManager[module];
|
|
11
|
+
function getAndroidManagerInstance(module: string) {
|
|
12
|
+
return UIManager.getViewManagerConfig(module);
|
|
16
13
|
}
|
|
17
14
|
|
|
18
15
|
function getIosManagerInstance(module: string): any {
|
|
@@ -84,11 +81,14 @@ export function runNativeCommand<ReturnType = NativeArg>(
|
|
|
84
81
|
}
|
|
85
82
|
|
|
86
83
|
if (isAndroid()) {
|
|
87
|
-
|
|
84
|
+
UIManager.dispatchViewManagerCommand(
|
|
88
85
|
handle,
|
|
89
86
|
managerInstance.Commands[name],
|
|
90
87
|
args,
|
|
91
88
|
);
|
|
89
|
+
|
|
90
|
+
// Android uses callback instead of return
|
|
91
|
+
return null as ReturnType;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
return managerInstance[name](handle, ...args);
|
|
@@ -125,6 +125,7 @@ export function getIOSModuleName(moduleName: string): string {
|
|
|
125
125
|
if (moduleName.startsWith("RCT")) {
|
|
126
126
|
return moduleName.substring(3);
|
|
127
127
|
}
|
|
128
|
+
|
|
128
129
|
return moduleName;
|
|
129
130
|
}
|
|
130
131
|
|
package/package.json
CHANGED
package/scripts/codegen.ts
CHANGED
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
isVersionGTE,
|
|
16
16
|
} from "./utils/getNativeVersion";
|
|
17
17
|
|
|
18
|
-
const
|
|
18
|
+
const TEMPLATES_PATH = path.join(__dirname, "templates");
|
|
19
19
|
|
|
20
20
|
const IOS_OUTPUT_PATH = path.join(__dirname, "..", "ios", "RCTMLN");
|
|
21
21
|
const ANDROID_OUTPUT_PATH = path.join(
|
|
@@ -36,23 +36,23 @@ const JS_OUTPUT_PATH = path.join(__dirname, "..", "javascript", "utils");
|
|
|
36
36
|
|
|
37
37
|
const TEMPLATE_MAPPINGS = [
|
|
38
38
|
{
|
|
39
|
-
input: path.join(
|
|
39
|
+
input: path.join(TEMPLATES_PATH, "RCTMLNStyle.h.ejs"),
|
|
40
40
|
output: path.join(IOS_OUTPUT_PATH, "RCTMLNStyle.h"),
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
|
-
input: path.join(
|
|
43
|
+
input: path.join(TEMPLATES_PATH, "MaplibreStyles.ts.ejs"),
|
|
44
44
|
output: path.join(JS_OUTPUT_PATH, "MaplibreStyles.d.ts"),
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
|
-
input: path.join(
|
|
47
|
+
input: path.join(TEMPLATES_PATH, "RCTMLNStyle.m.ejs"),
|
|
48
48
|
output: path.join(IOS_OUTPUT_PATH, "RCTMLNStyle.m"),
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
|
-
input: path.join(
|
|
51
|
+
input: path.join(TEMPLATES_PATH, "RCTMLNStyleFactory.java.ejs"),
|
|
52
52
|
output: path.join(ANDROID_OUTPUT_PATH, "RCTMLNStyleFactory.java"),
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
|
-
input: path.join(
|
|
55
|
+
input: path.join(TEMPLATES_PATH, "styleMap.ts.ejs"),
|
|
56
56
|
output: path.join(JS_OUTPUT_PATH, "styleMap.ts"),
|
|
57
57
|
},
|
|
58
58
|
];
|
|
@@ -295,11 +295,15 @@ async function generate() {
|
|
|
295
295
|
const filename = path.parse(output).base;
|
|
296
296
|
|
|
297
297
|
console.log(`Generating ${filename}`);
|
|
298
|
-
const
|
|
298
|
+
const template = ejs.compile(await fs.readFile(input, "utf8"), {
|
|
299
299
|
strict: true,
|
|
300
300
|
async: true,
|
|
301
301
|
});
|
|
302
|
-
let results = await
|
|
302
|
+
let results = await template({
|
|
303
|
+
layers,
|
|
304
|
+
filePath: path.relative(path.join(__dirname, ".."), input),
|
|
305
|
+
helpers: TemplateHelpers,
|
|
306
|
+
});
|
|
303
307
|
if (filename.endsWith("ts")) {
|
|
304
308
|
results = await prettier.format(results, {
|
|
305
309
|
filepath: filename,
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
const layers = locals.layers;
|
|
3
3
|
const helpers = locals.helpers;
|
|
4
4
|
-%>
|
|
5
|
-
|
|
5
|
+
// <%= helpers.autoGeneratedHeader.doNotModify %>
|
|
6
|
+
// <%= helpers.autoGeneratedHeader.generatedFrom(locals.filePath) %>
|
|
7
|
+
|
|
6
8
|
import { type ImageSourcePropType } from 'react-native';
|
|
7
9
|
|
|
8
10
|
export type Translation = { x: number; y: number } | [number, number];
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
const layers = locals.layers;
|
|
3
3
|
const helpers = locals.helpers;
|
|
4
4
|
-%>
|
|
5
|
-
//
|
|
6
|
-
//
|
|
5
|
+
// <%= helpers.autoGeneratedHeader.doNotModify %>
|
|
6
|
+
// <%= helpers.autoGeneratedHeader.generatedFrom(locals.filePath) %>
|
|
7
7
|
|
|
8
8
|
#import "RCTMLNStyle.h"
|
|
9
9
|
#import "RCTMLNStyleValue.h"
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
const layers = locals.layers;
|
|
3
3
|
const helpers = locals.helpers;
|
|
4
4
|
-%>
|
|
5
|
-
//
|
|
6
|
-
//
|
|
5
|
+
// <%= helpers.autoGeneratedHeader.doNotModify %>
|
|
6
|
+
// <%= helpers.autoGeneratedHeader.generatedFrom(locals.filePath) %>
|
|
7
7
|
|
|
8
8
|
#import "RCTMLNStyle.h"
|
|
9
9
|
#import "RCTMLNUtils.h"
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
const layers = locals.layers;
|
|
3
3
|
const helpers = locals.helpers;
|
|
4
4
|
-%>
|
|
5
|
-
//
|
|
6
|
-
//
|
|
5
|
+
// <%= helpers.autoGeneratedHeader.doNotModify %>
|
|
6
|
+
// <%= helpers.autoGeneratedHeader.generatedFrom(locals.filePath) %>
|
|
7
7
|
|
|
8
8
|
package com.maplibre.rctmln.components.styles;
|
|
9
9
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
const component = locals.component;
|
|
3
3
|
const helpers = locals.helpers;
|
|
4
4
|
-%>
|
|
5
|
-
<!--
|
|
6
|
-
<!--
|
|
5
|
+
<!-- <%= helpers.autoGeneratedHeader.doNotModify %> -->
|
|
6
|
+
<!-- <%= helpers.autoGeneratedHeader.generatedFrom(component.filePath) %> -->
|
|
7
7
|
# `<MapLibreGL.<%- component.name %> />`
|
|
8
8
|
<%- helpers.replaceNewLine(component.description) %>
|
|
9
9
|
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
const helpers = locals.helpers;
|
|
4
4
|
-%>
|
|
5
5
|
/* eslint-disable */
|
|
6
|
-
//
|
|
7
|
-
//
|
|
6
|
+
// <%= helpers.autoGeneratedHeader.doNotModify %>
|
|
7
|
+
// <%= helpers.autoGeneratedHeader.generatedFrom(locals.filePath) %>
|
|
8
8
|
|
|
9
9
|
import { isAndroid } from './index';
|
|
10
10
|
|
|
@@ -4,18 +4,18 @@ import path from "node:path";
|
|
|
4
4
|
|
|
5
5
|
import * as TemplateHelpers from "./TemplateHelpers";
|
|
6
6
|
|
|
7
|
-
const
|
|
7
|
+
const TEMPLATE_PATH = path.join(__dirname, "..", "templates");
|
|
8
8
|
|
|
9
9
|
export class MarkdownBuilder {
|
|
10
10
|
async generateComponentFile(docJSON: any, componentName: string) {
|
|
11
|
-
const
|
|
12
|
-
await fs.readFile(path.join(
|
|
11
|
+
const template = ejs.compile(
|
|
12
|
+
await fs.readFile(path.join(TEMPLATE_PATH, "component.md.ejs"), "utf8"),
|
|
13
13
|
{
|
|
14
14
|
async: true,
|
|
15
15
|
strict: true,
|
|
16
16
|
},
|
|
17
17
|
);
|
|
18
|
-
const fileContents = await
|
|
18
|
+
const fileContents = await template({
|
|
19
19
|
component: docJSON[componentName],
|
|
20
20
|
helpers: TemplateHelpers,
|
|
21
21
|
});
|
|
@@ -40,6 +40,12 @@ const iosSpecOverrides: Record<string, string> = {
|
|
|
40
40
|
"text-writing-mode": "text-writing-modes",
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
+
export const autoGeneratedHeader = {
|
|
44
|
+
doNotModify: "DO NOT MODIFY",
|
|
45
|
+
generatedFrom: (filePath: string) =>
|
|
46
|
+
`This file is auto-generated from ${filePath}`,
|
|
47
|
+
};
|
|
48
|
+
|
|
43
49
|
export function exists<T>(value: T): value is NonNullable<T> {
|
|
44
50
|
return typeof value !== "undefined" && value !== null;
|
|
45
51
|
}
|