@nativescript-community/ui-mapbox 6.2.28 → 6.2.30
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 +10 -0
- package/index.ios.js +1 -2
- package/layers/parser/property-parser.ios.js +65 -15
- package/package.json +2 -2
- package/platforms/ios/Podfile +2 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [6.2.30](https://github.com/nativescript-community/ui-mapbox/compare/v6.2.29...v6.2.30) (2024-10-01)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **ios:** updated Mapbox to 6.4.2 with bitcode disabled ([6bc7eb5](https://github.com/nativescript-community/ui-mapbox/commit/6bc7eb55ef8444a9c02c787f95ef757de3e13efc))
|
|
11
|
+
|
|
12
|
+
## [6.2.29](https://github.com/nativescript-community/ui-mapbox/compare/v6.2.28...v6.2.29) (2024-09-21)
|
|
13
|
+
|
|
14
|
+
**Note:** Version bump only for package @nativescript-community/ui-mapbox
|
|
15
|
+
|
|
6
16
|
## [6.2.28](https://github.com/nativescript-community/ui-mapbox/compare/v6.2.27...v6.2.28) (2024-07-16)
|
|
7
17
|
|
|
8
18
|
**Note:** Version bump only for package @nativescript-community/ui-mapbox
|
package/index.ios.js
CHANGED
|
@@ -1627,8 +1627,7 @@ export class Mapbox extends MapboxCommon {
|
|
|
1627
1627
|
for (let i = 0; i < theMap.gestureRecognizers.count; i++) {
|
|
1628
1628
|
const recognizer = theMap.gestureRecognizers.objectAtIndex(i);
|
|
1629
1629
|
if (recognizer instanceof UITapGestureRecognizer) {
|
|
1630
|
-
|
|
1631
|
-
break;
|
|
1630
|
+
tapGestureRecognizer.requireGestureRecognizerToFail(recognizer);
|
|
1632
1631
|
}
|
|
1633
1632
|
}
|
|
1634
1633
|
theMap.addGestureRecognizer(tapGestureRecognizer);
|
|
@@ -2,6 +2,41 @@ import { Color } from '@nativescript/core';
|
|
|
2
2
|
function toCamelCase(s) {
|
|
3
3
|
return s.replace(/([-_][a-z])/gi, ($1) => $1.toUpperCase().replace('-', '').replace('_', ''));
|
|
4
4
|
}
|
|
5
|
+
const styleExtras = {
|
|
6
|
+
// padding
|
|
7
|
+
iconTextFitPadding: {
|
|
8
|
+
iosType: 'edgeinsets'
|
|
9
|
+
},
|
|
10
|
+
// offsets
|
|
11
|
+
iconOffset: {
|
|
12
|
+
iosType: 'vector'
|
|
13
|
+
},
|
|
14
|
+
textOffset: {
|
|
15
|
+
iosType: 'vector'
|
|
16
|
+
},
|
|
17
|
+
lineOffset: {
|
|
18
|
+
iosType: 'vector'
|
|
19
|
+
},
|
|
20
|
+
// translates
|
|
21
|
+
fillTranslate: {
|
|
22
|
+
iosType: 'vector'
|
|
23
|
+
},
|
|
24
|
+
lineTranslate: {
|
|
25
|
+
iosType: 'vector'
|
|
26
|
+
},
|
|
27
|
+
iconTranslate: {
|
|
28
|
+
iosType: 'vector'
|
|
29
|
+
},
|
|
30
|
+
textTranslate: {
|
|
31
|
+
iosType: 'vector'
|
|
32
|
+
},
|
|
33
|
+
circleTranslate: {
|
|
34
|
+
iosType: 'vector'
|
|
35
|
+
},
|
|
36
|
+
fillExtrusionTranslate: {
|
|
37
|
+
iosType: 'vector'
|
|
38
|
+
}
|
|
39
|
+
};
|
|
5
40
|
const keysMap = {
|
|
6
41
|
'circle-pitch-scale': 'circleScaleAlignment',
|
|
7
42
|
'circle-translate': 'circleTranslation',
|
|
@@ -39,24 +74,39 @@ const keysMap = {
|
|
|
39
74
|
'raster-brightness-min': 'maximumRasterBrightness',
|
|
40
75
|
'raster-brightness-max': 'minimumRasterBrightness'
|
|
41
76
|
};
|
|
42
|
-
function transformValue(key, value) {
|
|
43
|
-
if (key.indexOf('-color') !== -1
|
|
77
|
+
function transformValue(key, value, _styleType) {
|
|
78
|
+
if (_styleType === 'color' || key.indexOf('-color') !== -1) {
|
|
44
79
|
const color = value instanceof Color ? value : new Color(value);
|
|
45
80
|
return color.ios;
|
|
46
81
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
82
|
+
else if (_styleType === 'vector') {
|
|
83
|
+
const vector = CGVectorMake(value[0], value[1]);
|
|
84
|
+
return NSExpression.expressionWithMGLJSONObject(NSValue.valueWithCGVector(vector));
|
|
85
|
+
}
|
|
86
|
+
else if (_styleType === 'edgeinsets') {
|
|
87
|
+
const edgeInsets = new UIEdgeInsets({
|
|
88
|
+
top: value[0],
|
|
89
|
+
left: value[1],
|
|
90
|
+
bottom: value[2],
|
|
91
|
+
right: value[3]
|
|
92
|
+
});
|
|
93
|
+
return NSExpression.expressionWithMGLJSONObject(NSValue.valueWithUIEdgeInsets(edgeInsets));
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
switch (key) {
|
|
97
|
+
case 'raster-resampling':
|
|
98
|
+
if (value === 'linear') {
|
|
99
|
+
return 0 /* MGLRasterResamplingMode.Linear */;
|
|
100
|
+
}
|
|
101
|
+
else if (value === 'nearest') {
|
|
102
|
+
return 1 /* MGLRasterResamplingMode.Nearest */;
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
return value;
|
|
106
|
+
}
|
|
107
|
+
default:
|
|
56
108
|
return value;
|
|
57
|
-
|
|
58
|
-
default:
|
|
59
|
-
return value;
|
|
109
|
+
}
|
|
60
110
|
}
|
|
61
111
|
}
|
|
62
112
|
export class PropertyParser {
|
|
@@ -66,7 +116,7 @@ export class PropertyParser {
|
|
|
66
116
|
Object.keys(propertiesObject).forEach((k) => {
|
|
67
117
|
const actualKey = keysMap[k] || toCamelCase(k);
|
|
68
118
|
const value = propertiesObject[k];
|
|
69
|
-
const rValue = transformValue(k, value);
|
|
119
|
+
const rValue = transformValue(k, value, styleExtras[k]?.iosType);
|
|
70
120
|
if (Array.isArray(value)) {
|
|
71
121
|
nProperties[actualKey] = NSExpression.expressionWithMGLJSONObject(rValue);
|
|
72
122
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nativescript-community/ui-mapbox",
|
|
3
|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.30",
|
|
4
4
|
"description": "Interactive, thoroughly customizable maps powered by vector tiles and OpenGL.",
|
|
5
5
|
"main": "index",
|
|
6
6
|
"typings": "index.d.ts",
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@nativescript-community/perms": "^2.3.0"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "fb5fc8714a3845bb40f6c4adb9da3b21dd66cd71"
|
|
58
58
|
}
|
package/platforms/ios/Podfile
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
pod 'Mapbox-iOS-SDK', '~> 5.1.1'
|
|
1
|
+
# see https://github.com/CocoaPods/CocoaPods/issues/11867 for why i use podspec
|
|
2
|
+
pod 'Mapbox-iOS-SDK', :podspec => 'https://raw.githubusercontent.com/nativescript-community/mapbox-gl-native-ios/refs/heads/main/Mapbox-iOS-SDK.podspec'
|