@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
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
<%
|
|
2
|
-
const layers = locals.layers;
|
|
3
|
-
const helpers = locals.helpers;
|
|
4
|
-
-%>
|
|
5
|
-
// DO NOT MODIFY
|
|
6
|
-
// THIS FILE IS AUTOGENERATED
|
|
7
|
-
|
|
8
|
-
import { isAndroid } from './index';
|
|
9
|
-
|
|
10
|
-
export const StyleTypes = {
|
|
11
|
-
Constant: 'constant',
|
|
12
|
-
Color: 'color',
|
|
13
|
-
Transition: 'transition',
|
|
14
|
-
Translation: 'translation',
|
|
15
|
-
Function: 'function',
|
|
16
|
-
Image: 'image',
|
|
17
|
-
Enum: 'enum',
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const styleMap = {
|
|
21
|
-
<%_ for (let layer of layers) { _%>
|
|
22
|
-
<%_ for (let prop of layer.properties) { _%>
|
|
23
|
-
<%_ if (!['color', 'colorTransition', 'visibility'].includes(prop.name)) { _%>
|
|
24
|
-
<%= prop.name %>: <%- helpers.jsStyleType(prop) %>,
|
|
25
|
-
<%_ if (prop.transition) { _%>
|
|
26
|
-
<%= prop.name %>Transition: StyleTypes.Transition,
|
|
27
|
-
<%_ } _%>
|
|
28
|
-
<%_ } _%>
|
|
29
|
-
<%_ } _%>
|
|
30
|
-
|
|
31
|
-
<%_ } _%>
|
|
32
|
-
|
|
33
|
-
color: StyleTypes.Color,
|
|
34
|
-
colorTransition: StyleTypes.Transition,
|
|
35
|
-
visibility: StyleTypes.Constant,
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export const styleExtras = {
|
|
39
|
-
// padding
|
|
40
|
-
iconTextFitPadding: {
|
|
41
|
-
iosType: 'edgeinsets',
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
// offsets
|
|
45
|
-
iconOffset: {
|
|
46
|
-
iosType: 'vector',
|
|
47
|
-
},
|
|
48
|
-
textOffset: {
|
|
49
|
-
iosType: 'vector',
|
|
50
|
-
},
|
|
51
|
-
lineOffset: {
|
|
52
|
-
iosType: 'vector',
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
// translates
|
|
56
|
-
fillTranslate: {
|
|
57
|
-
iosType: 'vector',
|
|
58
|
-
},
|
|
59
|
-
lineTranslate: {
|
|
60
|
-
iosType: 'vector',
|
|
61
|
-
},
|
|
62
|
-
iconTranslate: {
|
|
63
|
-
iosType: 'vector',
|
|
64
|
-
},
|
|
65
|
-
textTranslate: {
|
|
66
|
-
iosType: 'vector',
|
|
67
|
-
},
|
|
68
|
-
circleTranslate: {
|
|
69
|
-
iosType: 'vector',
|
|
70
|
-
},
|
|
71
|
-
fillExtrusionTranslate: {
|
|
72
|
-
iosType: 'vector',
|
|
73
|
-
},
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
export function getStyleType(styleProp: keyof typeof styleExtras) {
|
|
77
|
-
if (!isAndroid() && styleExtras[styleProp]) {
|
|
78
|
-
return styleExtras[styleProp].iosType;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
if (styleMap[styleProp]) {
|
|
82
|
-
return styleMap[styleProp];
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
throw new Error(`${styleProp} is not a valid Mapbox layer style`);
|
|
86
|
-
}
|