@nativescript-community/ui-mapbox 7.0.8 → 7.0.10
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 +28 -21
- package/markers/Marker.common.js +1 -0
- package/package.json +2 -2
- package/platforms/ios/src/MapboxBridge.swift +9 -7
- package/platforms/android/ui_mapbox.aar +0 -0
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
|
+
## [7.0.10](https://github.com/nativescript-community/ui-mapbox/compare/v7.0.9...v7.0.10) (2025-11-04)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @nativescript-community/ui-mapbox
|
|
9
|
+
|
|
10
|
+
## [7.0.9](https://github.com/nativescript-community/ui-mapbox/compare/v7.0.8...v7.0.9) (2025-11-04)
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* **ios:** removed many unwanted error message (no actual error) ([f67277c](https://github.com/nativescript-community/ui-mapbox/commit/f67277c1ee0092eab4a2067b3d765c2aa2410246))
|
|
15
|
+
|
|
6
16
|
## [7.0.8](https://github.com/nativescript-community/ui-mapbox/compare/v7.0.7...v7.0.8) (2025-11-03)
|
|
7
17
|
|
|
8
18
|
**Note:** Version bump only for package @nativescript-community/ui-mapbox
|
package/index.ios.js
CHANGED
|
@@ -145,8 +145,8 @@ export class MapboxView extends MapboxViewBase {
|
|
|
145
145
|
}
|
|
146
146
|
async disposeNativeView() {
|
|
147
147
|
this.nativeView.owner = null;
|
|
148
|
-
|
|
149
|
-
|
|
148
|
+
this.mapbox?.destroy();
|
|
149
|
+
this.mapbox = null;
|
|
150
150
|
super.disposeNativeView();
|
|
151
151
|
}
|
|
152
152
|
getMapboxApi() {
|
|
@@ -398,7 +398,7 @@ export class Mapbox extends MapboxCommon {
|
|
|
398
398
|
}));
|
|
399
399
|
nativeMap.autoresizingMask = 2 /* UIViewAutoresizing.FlexibleWidth */ | 16 /* UIViewAutoresizing.FlexibleHeight */;
|
|
400
400
|
_markers = [];
|
|
401
|
-
this.addMarkers(settings.markers);
|
|
401
|
+
this.addMarkers(settings.markers || []);
|
|
402
402
|
// setTimeout(() => view.addSubview(nativeMap), 0);
|
|
403
403
|
view.addSubview(nativeMap);
|
|
404
404
|
this.setMapboxViewInstance(nativeMap);
|
|
@@ -463,24 +463,24 @@ export class Mapbox extends MapboxCommon {
|
|
|
463
463
|
this._programmaticMapView = null;
|
|
464
464
|
}
|
|
465
465
|
const bridge = MapboxBridge.bridgeFor(theMap);
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
this.bridgeInstance = null;
|
|
469
|
-
}
|
|
470
|
-
try {
|
|
471
|
-
this._observerTokens.forEach((t) => {
|
|
472
|
-
try {
|
|
473
|
-
NSNotificationCenter.defaultCenter.removeObserver(t);
|
|
474
|
-
}
|
|
475
|
-
catch (e) {
|
|
476
|
-
console.error(e, e.stack);
|
|
477
|
-
}
|
|
478
|
-
});
|
|
479
|
-
this._observerTokens = [];
|
|
466
|
+
if (Trace.isEnabled()) {
|
|
467
|
+
CLog(CLogTypes.info, 'destroy():', theMap, bridge);
|
|
480
468
|
}
|
|
481
|
-
|
|
482
|
-
|
|
469
|
+
if (bridge) {
|
|
470
|
+
bridge.destroy();
|
|
471
|
+
if (bridge === this.bridgeInstance) {
|
|
472
|
+
this.bridgeInstance = null;
|
|
473
|
+
}
|
|
483
474
|
}
|
|
475
|
+
this._observerTokens.forEach((t) => {
|
|
476
|
+
try {
|
|
477
|
+
NSNotificationCenter.defaultCenter.removeObserver(t);
|
|
478
|
+
}
|
|
479
|
+
catch (e) {
|
|
480
|
+
console.error(e, e.stack);
|
|
481
|
+
}
|
|
482
|
+
});
|
|
483
|
+
this._observerTokens = [];
|
|
484
484
|
if (this._reusableCalloutView) {
|
|
485
485
|
this._reusableCalloutView._tearDownUI();
|
|
486
486
|
this._reusableCalloutView = null;
|
|
@@ -1034,8 +1034,14 @@ export class Mapbox extends MapboxCommon {
|
|
|
1034
1034
|
reject('No bridge available');
|
|
1035
1035
|
return;
|
|
1036
1036
|
}
|
|
1037
|
+
if (Trace.isEnabled()) {
|
|
1038
|
+
CLog(CLogTypes.info, 'setMapStyle():', style);
|
|
1039
|
+
}
|
|
1037
1040
|
const styleStr = (typeof style === 'string' ? style : style.toString()) ?? 'streets';
|
|
1038
1041
|
b.setStyle(styleStr, (success, error) => {
|
|
1042
|
+
if (Trace.isEnabled()) {
|
|
1043
|
+
CLog(CLogTypes.info, 'setMapStyle():', style, 'done:', success, error);
|
|
1044
|
+
}
|
|
1039
1045
|
if (success)
|
|
1040
1046
|
resolve();
|
|
1041
1047
|
else
|
|
@@ -1043,6 +1049,7 @@ export class Mapbox extends MapboxCommon {
|
|
|
1043
1049
|
});
|
|
1044
1050
|
}
|
|
1045
1051
|
catch (ex) {
|
|
1052
|
+
console.error('setMapStyle():', ex, ex['stack']);
|
|
1046
1053
|
reject(ex);
|
|
1047
1054
|
}
|
|
1048
1055
|
});
|
|
@@ -1304,14 +1311,14 @@ export class Mapbox extends MapboxCommon {
|
|
|
1304
1311
|
// ---------------- Callouts ----------------
|
|
1305
1312
|
createCalloutView(marker) {
|
|
1306
1313
|
if (Trace.isEnabled()) {
|
|
1307
|
-
CLog(CLogTypes.info, 'createCalloutView():', marker.id, marker.title, !!this._reusableCalloutView);
|
|
1314
|
+
CLog(CLogTypes.info, 'createCalloutView():', marker.id, marker.title, marker?.subtitle, !!this._reusableCalloutView);
|
|
1308
1315
|
}
|
|
1309
1316
|
if (this._reusableCalloutView) {
|
|
1310
1317
|
const title = this._reusableCalloutView.getViewById('title');
|
|
1311
1318
|
title.text = marker?.title || '';
|
|
1312
1319
|
const subtitle = this._reusableCalloutView.getViewById('subtitle');
|
|
1313
1320
|
subtitle.text = marker?.subtitle;
|
|
1314
|
-
subtitle.visibility = marker?.subtitle ? 'visible' : 'collapse';
|
|
1321
|
+
// subtitle.visibility = marker?.subtitle ? 'visible' : 'collapse';
|
|
1315
1322
|
}
|
|
1316
1323
|
else {
|
|
1317
1324
|
this._reusableCalloutView = createInfoWindowView(marker.title, marker.subtitle);
|
package/markers/Marker.common.js
CHANGED
|
@@ -8,6 +8,7 @@ export function createInfoWindowView(title, snippet) {
|
|
|
8
8
|
view.width = 'auto'; // WRAP_CONTENT
|
|
9
9
|
view.height = 'auto'; // WRAP_CONTENT
|
|
10
10
|
view.borderRadius = 12;
|
|
11
|
+
view.color = new Color('#555');
|
|
11
12
|
view['shadowColor'] = '#000';
|
|
12
13
|
view['shadowOpacity'] = 0.25;
|
|
13
14
|
view['shadowRadius'] = 8;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nativescript-community/ui-mapbox",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.10",
|
|
4
4
|
"description": "Interactive, thoroughly customizable maps powered by vector tiles and OpenGL.",
|
|
5
5
|
"main": "index",
|
|
6
6
|
"typings": "index.d.ts",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@nativescript-community/perms": "^3.0.4"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "c43922d8db0e76946ab89655313a4acfc34a0d81"
|
|
59
59
|
}
|
|
@@ -592,7 +592,7 @@ public class MapboxBridge: NSObject {
|
|
|
592
592
|
guard let mv = mapView else { completion(false, NSError(domain: "MapboxBridge", code: 1, userInfo: [NSLocalizedDescriptionKey: "No map available"])); return }
|
|
593
593
|
mv.mapboxMap.onStyleLoaded.observeNext { _ in completion(true, nil) }.store(in: &cancelables)
|
|
594
594
|
mv.mapboxMap.loadStyle(getMapStyleURI(styleURIorURL));
|
|
595
|
-
completion(false, NSError(domain: "MapboxBridge", code: 2, userInfo: [NSLocalizedDescriptionKey: "Invalid style string"]))
|
|
595
|
+
// completion(false, NSError(domain: "MapboxBridge", code: 2, userInfo: [NSLocalizedDescriptionKey: "Invalid style string"]))
|
|
596
596
|
}
|
|
597
597
|
|
|
598
598
|
// MARK: - Camera / viewport / animateCamera
|
|
@@ -953,14 +953,14 @@ public class MapboxBridge: NSObject {
|
|
|
953
953
|
return true
|
|
954
954
|
|
|
955
955
|
}
|
|
956
|
-
@objc public func removePolygons(_ _ids: [String]?) {
|
|
957
|
-
guard let manager = polygonAnnotationManager else { return }
|
|
956
|
+
@objc public func removePolygons(_ _ids: [String]?) -> Bool {
|
|
957
|
+
guard let manager = polygonAnnotationManager else { return false }
|
|
958
958
|
guard let ids = _ids else {
|
|
959
959
|
manager.annotations.removeAll()
|
|
960
960
|
if let outlineManager = polygonOutlineAnnotationManager {
|
|
961
961
|
outlineManager.annotations.removeAll()
|
|
962
962
|
}
|
|
963
|
-
return
|
|
963
|
+
return true
|
|
964
964
|
}
|
|
965
965
|
// guard let data = idsJSON!.data(using: .utf8) else { return }
|
|
966
966
|
// guard let ids = try? JSONSerialization.jsonObject(with: data, options: []) as! [String] else { return }
|
|
@@ -977,18 +977,20 @@ public class MapboxBridge: NSObject {
|
|
|
977
977
|
if let outlineManager = polygonOutlineAnnotationManager {
|
|
978
978
|
outlineManager.annotations.removeAll { idSet.contains($0.id) }
|
|
979
979
|
}
|
|
980
|
+
return true
|
|
980
981
|
}
|
|
981
982
|
|
|
982
|
-
@objc public func removePolylines(_ _ids: [String]?) {
|
|
983
|
-
guard let manager = polylineAnnotationManager else { return }
|
|
983
|
+
@objc public func removePolylines(_ _ids: [String]?) -> Bool {
|
|
984
|
+
guard let manager = polylineAnnotationManager else { return false }
|
|
984
985
|
guard let ids = _ids else {
|
|
985
986
|
manager.annotations.removeAll()
|
|
986
|
-
return
|
|
987
|
+
return true
|
|
987
988
|
}
|
|
988
989
|
|
|
989
990
|
let idSet = Set<String>(ids)
|
|
990
991
|
|
|
991
992
|
manager.annotations.removeAll { idSet.contains($0.id) }
|
|
993
|
+
return true
|
|
992
994
|
}
|
|
993
995
|
|
|
994
996
|
enum GeoJSONSourceUpdateError: Error {
|
|
Binary file
|