@nativescript-community/ui-mapbox 7.0.14 → 7.0.18

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,22 @@
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.18](https://github.com/nativescript-community/ui-mapbox/compare/v7.0.17...v7.0.18) (2026-03-11)
7
+
8
+ **Note:** Version bump only for package @nativescript-community/ui-mapbox
9
+
10
+ ## [7.0.17](https://github.com/nativescript-community/ui-mapbox/compare/v7.0.14...v7.0.17) (2026-03-11)
11
+
12
+ **Note:** Version bump only for package @nativescript-community/ui-mapbox
13
+
14
+ ## [7.0.16](https://github.com/nativescript-community/ui-mapbox/compare/v7.0.15...v7.0.16) (2026-03-11)
15
+
16
+ **Note:** Version bump only for package @nativescript-community/ui-mapbox
17
+
18
+ ## [7.0.15](https://github.com/nativescript-community/ui-mapbox/compare/v7.0.14...v7.0.15) (2026-03-10)
19
+
20
+ **Note:** Version bump only for package @nativescript-community/ui-mapbox
21
+
6
22
  ## [7.0.14](https://github.com/nativescript-community/ui-mapbox/compare/v7.0.13...v7.0.14) (2026-01-23)
7
23
 
8
24
  **Note:** Version bump only for package @nativescript-community/ui-mapbox
@@ -132,6 +132,7 @@ export declare class Mapbox extends MapboxCommon implements MapboxApi {
132
132
  [k: string]: ImageSource;
133
133
  };
134
134
  constructor(view: any);
135
+ getMapInstance(): com.mapbox.maps.MapboxMap;
135
136
  /**
136
137
  * not used
137
138
  */
@@ -153,7 +154,6 @@ export declare class Mapbox extends MapboxCommon implements MapboxApi {
153
154
  *
154
155
  * @see MapboxView::init()
155
156
  *
156
- * @todo FIXME: the timeout delay before showing the map works around some race condition. The source error needs to be figured out.
157
157
  */
158
158
  show(options: ShowOptions): Promise<ShowResult>;
159
159
  /**
@@ -323,7 +323,7 @@ export declare class Mapbox extends MapboxCommon implements MapboxApi {
323
323
  /**
324
324
  * remove source by id
325
325
  */
326
- removeSource(id: string, nativeMap?: any): Promise<void>;
326
+ removeSource(id: string, nativeMap?: com.mapbox.maps.MapboxMap): Promise<void>;
327
327
  /**
328
328
  * a rough analogue to the mapbox-gl-js addLayer() method
329
329
  *
@@ -350,7 +350,7 @@ export declare class Mapbox extends MapboxCommon implements MapboxApi {
350
350
  *
351
351
  * @param {string} id
352
352
  */
353
- removeLayer(id: string, nativeMap?: any): Promise<void>;
353
+ removeLayer(id: string, nativeMap?: com.mapbox.maps.MapboxMap): Promise<void>;
354
354
  private getSource;
355
355
  /**
356
356
  * @deprecated
package/index.android.js CHANGED
@@ -129,7 +129,7 @@ export class MapboxView extends MapboxViewBase {
129
129
  this.settings = settings;
130
130
  }
131
131
  getNativeMapView() {
132
- return this.nativeMapView;
132
+ return this.mapbox.getMapInstance();
133
133
  }
134
134
  /**
135
135
  * Return the Mapbox() API Shim instance
@@ -383,6 +383,9 @@ export class Mapbox extends MapboxCommon {
383
383
  CLog(CLogTypes.info, 'constructor(): end of Mapbox constructor.');
384
384
  }
385
385
  }
386
+ getMapInstance() {
387
+ return this._mapboxMapInstance;
388
+ }
386
389
  /**
387
390
  * not used
388
391
  */
@@ -404,7 +407,6 @@ export class Mapbox extends MapboxCommon {
404
407
  *
405
408
  * @see MapboxView::init()
406
409
  *
407
- * @todo FIXME: the timeout delay before showing the map works around some race condition. The source error needs to be figured out.
408
410
  */
409
411
  async show(options) {
410
412
  return new Promise((resolve, reject) => {
@@ -572,9 +574,6 @@ export class Mapbox extends MapboxCommon {
572
574
  if (Trace.isEnabled()) {
573
575
  CLog(CLogTypes.info, 'show(): showIt() bottom');
574
576
  }
575
- // };
576
- // FIXME: There is some initialization error. A short delay works around this.
577
- // setTimeout(showIt, settings.delay ? settings.delay : 200);
578
577
  }
579
578
  catch (ex) {
580
579
  if (Trace.isEnabled()) {
@@ -2210,6 +2209,7 @@ export class Mapbox extends MapboxCommon {
2210
2209
  addSource(id, options, nativeMap) {
2211
2210
  return new Promise((resolve, reject) => {
2212
2211
  try {
2212
+ console.log('addSource', nativeMap, this._mapboxMapInstance, new Error().stack);
2213
2213
  const theMap = nativeMap || this._mapboxMapInstance;
2214
2214
  let source;
2215
2215
  if (!theMap) {
@@ -2351,7 +2351,7 @@ export class Mapbox extends MapboxCommon {
2351
2351
  reject('No map has been loaded');
2352
2352
  return;
2353
2353
  }
2354
- const isRemoved = theMap.getStyle().removeSource(id);
2354
+ const isRemoved = theMap.getStyle().removeStyleSource(id);
2355
2355
  if (!isRemoved) {
2356
2356
  reject(`Could not remove source with id: ${id}`);
2357
2357
  }
@@ -2400,12 +2400,12 @@ export class Mapbox extends MapboxCommon {
2400
2400
  if (belowLayerId) {
2401
2401
  // TODO: missing extension typings
2402
2402
  //@ts-ignore
2403
- this._mapboxMapInstance.getStyle().addLayerBelow(layer.getNativeInstance(), belowLayerId);
2403
+ theMap.getStyle().addLayerBelow(layer.getNativeInstance(), belowLayerId);
2404
2404
  }
2405
2405
  else {
2406
2406
  // TODO: missing extension typings
2407
2407
  //@ts-ignore
2408
- this._mapboxMapInstance.getStyle().addLayer(layer.getNativeInstance());
2408
+ theMap.getStyle().addLayer(layer.getNativeInstance());
2409
2409
  }
2410
2410
  }
2411
2411
  /**
@@ -2417,12 +2417,13 @@ export class Mapbox extends MapboxCommon {
2417
2417
  */
2418
2418
  async removeLayer(id, nativeMap) {
2419
2419
  const theMap = nativeMap || this._mapboxMapInstance;
2420
- theMap.getStyle().removeLayer(id);
2420
+ theMap.getStyle().removeStyleLayer(id);
2421
2421
  if (Trace.isEnabled()) {
2422
2422
  CLog(CLogTypes.info, 'Mapbox:removeLayer(): after removing layer');
2423
2423
  }
2424
2424
  }
2425
2425
  getSource(sId, mapboxInstance = this._mapboxMapInstance) {
2426
+ console.log('getSource', mapboxInstance);
2426
2427
  // TODO: missing extension typings
2427
2428
  //@ts-ignore
2428
2429
  return mapboxInstance.getStyle().getSource(sId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nativescript-community/ui-mapbox",
3
- "version": "7.0.14",
3
+ "version": "7.0.18",
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": "3e23d536dc1c613271a2c1f98c7c13cf544c2285"
58
+ "gitHead": "06d0853534ec79c7921b53bc7b5ae2c15bba0c36"
59
59
  }