@nativescript-community/ui-mapbox 7.0.7 → 7.0.9
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.android.d.ts +1 -1
- package/index.android.js +1 -1
- package/index.ios.js +30 -20
- package/package.json +2 -2
- package/platforms/ios/src/MapboxBridge.swift +9 -7
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.9](https://github.com/nativescript-community/ui-mapbox/compare/v7.0.8...v7.0.9) (2025-11-04)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **ios:** removed many unwanted error message (no actual error) ([f67277c](https://github.com/nativescript-community/ui-mapbox/commit/f67277c1ee0092eab4a2067b3d765c2aa2410246))
|
|
11
|
+
|
|
12
|
+
## [7.0.8](https://github.com/nativescript-community/ui-mapbox/compare/v7.0.7...v7.0.8) (2025-11-03)
|
|
13
|
+
|
|
14
|
+
**Note:** Version bump only for package @nativescript-community/ui-mapbox
|
|
15
|
+
|
|
6
16
|
## [7.0.7](https://github.com/nativescript-community/ui-mapbox/compare/v7.0.6...v7.0.7) (2025-10-30)
|
|
7
17
|
|
|
8
18
|
**Note:** Version bump only for package @nativescript-community/ui-mapbox
|
package/index.android.d.ts
CHANGED
|
@@ -372,7 +372,7 @@ export declare class Mapbox extends MapboxCommon implements MapboxApi {
|
|
|
372
372
|
*/
|
|
373
373
|
trackUser(options: TrackUserOptions, nativeMap?: any): Promise<void>;
|
|
374
374
|
private static getAndroidColor;
|
|
375
|
-
_getMapStyle(input
|
|
375
|
+
_getMapStyle(input?: string): any;
|
|
376
376
|
/**
|
|
377
377
|
* Mapbox Map Options
|
|
378
378
|
*
|
package/index.android.js
CHANGED
|
@@ -2588,7 +2588,7 @@ export class Mapbox extends MapboxCommon {
|
|
|
2588
2588
|
return android.graphics.Color.BLACK;
|
|
2589
2589
|
}
|
|
2590
2590
|
}
|
|
2591
|
-
_getMapStyle(input) {
|
|
2591
|
+
_getMapStyle(input = 'streets') {
|
|
2592
2592
|
if (Trace.isEnabled()) {
|
|
2593
2593
|
CLog(CLogTypes.info, '_getMapStyle(): top with input:', input);
|
|
2594
2594
|
}
|
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
|
-
|
|
1037
|
+
if (Trace.isEnabled()) {
|
|
1038
|
+
CLog(CLogTypes.info, 'setMapStyle():', style);
|
|
1039
|
+
}
|
|
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
|
});
|
|
@@ -1399,6 +1406,9 @@ export class Mapbox extends MapboxCommon {
|
|
|
1399
1406
|
const marker = this._markers.find((m) => `${m.id}` === markerId);
|
|
1400
1407
|
if (!marker)
|
|
1401
1408
|
return;
|
|
1409
|
+
if (!!marker.onTap?.(marker)) {
|
|
1410
|
+
return;
|
|
1411
|
+
}
|
|
1402
1412
|
if (marker === this.selectedMarker) {
|
|
1403
1413
|
this.deselectMarker(marker);
|
|
1404
1414
|
}
|
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.9",
|
|
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": "997b1bd2abe92b1e9e4871ff58e2dc5f50513b79"
|
|
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 {
|