@nativescript-community/ui-mapbox 7.0.12 → 7.0.14

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 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.14](https://github.com/nativescript-community/ui-mapbox/compare/v7.0.13...v7.0.14) (2026-01-23)
7
+
8
+ **Note:** Version bump only for package @nativescript-community/ui-mapbox
9
+
10
+ ## [7.0.13](https://github.com/nativescript-community/ui-mapbox/compare/v7.0.12...v7.0.13) (2026-01-21)
11
+
12
+ ### Bug Fixes
13
+
14
+ * **ios:** events not being fired ([b04b976](https://github.com/nativescript-community/ui-mapbox/commit/b04b976111971abecbce713ab77191b19c2ecc84))
15
+
6
16
  ## [7.0.12](https://github.com/nativescript-community/ui-mapbox/compare/v7.0.11...v7.0.12) (2025-11-12)
7
17
 
8
18
  ### Bug Fixes
@@ -161,7 +161,7 @@ export declare class Mapbox extends MapboxCommon implements MapboxApi {
161
161
  */
162
162
  hide(): Promise<void>;
163
163
  unhide(): Promise<void>;
164
- destroy(nativeMap?: any): Promise<void>;
164
+ destroy(nativeMap?: com.mapbox.maps.MapboxMap): Promise<void>;
165
165
  /**
166
166
  * Clear Event Listeners
167
167
  *
@@ -171,9 +171,9 @@ export declare class Mapbox extends MapboxCommon implements MapboxApi {
171
171
  * idea to remove these handlers explicitly.
172
172
  */
173
173
  private clearEventListeners;
174
- onStart(nativeMap?: any): Promise<void>;
175
- onStop(nativeMap?: any): Promise<void>;
176
- onDestroy(nativeMap?: any): Promise<void>;
174
+ onStart(nativeMap?: com.mapbox.maps.MapboxMap): Promise<void>;
175
+ onStop(nativeMap?: com.mapbox.maps.MapboxMap): Promise<void>;
176
+ onDestroy(nativeMap?: com.mapbox.maps.MapboxMap): Promise<void>;
177
177
  /**
178
178
  * event handler shim
179
179
  *
@@ -235,21 +235,21 @@ export declare class Mapbox extends MapboxCommon implements MapboxApi {
235
235
  * @link https://docs.mapbox.com/android/api/map-sdk/7.1.2/com/mapbox/mapboxsdk/maps/MapboxMap.html#setStyle-java.lang.String-com.mapbox.maps.Style.OnStyleLoaded-
236
236
  */
237
237
  setMapStyle(style: string | MapStyle, nativeMapViewInstance?: any): Promise<void>;
238
- getImage(imageId: string, nativeMap?: any): Promise<ImageSource>;
239
- addImage(imageId: string, imagePath: string, nativeMap?: any): Promise<void>;
240
- removeImage(imageId: string, nativeMap?: any): Promise<void>;
238
+ getImage(imageId: string, nativeMap?: com.mapbox.maps.MapboxMap): Promise<ImageSource>;
239
+ addImage(imageId: string, imagePath: string, nativeMap?: com.mapbox.maps.MapboxMap): Promise<void>;
240
+ removeImage(imageId: string, nativeMap?: com.mapbox.maps.MapboxMap): Promise<void>;
241
241
  /**
242
242
  *
243
243
  * @deprecated
244
244
  * @link https://github.com/mapbox/mapbox-plugins-android/tree/master/plugin-annotation
245
245
  */
246
- addMarkers(markers: MapboxMarker[], nativeMap?: any): Promise<void>;
246
+ addMarkers(markers: MapboxMarker[], nativeMap?: com.mapbox.maps.MapboxMap): Promise<void>;
247
247
  /**
248
248
  *
249
249
  * @deprecated
250
250
  * @link https://github.com/mapbox/mapbox-plugins-android/tree/master/plugin-annotation
251
251
  */
252
- removeMarkers(ids?: any, nativeMap?: any): Promise<void>;
252
+ removeMarkers(ids?: any, nativeMap?: com.mapbox.maps.MapboxMap): Promise<void>;
253
253
  iconCache: {
254
254
  [k: string]: ImageSource;
255
255
  };
@@ -289,7 +289,7 @@ export declare class Mapbox extends MapboxCommon implements MapboxApi {
289
289
  removePolygons(ids?: any[], nativeMap?: any): Promise<void>;
290
290
  removePolylines(ids?: any[], nativeMap?: any): Promise<void>;
291
291
  animateCamera(options: AnimateCameraOptions, nativeMap?: any): Promise<void>;
292
- setOnMapClickListener(listener: (data: LatLng) => boolean, nativeMap?: any): Promise<void>;
292
+ setOnMapClickListener(listener: (data: LatLng) => boolean, nativeMap?: com.mapbox.maps.MapboxMap): Promise<void>;
293
293
  setOnMapLongClickListener(listener: (data: LatLng) => boolean, nativeMap?: any): Promise<void>;
294
294
  setOnMoveBeginListener(listener: (data?: LatLng) => void, nativeMap?: any): Promise<void>;
295
295
  setOnMoveEndListener(listener: (data?: LatLng) => void, nativeMap?: any): Promise<void>;
@@ -451,8 +451,8 @@ export declare class Mapbox extends MapboxCommon implements MapboxApi {
451
451
  * @todo figure out why the user location marker is not updating.
452
452
  */
453
453
  forceUserLocationUpdate(location: any, nativeMap?: any): Promise<void>;
454
- getLayer(name: string, nativeMap?: any): Promise<LayerCommon>;
455
- getLayers(nativeMap?: any): Promise<LayerCommon[]>;
454
+ getLayer(name: string, nativeMap?: com.mapbox.maps.MapboxMap): Promise<LayerCommon>;
455
+ getLayers(nativeMap?: com.mapbox.maps.MapboxMap): Promise<LayerCommon[]>;
456
456
  _getClickedMarkerDetails(clicked: AndroidMarker): MapboxMarker;
457
457
  _downloadImage(marker: MapboxMarker): Promise<MapboxMarker>;
458
458
  _downloadMarkerImages(markers: MapboxMarker[]): Promise<MapboxMarker[]>;
package/index.android.js CHANGED
@@ -971,9 +971,14 @@ export class Mapbox extends MapboxCommon {
971
971
  return;
972
972
  }
973
973
  try {
974
- const nativeImage = theMap.getStyle().getImage(imageId);
975
- const img = new ImageSource(nativeImage);
976
- resolve(img);
974
+ const nativeImage = theMap.getStyle().getStyleImage(imageId);
975
+ if (nativeImage) {
976
+ const img = new ImageSource(nativeImage);
977
+ resolve(img);
978
+ }
979
+ else {
980
+ resolve(null);
981
+ }
977
982
  }
978
983
  catch (ex) {
979
984
  reject('Error during getImage: ' + ex);
@@ -993,7 +998,10 @@ export class Mapbox extends MapboxCommon {
993
998
  }
994
999
  try {
995
1000
  const imageSource = await this.fetchImageSource(imagePath);
996
- theMap.getStyle().addImage(imageId, imageSource.android);
1001
+ const ImageExtensionImpl = com.mapbox.maps.extension.style.image.ImageExtensionImpl;
1002
+ const imageBuilder = new ImageExtensionImpl.Builder(imageId, imageSource.android);
1003
+ const image = imageBuilder.build();
1004
+ image.bindTo(theMap.getStyle());
997
1005
  resolve();
998
1006
  }
999
1007
  catch (ex) {
@@ -1013,7 +1021,7 @@ export class Mapbox extends MapboxCommon {
1013
1021
  return;
1014
1022
  }
1015
1023
  try {
1016
- theMap.getStyle().removeImage(imageId);
1024
+ theMap.getStyle().removeStyleImage(imageId);
1017
1025
  resolve();
1018
1026
  }
1019
1027
  catch (ex) {
package/index.ios.js CHANGED
@@ -1270,38 +1270,13 @@ export class Mapbox extends MapboxCommon {
1270
1270
  return new Promise((resolve, reject) => {
1271
1271
  try {
1272
1272
  const b = nativeMap ? MapboxBridge.bridgeFor(nativeMap) : this.bridgeInstance;
1273
- if (!b || !b.getImage) {
1273
+ if (!b) {
1274
1274
  resolve(null);
1275
1275
  return;
1276
1276
  }
1277
1277
  // The native bridge now returns a UIImage (native iOS object) or null.
1278
1278
  const nativeImage = b.getImage(imageId);
1279
- if (!nativeImage) {
1280
- resolve(null);
1281
- return;
1282
- }
1283
- // Wrap the native UIImage into a NativeScript ImageSource
1284
- try {
1285
- // ImageSource.fromNativeSource accepts a native UIImage on iOS
1286
- const imgSrc = new ImageSource(nativeImage);
1287
- resolve(imgSrc || null);
1288
- }
1289
- catch (err) {
1290
- // As a fallback, if the bridge returns base64 string (older fallback), try decode
1291
- try {
1292
- const maybeBase64 = nativeImage;
1293
- if (typeof maybeBase64 === 'string') {
1294
- const src = ImageSource.fromBase64Sync ? ImageSource.fromBase64Sync(maybeBase64) : ImageSource.fromBase64(maybeBase64);
1295
- resolve(src || null);
1296
- }
1297
- else {
1298
- resolve(null);
1299
- }
1300
- }
1301
- catch (e) {
1302
- resolve(null);
1303
- }
1304
- }
1279
+ resolve(nativeImage ? new ImageSource(nativeImage) : null);
1305
1280
  }
1306
1281
  catch (ex) {
1307
1282
  reject(ex);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nativescript-community/ui-mapbox",
3
- "version": "7.0.12",
3
+ "version": "7.0.14",
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": "594cf940edc6d9adc7944567379a2d42b871b231"
58
+ "gitHead": "3e23d536dc1c613271a2c1f98c7c13cf544c2285"
59
59
  }
@@ -93,7 +93,7 @@ public class MapboxBridge: NSObject {
93
93
  }
94
94
  }
95
95
  public func postEvent(_ event: String) {
96
- NotificationCenter.default.post(name: Notification.Name(MapboxBridge.CameraMoveCancelNotification), object: self.mapView)
96
+ NotificationCenter.default.post(name: Notification.Name(event), object: self.mapView)
97
97
  }
98
98
 
99
99
  // Notification constants