@nativescript-community/ui-mapbox 7.0.0-alpha.14.3191a7b → 7.0.0

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,13 @@
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.0](https://github.com/nativescript-community/ui-mapbox/compare/v6.2.31...v7.0.0) (2025-10-25)
7
+
8
+ ### Features
9
+
10
+ * **android:** plugin updated to v11 (not retro compat!) ([9b98b79](https://github.com/nativescript-community/ui-mapbox/commit/9b98b79cb9a0cf2474ac6336e754370940a29d2d))
11
+ * **ios:** updated SDK to v11+ ([fc9af79](https://github.com/nativescript-community/ui-mapbox/commit/fc9af79a296019fa8c44e4b019826b524c19af72))
12
+
6
13
  ## [6.2.31](https://github.com/nativescript-community/ui-mapbox/compare/v6.2.30...v6.2.31) (2024-10-04)
7
14
 
8
15
  **Note:** Version bump only for package @nativescript-community/ui-mapbox
package/common.d.ts CHANGED
@@ -96,7 +96,7 @@ export interface MapboxMarker extends LatLng {
96
96
  /**
97
97
  * Set this in case you want to later pass it to 'removeMarker'.
98
98
  */
99
- id?: any;
99
+ id?: number;
100
100
  title?: string;
101
101
  subtitle?: string;
102
102
  /**
@@ -195,6 +195,10 @@ export interface MapboxCluster {
195
195
  color: string;
196
196
  }
197
197
  export interface AddGeoJsonClusteredOptions {
198
+ id: any;
199
+ url: any;
200
+ pointColor: string;
201
+ pointRadius: number;
198
202
  /**
199
203
  * A unique identifier, like: "earthquakes"
200
204
  */
@@ -264,6 +268,7 @@ export interface VectorSource extends Source {
264
268
  tileSize?: number;
265
269
  }
266
270
  export interface GeoJSONSource extends Source {
271
+ url: any;
267
272
  type: 'geojson';
268
273
  data?: any;
269
274
  minzoom?: number;
@@ -287,6 +292,12 @@ export interface TrackUserOptions {
287
292
  animated?: boolean;
288
293
  }
289
294
  export interface AddExtrusionOptions {
295
+ id?: string;
296
+ source?: string;
297
+ sourceLayer?: string;
298
+ minZoom?: any;
299
+ color?: string;
300
+ opacity?: any;
290
301
  }
291
302
  export interface OfflineRegion {
292
303
  name: string;
@@ -310,6 +321,7 @@ export interface DownloadProgress {
310
321
  completedSize?: number;
311
322
  }
312
323
  export interface DownloadOfflineRegionOptions extends OfflineRegion {
324
+ styleUrl: any;
313
325
  onProgress?: (data: DownloadProgress) => void;
314
326
  /**
315
327
  * Optional, used on Android only.
@@ -546,8 +558,12 @@ export declare abstract class MapboxCommon implements MapboxCommonApi {
546
558
  constructor(view?: MapboxViewCommonBase);
547
559
  static defaults: Partial<ShowOptions>;
548
560
  static merge(obj1: {}, obj2: {}): any;
549
- requestFineLocationPermission(): Promise<any>;
550
561
  hasFineLocationPermission(): Promise<boolean>;
562
+ /**
563
+ * Request fine locaion permission
564
+ *
565
+ */
566
+ requestFineLocationPermission(): Promise<import("@nativescript-community/perms").Status>;
551
567
  protected fetchImageSource(imagePath: string): Promise<ImageSource>;
552
568
  }
553
569
  /**
package/common.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { check, request } from '@nativescript-community/perms';
1
2
  import { ContentView, ImageSource, Property, Trace, Utils, booleanConverter } from '@nativescript/core';
2
3
  export * from './geo.utils';
3
4
  export * from './expression/expression-parser';
@@ -61,9 +62,15 @@ export class MapboxCommon {
61
62
  }
62
63
  return result;
63
64
  }
64
- async requestFineLocationPermission() { }
65
65
  async hasFineLocationPermission() {
66
- return true;
66
+ return (await check('location')) === 'authorized';
67
+ }
68
+ /**
69
+ * Request fine locaion permission
70
+ *
71
+ */
72
+ async requestFineLocationPermission() {
73
+ return request('location');
67
74
  }
68
75
  async fetchImageSource(imagePath) {
69
76
  if (Utils.isDataURI(imagePath)) {
@@ -1,4 +1,4 @@
1
1
  export declare class ExpressionParser {
2
- static parseJson(json: any[]): NSPredicate;
3
- static toJson(filter: NSPredicate): any[];
2
+ static parseJson(json: any[]): any;
3
+ static toJson(filter: any): any[] | null;
4
4
  }
@@ -1,22 +1,37 @@
1
+ // src/ui-mapbox/expression-parser.ios.ts
2
+ // TypeScript shim that exports ExpressionParser (TS API) while delegating to native NativeExpressionParser when available.
1
3
  export class ExpressionParser {
4
+ // Return native predicate object (opaque) if native parser available, otherwise return the expression JSON.
2
5
  static parseJson(json) {
3
- const filterStr = NSString.stringWithString(JSON.stringify(json));
4
- const filterData = filterStr.dataUsingEncoding(NSUTF8StringEncoding);
5
- const filterJson = NSJSONSerialization.JSONObjectWithDataOptionsError(filterData, 1 /* NSJSONReadingOptions.MutableContainers */);
6
- const predicateFilter = NSPredicate.predicateWithMGLJSONObject(filterJson);
7
- return predicateFilter;
6
+ try {
7
+ if (global.NativeExpressionParser && global.NativeExpressionParser.parseJson) {
8
+ const res = global.NativeExpressionParser.parseJson(json);
9
+ if (res)
10
+ return res;
11
+ }
12
+ }
13
+ catch (e) {
14
+ // ignore and fallback
15
+ }
16
+ return json;
8
17
  }
18
+ // Try to convert native predicate back to JSON expression. Returns array or null.
9
19
  static toJson(filter) {
10
- if (!filter) {
11
- return null;
20
+ try {
21
+ if (!filter)
22
+ return null;
23
+ if (Array.isArray(filter))
24
+ return filter;
25
+ if (global.NativeExpressionParser && global.NativeExpressionParser.toJson) {
26
+ const res = global.NativeExpressionParser.toJson(filter);
27
+ if (res)
28
+ return res;
29
+ }
12
30
  }
13
- if (!(filter instanceof NSPredicate)) {
14
- throw new Error('Filter must be a NSPredicate.');
31
+ catch (e) {
32
+ // ignore
15
33
  }
16
- const expressionObj = filter.mgl_jsonExpressionObject;
17
- const data = NSJSONSerialization.dataWithJSONObjectOptionsError(expressionObj, 0);
18
- const expression = NSString.alloc().initWithDataEncoding(data, NSUTF8StringEncoding);
19
- return JSON.parse(expression);
34
+ return null;
20
35
  }
21
36
  }
22
37
  //# sourceMappingURL=expression-parser.ios.js.map
@@ -223,13 +223,6 @@ export declare class Mapbox extends MapboxCommon implements MapboxApi {
223
223
  * an invoke any registered callbacks.
224
224
  */
225
225
  private handleLineClickEvent;
226
- hasFineLocationPermission(): Promise<boolean>;
227
- /**
228
- * Request fine locaion permission
229
- *
230
- * @link https://docs.mapbox.com/android/core/overview/#permissionsmanager
231
- */
232
- requestFineLocationPermission(): Promise<import("@nativescript-community/perms").Result>;
233
226
  /**
234
227
  * set the map style
235
228
  *
package/index.android.js CHANGED
@@ -3,7 +3,6 @@
3
3
  *
4
4
  * @todo FIXME: The gcFix() implementation currently assumes only one map visible at a time.
5
5
  */
6
- import { request } from '@nativescript-community/perms';
7
6
  import { Application, Color, File, Http, ImageSource, Trace, Utils, knownFolders, path } from '@nativescript/core';
8
7
  import { ExpressionParser } from './expression/expression-parser';
9
8
  import { Layer, LayerFactory } from './layers/layer-factory';
@@ -937,27 +936,6 @@ export class Mapbox extends MapboxCommon {
937
936
  } // end of for loop over events.
938
937
  return false;
939
938
  }
940
- hasFineLocationPermission() {
941
- return new Promise((resolve, reject) => {
942
- try {
943
- resolve(this._fineLocationPermissionGranted());
944
- }
945
- catch (ex) {
946
- if (Trace.isEnabled()) {
947
- CLog(CLogTypes.info, 'Error in mapbox.hasFineLocationPermission: ' + ex);
948
- }
949
- reject(ex);
950
- }
951
- });
952
- }
953
- /**
954
- * Request fine locaion permission
955
- *
956
- * @link https://docs.mapbox.com/android/core/overview/#permissionsmanager
957
- */
958
- async requestFineLocationPermission() {
959
- return request('location');
960
- }
961
939
  /**
962
940
  * set the map style
963
941
  *
@@ -2423,7 +2401,6 @@ export class Mapbox extends MapboxCommon {
2423
2401
  source = this.getSource(style.source, theMap);
2424
2402
  }
2425
2403
  const layer = await LayerFactory.createLayer(style, source);
2426
- console.log('addLayer', layer.getNativeInstance());
2427
2404
  if (belowLayerId) {
2428
2405
  // TODO: missing extension typings
2429
2406
  //@ts-ignore
package/index.ios.d.ts CHANGED
@@ -1,285 +1,112 @@
1
- import { ImageSource } from '@nativescript/core';
2
- import { AddExtrusionOptions, AddGeoJsonClusteredOptions, AddPolygonOptions, AddPolylineOptions, AddSourceOptions, AnimateCameraOptions, DeleteOfflineRegionOptions, DownloadOfflineRegionOptions, Feature, LatLng, LayerCommon, ListOfflineRegionsOptions, MapStyle, MapboxApi, MapboxCommon, MapboxMarker, MapboxViewBase, OfflineRegion, QueryRenderedFeaturesOptions, QuerySourceFeaturesOptions, SetCenterOptions, SetTiltOptions, SetViewportOptions, SetZoomLevelOptions, ShowOptions, TrackUserOptions, UpdateSourceOptions, UserLocation, UserLocationCameraMode, Viewport, telemetryProperty } from './common';
1
+ import { ImageSource, StackLayout } from '@nativescript/core';
2
+ import { AddExtrusionOptions, AddGeoJsonClusteredOptions, AddPolygonOptions, AddPolylineOptions, AddSourceOptions, AnimateCameraOptions, DeleteOfflineRegionOptions, DownloadOfflineRegionOptions, Feature, LatLng, ListOfflineRegionsOptions, MapStyle, MapboxApi, MapboxCommon, MapboxMarker, MapboxViewBase, OfflineRegion, QueryRenderedFeaturesOptions, QuerySourceFeaturesOptions, SetCenterOptions, SetViewportOptions, SetZoomLevelOptions, ShowOptions, TrackUserOptions, UpdateSourceOptions, UserLocation, telemetryProperty } from './common';
3
3
  export * from './common';
4
- export declare function setLogLevel(level: 'none' | 'info' | 'debug' | 'error' | 'fault' | 'verbose'): void;
5
- /**
6
- * Map View Class instantiated from XML
7
- *
8
- * This class is created by the NativeScript XML view parsing
9
- * code.
10
- */
11
4
  export declare class MapboxView extends MapboxViewBase {
12
5
  [telemetryProperty.setNative]: (value: boolean) => void;
13
6
  private nativeMapView;
14
- private delegate;
15
7
  mapbox: Mapbox;
16
8
  private settings;
17
9
  private initialized;
18
10
  private initCountHack;
19
- /**
20
- * programmatically include settings
21
- */
22
11
  setConfig(settings: any): void;
23
12
  getNativeMapView(): any;
24
13
  createNativeView(): object;
25
- /**
26
- * init the native view.
27
- *
28
- * FIXME: It appears that the order of events is different between iOS and Android.
29
- * In the demo under Android, the main-page event handler is called first then the one
30
- * in the plugin. Under iOS it's the reverse.
31
- *
32
- * The symptom is that any properties that reference a binding aren't available
33
- * at the time this method is called. For example {{access_token}}.
34
- *
35
- * I'm sure there is something I do not understand about how this is supposed to work
36
- * and that the handstands below are not necessary.
37
- */
38
14
  onLoaded(): void;
39
15
  initNativeView(): void;
40
- /**
41
- * when the view is destroyed.
42
- *
43
- * This is called by the framework when the view is destroyed (made not visible).
44
- *
45
- * However, it does not seem to be called when the page is unloaded.
46
- *
47
- * @link https://docs.nativescript.org/plugins/ui-plugin-custom
48
- */
49
16
  disposeNativeView(): Promise<void>;
50
- /**
51
- * returns a reference to the class Mapbox API shim instance
52
- *
53
- * @see Mapbox
54
- */
55
17
  getMapboxApi(): any;
56
- /**
57
- * initialize the map
58
- *
59
- * @see MGLMapViewDelegateImpl
60
- *
61
- * @todo FIXME: figure out why the accessToken property (which is using a binding in the demo XML) isn't set before we arrive here.
62
- */
63
18
  initMap(): void;
64
19
  onLayout(left: number, top: number, right: number, bottom: number): void;
65
20
  }
66
21
  export declare class Mapbox extends MapboxCommon implements MapboxApi {
67
22
  private _mapboxViewInstance;
23
+ private bridgeInstance;
68
24
  private eventCallbacks;
69
- private userLocationRenderMode;
70
- /**
71
- * set the mapboxViewInstance
72
- *
73
- * @see MapboxView::initMap();
74
- */
75
- setMapboxViewInstance(mapboxViewInstance: any): void;
76
- /**
77
- * event handler shim
78
- *
79
- * Initialize our event handler shim so that we can intercept events here.
80
- *
81
- * @param { MapboxView } mapboxView
82
- */
83
- initEventHandlerShim(settings: any, mapboxNativeViewInstance: any): void;
84
- /**
85
- * register a map event handler
86
- *
87
- * The NativeScript ContentView base class as on() and off() methods.
88
- */
89
- onMapEvent(eventName: any, id: any, callback: any, nativeMapView?: any): void;
90
- offMapEvent(eventName: any, id: any, nativeMapView?: any): void;
91
- /**
92
- * If click events registered and a feature found for the event, then fire listener.
93
- */
25
+ private _markers;
26
+ private _observerTokens;
27
+ _reusableCalloutView: StackLayout;
28
+ private _programmaticMapView;
29
+ setMapboxViewInstance(m: any): void;
30
+ onMapEvent(eventName: string, id: string, callback: any, nativeMapView?: any): void;
31
+ offMapEvent(eventName: string, id: string, nativeMapView?: any): void;
94
32
  private checkForClickEvent;
95
- private _addMarkers;
96
- /**
97
- * create an display the map
98
- *
99
- * @todo FIXME: This method is not called. See MapboxView::initMap().
100
- */
33
+ initEventHandlerShim(settings: any, mapboxNativeViewInstance: any): void;
101
34
  show(options: ShowOptions): Promise<any>;
102
35
  hide(): Promise<void>;
103
36
  unhide(): Promise<void>;
104
37
  destroy(nativeMap?: any): Promise<void>;
105
- onStart(nativeMap?: any): Promise<void>;
106
- onResume(nativeMap?: any): Promise<void>;
107
- onPause(nativeMap?: any): Promise<void>;
108
- onStop(nativeMap?: any): Promise<void>;
109
- onLowMemory(nativeMap?: any): Promise<void>;
110
- onDestroy(nativeMap?: any): Promise<void>;
111
- /**
112
- * explicitly set a map style
113
- */
114
- setMapStyle(style: string | MapStyle, nativeMap?: any): Promise<void>;
115
- getImage(imageId: string, nativeMap?: any): Promise<ImageSource>;
116
38
  addImage(imageId: string, imagePath: string, nativeMap?: any): Promise<void>;
117
39
  removeImage(imageId: string, nativeMap?: any): Promise<void>;
118
40
  addMarkers(markers: MapboxMarker[], nativeMap?: any): Promise<void>;
41
+ selectedMarker: MapboxMarker;
42
+ deselectMarker(marker: MapboxMarker): Promise<void>;
43
+ selectMarker(marker: MapboxMarker): Promise<void>;
119
44
  removeMarkers(ids?: any, nativeMap?: any): Promise<void>;
45
+ updateMarkerPosition(markerId: string, lat: number, lng: number, nativeMap?: any): Promise<void>;
46
+ addPolyline(options: AddPolylineOptions, nativeMap?: any): Promise<void>;
47
+ addLinePoint(id: string, lnglat: any, sourceId?: string, nativeMap?: any): Promise<void>;
48
+ removePolylines(ids?: string[], nativeMap?: any): Promise<void>;
49
+ addPolygon(options: AddPolygonOptions, nativeMap?: any): Promise<void>;
50
+ removePolygons(ids?: string[], nativeMap?: any): Promise<void>;
51
+ addGeoJsonClustered(options: AddGeoJsonClusteredOptions, nativeMap?: any): Promise<void>;
52
+ addExtrusion(options: AddExtrusionOptions, nativeMap?: any): Promise<void>;
120
53
  setCenter(options: SetCenterOptions, nativeMap?: any): Promise<void>;
121
54
  getCenter(nativeMap?: any): Promise<LatLng>;
122
55
  setZoomLevel(options: SetZoomLevelOptions, nativeMap?: any): Promise<void>;
123
56
  getZoomLevel(nativeMap?: any): Promise<number>;
124
- setTilt(options: SetTiltOptions, nativeMap?: any): Promise<void>;
125
- getTilt(nativeMap?: any): Promise<number>;
126
- getUserLocation(nativeMap?: any): Promise<UserLocation>;
127
- /**
128
- * convert string to camera mode constant.
129
- *
130
- * Supported modes on iOS are different than on Android.
131
- *
132
- * @todo come up with a reasonable set of cross platform defaults.
133
- */
134
- _stringToCameraMode(mode: UserLocationCameraMode): any;
135
- _stringToRenderMode(mode: any): any;
136
- _convertCameraMode(mode: MGLUserTrackingMode): UserLocationCameraMode;
137
- /**
138
- * show a user location marker
139
- *
140
- * This method must not be called before location permissions have been granted.
141
- *
142
- * Supported options under iOS are:
143
- *
144
- * - renderMode
145
- * - cameraMode
146
- * - clickListener
147
- *
148
- * Other options are ignored. Compare with the android version that supports a
149
- * different set of options.
150
- *
151
- * @param {object} options
152
- */
153
- showUserLocationMarker(options: any, nativeMap?: any): Promise<void>;
154
- /**
155
- * hide the user location marker
156
- *
157
- * @todo unfinished
158
- */
159
- hideUserLocationMarker(nativeMap?: any): Promise<void>;
160
- /**
161
- * Change the mode of the user location marker
162
- *
163
- * Used to change the camera tracking and render modes of an existing
164
- * marker.
165
- *
166
- * The marker must be configured using showUserLocationMarker before this method
167
- * can called.
168
- */
169
- changeUserLocationMarkerMode(renderModeString: any, cameraModeString: UserLocationCameraMode, nativeMap?: any): Promise<void>;
170
- /**
171
- * ignored on iOS
172
- */
173
- forceUserLocationUpdate(location: any, nativeMap?: any): void;
57
+ setMapStyle(style: string | MapStyle, nativeMap?: any): Promise<void>;
58
+ animateCamera(options: AnimateCameraOptions, nativeMap?: any): Promise<void>;
174
59
  queryRenderedFeatures(options: QueryRenderedFeaturesOptions, nativeMap?: any): Promise<Feature[]>;
175
60
  querySourceFeatures(sourceId: string, options?: QuerySourceFeaturesOptions, nativeMap?: any): Promise<Feature[]>;
176
- /**
177
- * @deprecated
178
- */
179
- addPolygon(options: AddPolygonOptions, nativeMap?: any): Promise<void>;
180
- addPolyline(options: AddPolylineOptions, nativeMap?: any): Promise<void>;
181
- private removePolyById;
182
- private removePolys;
183
- removePolygons(ids?: any[], nativeMap?: any): Promise<void>;
184
- removePolylines(ids?: any[], nativeMap?: any): Promise<void>;
185
- animateCamera(options: AnimateCameraOptions, nativeMap?: any): Promise<void>;
186
- /**
187
- * sets a map level click listener
188
- *
189
- */
61
+ addSource(id: string, options: AddSourceOptions, nativeMap?: any): Promise<void>;
62
+ updateSource(id: string, options: UpdateSourceOptions, nativeMap?: any): Promise<void>;
63
+ removeSource(id: string, nativeMap?: any): Promise<void>;
64
+ addLayer(style: any, belowLayerId?: string, nativeMap?: any): Promise<void>;
65
+ removeLayer(id: string, nativeMap?: any): Promise<void>;
66
+ getLayer(layerId: string, nativeMap?: any): Promise<any | null>;
67
+ getLayers(nativeMap?: any): Promise<any[]>;
68
+ getImage(imageId: string, nativeMap?: any): Promise<ImageSource | null>;
69
+ createCalloutView(marker: MapboxMarker): StackLayout;
70
+ showCalloutForMarkerById(markerId: string): Promise<void>;
71
+ hideCalloutForMarkerById(markerId: string): void;
72
+ toggleCalloutForMarkerById(markerId: string): void;
73
+ onNativeAnnotationTap(userInfo: any): void;
74
+ pushToken: (t: any) => number;
75
+ addNotificationCenterObserver(event: any, map: any, callback: any): void;
76
+ setOnEventChangeListener(event: string, listener: (info: any) => void, nativeMap?: any): Promise<void>;
77
+ setOnCameraChangeListener(listener: (info: any, animated?: any) => void, nativeMap?: any): Promise<void>;
190
78
  setOnMapClickListener(listener: (data: LatLng) => void, nativeMap?: any): Promise<void>;
191
79
  setOnMapLongClickListener(listener: (data: LatLng) => void, nativeMap?: any): Promise<void>;
192
- setOnScrollListener(listener: (data?: LatLng) => void, nativeMap?: any): Promise<void>;
193
- /**
194
- * simulates onMoveBegin single event callback
195
- *
196
- * This will call the listener provided once per pan akin to the way
197
- * onMoveBegin on the Android side works.
198
- */
199
- setOnMoveBeginListener(listener: (data?: LatLng) => void, nativeMap?: any): Promise<void>;
200
- setOnMoveEndListener(listener: () => void, nativeMap?: any): Promise<void>;
201
- setOnFlingListener(listener: () => void, nativeMap?: any): Promise<void>;
202
- setOnCameraChangeListener(listener: (reason: any, animated?: any) => void, nativeMap?: any): Promise<void>;
203
- setOnCameraMoveCancelListener(listener: () => void, nativeMap?: any): Promise<void>;
80
+ setOnScrollListener(listener: (info: any) => void, nativeMap?: any): Promise<void>;
81
+ setOnMoveBeginListener(listener: (info: any) => void, nativeMap?: any): Promise<void>;
82
+ setOnMoveEndListener(listener: (info: any) => void, nativeMap?: any): Promise<void>;
83
+ setOnFlingListener(listener: (info: any) => void, nativeMap?: any): Promise<void>;
84
+ setOnCameraMoveCancelListener(listener: (info: any) => void, nativeMap?: any): Promise<void>;
204
85
  setOnMapIdleListener(listener: () => void, nativeMap?: any): Promise<void>;
205
- getViewport(nativeMap?: any): Promise<Viewport>;
206
- setViewport(options: SetViewportOptions, nativeMap?: any): Promise<void>;
207
- downloadOfflineRegion(options: DownloadOfflineRegionOptions): Promise<void>;
208
- listOfflineRegions(options?: ListOfflineRegionsOptions): Promise<OfflineRegion[]>;
209
- deleteOfflineRegion(options: DeleteOfflineRegionOptions): Promise<void>;
210
- addExtrusion(options: AddExtrusionOptions, nativeMap?: any): Promise<void>;
211
- /**
212
- * update a geojson source
213
- *
214
- */
215
- updateSource(id: string, options: UpdateSourceOptions, nativeMap?: any): Promise<void>;
216
- /**
217
- * add a vector or geojson source
218
- *
219
- * Add a source that can then be referenced in the style specification
220
- * passed to addLayer().
221
- *
222
- * @link https://docs.mapbox.com/mapbox-gl-js/api/#map#addsource
223
- */
224
- addSource(id: string, options: AddSourceOptions, nativeMap?: any): Promise<void>;
225
- /**
226
- * remove source by id
227
- */
228
- removeSource(id: string, nativeMap?: any): Promise<void>;
229
- /**
230
- * a rough analogue to the mapbox-gl-js addLayer() method
231
- *
232
- * It would be nice if this {N} API matched the mapbox-gl-js API which
233
- * would make it much easier to share mapping applications between the web
234
- * and {N} apps.
235
- *
236
- * This method accepts a Mapbox-GL-JS style specification JSON object with some
237
- * limitations:
238
- *
239
- * - the source: must be a GeoJSON object.
240
- * - only a subset of paint properties are available.
241
- *
242
- * @param {object} style - a style following the Mapbox style specification.
243
- * @param {any} nativeMapView - native map view (com.mapbox.mapboxsdk.maps.MapView)
244
- *
245
- * @link https://docs.mapbox.com/mapbox-gl-js/style-spec/#layers
246
- */
247
- addLayer(style: any, belowLayerId?: string, nativeMapView?: any): Promise<void>;
248
- /**
249
- * remove layer by ID
250
- *
251
- * Removes a layer given a layer id
252
- *
253
- * @param {string} id
254
- */
255
- removeLayer(id: string, nativeMapViewInstance?: any): Promise<void>;
256
- /**
257
- * @deprecated
258
- * Add a point to a line
259
- *
260
- * This method appends a point to a line and is useful for drawing a users track.
261
- *
262
- * The process for adding a point to a line is different in the iOS sdk than in
263
- * the Android java sdk.
264
- *
265
- * @param {id} id - id of line to add a point to.
266
- * @param {array} lnglat - [lng,lat] to append to the line.
267
- *
268
- * @link https://github.com/mapbox/mapbox-gl-native/issues/13983
269
- * @link https://docs.mapbox.com/ios/maps/examples/runtime-animate-line/
270
- */
271
- addLinePoint(id: string, lnglat: any, sourceId?: string, nativeMapView?: any): Promise<void>;
272
- addGeoJsonClustered(options: AddGeoJsonClusteredOptions, nativeMapViewInstance?: any): Promise<void>;
86
+ downloadOfflineRegion(options: DownloadOfflineRegionOptions, nativeMap?: any): Promise<void>;
87
+ listOfflineRegions(options?: ListOfflineRegionsOptions, nativeMap?: any): Promise<OfflineRegion[]>;
88
+ deleteOfflineRegion(options: DeleteOfflineRegionOptions, nativeMap?: any): Promise<void>;
89
+ showUserLocationMarker(show: boolean): Promise<void>;
90
+ hideUserLocationMarker(nativeMap?: any): Promise<void>;
91
+ forceUserLocationUpdate(nativeMap?: any): Promise<boolean>;
273
92
  trackUser(options: TrackUserOptions, nativeMap?: any): Promise<void>;
274
- getLayer(name: string, nativeMap?: any): Promise<LayerCommon>;
275
- getLayers(nativeMap?: any): Promise<LayerCommon[]>;
276
- project(data: LatLng): {
277
- x: number;
278
- y: number;
279
- };
93
+ getTilt(nativeMap?: any): Promise<number>;
94
+ setTilt(options: {
95
+ tilt: number;
96
+ animated?: boolean;
97
+ }, nativeMap?: any): Promise<void>;
98
+ getUserLocation(nativeMap?: any): Promise<UserLocation>;
99
+ setViewport(options: SetViewportOptions, nativeMap?: any): Promise<boolean>;
100
+ getViewport(nativeMap?: any): Promise<any>;
101
+ project(data: LatLng, nativeMap?: any): any;
280
102
  projectBack(screenCoordinate: {
281
103
  x: number;
282
104
  y: number;
283
- }): LatLng;
284
- getUserLocationCameraMode(nativeMap?: any): UserLocationCameraMode;
105
+ }, nativeMap?: any): LatLng;
106
+ onStart(nativeMap?: any): Promise<void>;
107
+ onResume(nativeMap?: any): Promise<void>;
108
+ onPause(nativeMap?: any): Promise<void>;
109
+ onStop(nativeMap?: any): Promise<void>;
110
+ onLowMemory(nativeMap?: any): Promise<void>;
111
+ onDestroy(nativeMap?: any): Promise<void>;
285
112
  }