@nativescript-community/ui-mapbox 6.2.31 → 7.0.0-alpha.14.3191a7b
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/common.d.ts +38 -24
- package/common.js +35 -26
- package/expression/expression-parser.android.d.ts +2 -2
- package/expression/expression-parser.android.js +4 -3
- package/index.android.d.ts +59 -59
- package/index.android.js +1389 -1222
- package/index.d.ts +36 -5
- package/index.ios.d.ts +6 -4
- package/index.ios.js +8 -9
- package/layers/layer-factory.android.d.ts +7 -5
- package/layers/layer-factory.android.js +71 -41
- package/layers/layer-factory.d.ts +2 -1
- package/layers/layer-factory.ios.d.ts +1 -1
- package/layers/layer-factory.ios.js +9 -9
- package/layers/parser/property-parser.android.d.ts +3 -1
- package/layers/parser/property-parser.android.js +25 -24
- package/markers/Marker.android.d.ts +35 -0
- package/markers/Marker.android.js +128 -0
- package/markers/MarkerManager.android.d.ts +28 -0
- package/markers/MarkerManager.android.js +154 -0
- package/package.json +6 -5
- package/platforms/android/include.gradle +31 -27
- package/platforms/android/ui_mapbox.aar +0 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/typings/geojson.android.d.ts +689 -0
- package/typings/index.android.d.ts +46 -0
- package/typings/mapbox.android.d.ts +39968 -12560
package/common.d.ts
CHANGED
|
@@ -37,8 +37,8 @@ export interface QuerySourceFeaturesOptions {
|
|
|
37
37
|
export interface Feature {
|
|
38
38
|
id?: any;
|
|
39
39
|
type: string;
|
|
40
|
-
geometry:
|
|
41
|
-
properties:
|
|
40
|
+
geometry: object;
|
|
41
|
+
properties: object;
|
|
42
42
|
}
|
|
43
43
|
export interface AddPolygonOptions {
|
|
44
44
|
/**
|
|
@@ -127,6 +127,10 @@ export interface MapboxMarker extends LatLng {
|
|
|
127
127
|
update?: (newSettings: MapboxMarker) => void;
|
|
128
128
|
ios?: any;
|
|
129
129
|
android?: any;
|
|
130
|
+
/**
|
|
131
|
+
* internally used to know if the marker image is already downloaded
|
|
132
|
+
*/
|
|
133
|
+
downloadedIcon?: ImageSource;
|
|
130
134
|
}
|
|
131
135
|
export interface SetZoomLevelOptions {
|
|
132
136
|
level: number;
|
|
@@ -141,6 +145,7 @@ export interface SetTiltOptions {
|
|
|
141
145
|
* default 5000 (milliseconds)
|
|
142
146
|
*/
|
|
143
147
|
duration: number;
|
|
148
|
+
animated?: boolean;
|
|
144
149
|
}
|
|
145
150
|
export interface ShowOptionsMargins {
|
|
146
151
|
left?: number;
|
|
@@ -275,7 +280,7 @@ export interface GeoJSONSource extends Source {
|
|
|
275
280
|
export type UserLocationCameraMode = 'NONE' | 'NONE_COMPASS' | 'NONE_GPS' | 'TRACKING' | 'TRACKING_COMPASS' | 'TRACKING_GPS' | 'TRACKING_GPS_NORTH';
|
|
276
281
|
export interface TrackUserOptions {
|
|
277
282
|
cameraMode: UserLocationCameraMode;
|
|
278
|
-
renderMode?:
|
|
283
|
+
renderMode?: 'NORMAL' | 'COMPASS' | 'GPS';
|
|
279
284
|
/**
|
|
280
285
|
* iOS only, as Android is always animated. Default true (because of Android).
|
|
281
286
|
*/
|
|
@@ -286,8 +291,8 @@ export interface AddExtrusionOptions {
|
|
|
286
291
|
export interface OfflineRegion {
|
|
287
292
|
name: string;
|
|
288
293
|
bounds: Bounds;
|
|
289
|
-
minZoom
|
|
290
|
-
maxZoom
|
|
294
|
+
minZoom?: number;
|
|
295
|
+
maxZoom?: number;
|
|
291
296
|
style: MapStyle;
|
|
292
297
|
metadata?: any;
|
|
293
298
|
pixelRatio?: any;
|
|
@@ -311,6 +316,9 @@ export interface DownloadOfflineRegionOptions extends OfflineRegion {
|
|
|
311
316
|
* Set this, in case no map has been show yet (and thus, no accessToken has been passed in yet).
|
|
312
317
|
*/
|
|
313
318
|
accessToken?: string;
|
|
319
|
+
regionId?: string;
|
|
320
|
+
minZoom?: number;
|
|
321
|
+
maxZoom?: number;
|
|
314
322
|
}
|
|
315
323
|
export interface ListOfflineRegionsOptions {
|
|
316
324
|
/**
|
|
@@ -470,10 +478,7 @@ export interface MapboxApi {
|
|
|
470
478
|
unhide(): Promise<any>;
|
|
471
479
|
destroy(nativeMap?: any): Promise<any>;
|
|
472
480
|
onStart(nativeMap?: any): Promise<any>;
|
|
473
|
-
onResume(nativeMap?: any): Promise<any>;
|
|
474
|
-
onPause(nativeMap?: any): Promise<any>;
|
|
475
481
|
onStop(nativeMap?: any): Promise<any>;
|
|
476
|
-
onLowMemory(nativeMap?: any): Promise<any>;
|
|
477
482
|
onDestroy(nativeMap?: any): Promise<any>;
|
|
478
483
|
setMapStyle(style: string | MapStyle, nativeMap?: any): Promise<any>;
|
|
479
484
|
addMarkers(markers: MapboxMarker[], nativeMap?: any): Promise<any>;
|
|
@@ -487,10 +492,8 @@ export interface MapboxApi {
|
|
|
487
492
|
getUserLocation(nativeMap?: any): Promise<UserLocation>;
|
|
488
493
|
showUserLocationMarker(options: any, nativeMap?: any): void;
|
|
489
494
|
hideUserLocationMarker(nativeMap?: any): void;
|
|
490
|
-
changeUserLocationMarkerMode(renderModeString: any, cameraModeString: UserLocationCameraMode, nativeMap?: any): void;
|
|
491
495
|
forceUserLocationUpdate(location: any, nativeMap?: any): void;
|
|
492
496
|
trackUser(options: TrackUserOptions, nativeMap?: any): Promise<void>;
|
|
493
|
-
getUserLocationCameraMode(nativeMap?: any): UserLocationCameraMode;
|
|
494
497
|
addSource(id: string, options: AddSourceOptions, nativeMapView?: any): Promise<any>;
|
|
495
498
|
updateSource(id: string, options: UpdateSourceOptions, nativeMapView?: any): Promise<any>;
|
|
496
499
|
removeSource(id: string, nativeMap?: any): Promise<any>;
|
|
@@ -513,9 +516,9 @@ export interface MapboxApi {
|
|
|
513
516
|
setOnMoveBeginListener(listener: (data?: LatLng) => void, nativeMap?: any): Promise<void>;
|
|
514
517
|
setOnMoveEndListener(listener: (data?: LatLng) => void, nativeMap?: any): Promise<void>;
|
|
515
518
|
setOnFlingListener(listener: () => void, nativeMap?: any): Promise<any>;
|
|
516
|
-
|
|
519
|
+
setOnCameraChangeListener(listener: (reason: any, animated?: boolean) => void, nativeMap?: any): Promise<any>;
|
|
517
520
|
setOnCameraMoveCancelListener(listener: () => void, nativeMap?: any): Promise<any>;
|
|
518
|
-
|
|
521
|
+
setOnMapIdleListener(listener: () => void, nativeMap?: any): Promise<any>;
|
|
519
522
|
requestFineLocationPermission(): Promise<any>;
|
|
520
523
|
hasFineLocationPermission(): Promise<boolean>;
|
|
521
524
|
getViewport(nativeMap?: any): Promise<Viewport>;
|
|
@@ -562,7 +565,7 @@ export interface MapboxViewApi {
|
|
|
562
565
|
setOnScrollListener(listener: (data?: LatLng) => void): Promise<void>;
|
|
563
566
|
setOnMoveBeginListener(listener: (data?: LatLng) => void): Promise<void>;
|
|
564
567
|
setOnFlingListener(listener: () => void): Promise<any>;
|
|
565
|
-
|
|
568
|
+
setOnCameraChangeListener(listener: (reason: any, animated?: boolean) => void): Promise<any>;
|
|
566
569
|
setOnCameraMoveCancelListener(listener: () => void): Promise<any>;
|
|
567
570
|
setOnCameraIdleListener(listener: () => void): Promise<any>;
|
|
568
571
|
getViewport(): Promise<Viewport>;
|
|
@@ -576,10 +579,8 @@ export interface MapboxViewApi {
|
|
|
576
579
|
setTilt(options: SetTiltOptions): Promise<any>;
|
|
577
580
|
getUserLocation(): Promise<UserLocation>;
|
|
578
581
|
trackUser(options: TrackUserOptions): Promise<any>;
|
|
579
|
-
getUserLocationCameraMode(nativeMap?: any): UserLocationCameraMode;
|
|
580
582
|
showUserLocationMarker(options: any): void;
|
|
581
583
|
hideUserLocationMarker(options: any): void;
|
|
582
|
-
changeUserLocationMarkerMode(renderModeString: any, cameraModeString: UserLocationCameraMode): void;
|
|
583
584
|
forceUserLocationUpdate(location: any): void;
|
|
584
585
|
addSource(id: string, options: AddSourceOptions): Promise<any>;
|
|
585
586
|
updateSource(id: string, options: UpdateSourceOptions): Promise<any>;
|
|
@@ -599,10 +600,7 @@ export interface MapboxViewApi {
|
|
|
599
600
|
removeImage(imageId: string, nativeMap?: any): Promise<void>;
|
|
600
601
|
destroy(): Promise<any>;
|
|
601
602
|
onStart(): Promise<any>;
|
|
602
|
-
onResume(): Promise<any>;
|
|
603
|
-
onPause(): Promise<any>;
|
|
604
603
|
onStop(): Promise<any>;
|
|
605
|
-
onLowMemory(): Promise<any>;
|
|
606
604
|
onDestroy(): Promise<any>;
|
|
607
605
|
project(data: LatLng): {
|
|
608
606
|
x: number;
|
|
@@ -641,7 +639,7 @@ export declare abstract class MapboxViewCommonBase extends ContentView implement
|
|
|
641
639
|
setOnMoveBeginListener(listener: (data?: LatLng) => void, nativeMap?: any): Promise<void>;
|
|
642
640
|
setOnMoveEndListener(listener: (data?: LatLng) => void, nativeMap?: any): Promise<void>;
|
|
643
641
|
setOnFlingListener(listener: () => void, nativeMap?: any): Promise<any>;
|
|
644
|
-
|
|
642
|
+
setOnCameraChangeListener(listener: (reason: any, animated?: boolean) => void, nativeMap?: any): Promise<any>;
|
|
645
643
|
setOnCameraMoveCancelListener(listener: () => void, nativeMap?: any): Promise<any>;
|
|
646
644
|
setOnCameraIdleListener(listener: () => void, nativeMap?: any): Promise<any>;
|
|
647
645
|
getViewport(): Promise<Viewport>;
|
|
@@ -656,10 +654,8 @@ export declare abstract class MapboxViewCommonBase extends ContentView implement
|
|
|
656
654
|
getUserLocation(): Promise<UserLocation>;
|
|
657
655
|
showUserLocationMarker(options: any): void;
|
|
658
656
|
hideUserLocationMarker(): void;
|
|
659
|
-
changeUserLocationMarkerMode(renderModeString: any, cameraModeString: UserLocationCameraMode): void;
|
|
660
657
|
forceUserLocationUpdate(location: any): void;
|
|
661
658
|
trackUser(options: TrackUserOptions): Promise<any>;
|
|
662
|
-
getUserLocationCameraMode(): UserLocationCameraMode;
|
|
663
659
|
addSource(id: string, options: AddSourceOptions): Promise<any>;
|
|
664
660
|
updateSource(id: string, options: UpdateSourceOptions): Promise<any>;
|
|
665
661
|
removeSource(id: string): Promise<any>;
|
|
@@ -680,10 +676,7 @@ export declare abstract class MapboxViewCommonBase extends ContentView implement
|
|
|
680
676
|
removeImage(imageId: string): Promise<void>;
|
|
681
677
|
destroy(): Promise<any>;
|
|
682
678
|
onStart(): Promise<any>;
|
|
683
|
-
onResume(nativeMap?: any): Promise<any>;
|
|
684
|
-
onPause(nativeMap?: any): Promise<any>;
|
|
685
679
|
onStop(nativeMap?: any): Promise<any>;
|
|
686
|
-
onLowMemory(nativeMap?: any): Promise<any>;
|
|
687
680
|
onDestroy(nativeMap?: any): Promise<any>;
|
|
688
681
|
project(data: LatLng): {
|
|
689
682
|
x: number;
|
|
@@ -693,6 +686,9 @@ export declare abstract class MapboxViewCommonBase extends ContentView implement
|
|
|
693
686
|
x: number;
|
|
694
687
|
y: number;
|
|
695
688
|
}): LatLng;
|
|
689
|
+
downloadOfflineRegion(options: DownloadOfflineRegionOptions): Promise<any>;
|
|
690
|
+
listOfflineRegions(options?: ListOfflineRegionsOptions): Promise<OfflineRegion[]>;
|
|
691
|
+
deleteOfflineRegion(options: DeleteOfflineRegionOptions): Promise<any>;
|
|
696
692
|
}
|
|
697
693
|
/**
|
|
698
694
|
* Properties definitions for the Mapbox XML tag.
|
|
@@ -730,6 +726,24 @@ export declare const delayProperty: Property<MapboxViewCommonBase, number>;
|
|
|
730
726
|
* @link https://docs.nativescript.org/plugins/ui-plugin-custom
|
|
731
727
|
*/
|
|
732
728
|
export declare abstract class MapboxViewBase extends MapboxViewCommonBase {
|
|
729
|
+
[zoomLevelProperty.setNative]: (value: number) => void;
|
|
730
|
+
[mapStyleProperty.setNative]: (value: string) => void;
|
|
731
|
+
[accessTokenProperty.setNative]: (value: string) => void;
|
|
732
|
+
[delayProperty.setNative]: (value: number) => void;
|
|
733
|
+
[latitudeProperty.setNative]: (value: number) => void;
|
|
734
|
+
[longitudeProperty.setNative]: (value: number) => void;
|
|
735
|
+
[showUserLocationProperty.setNative]: (value: boolean) => void;
|
|
736
|
+
[locationComponentOptionsProperty.setNative]: (value: boolean) => void;
|
|
737
|
+
[hideLogoProperty.setNative]: (value: boolean) => void;
|
|
738
|
+
[logoPositionProperty.setNative]: (value: ControlPosition) => void;
|
|
739
|
+
[hideAttributionProperty.setNative]: (value: boolean) => void;
|
|
740
|
+
[attributionPositionProperty.setNative]: (value: ControlPosition) => void;
|
|
741
|
+
[hideCompassProperty.setNative]: (value: boolean) => void;
|
|
742
|
+
[compassPositionProperty.setNative]: (value: ControlPosition) => void;
|
|
743
|
+
[disableZoomProperty.setNative]: (value: boolean) => void;
|
|
744
|
+
[disableRotationProperty.setNative]: (value: boolean) => void;
|
|
745
|
+
[disableScrollProperty.setNative]: (value: boolean) => void;
|
|
746
|
+
[disableTiltProperty.setNative]: (value: boolean) => void;
|
|
733
747
|
static mapReadyEvent: string;
|
|
734
748
|
static scrollEvent: string;
|
|
735
749
|
static moveBeginEvent: string;
|
package/common.js
CHANGED
|
@@ -77,7 +77,7 @@ export class MapboxCommon {
|
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
MapboxCommon.defaults = {
|
|
80
|
-
style: MapStyle.STREETS
|
|
80
|
+
style: MapStyle.STREETS,
|
|
81
81
|
margins: {
|
|
82
82
|
left: 0,
|
|
83
83
|
right: 0,
|
|
@@ -145,14 +145,14 @@ export class MapboxViewCommonBase extends ContentView {
|
|
|
145
145
|
setOnFlingListener(listener, nativeMap) {
|
|
146
146
|
return this.mapbox.setOnFlingListener(listener, this.getNativeMapView());
|
|
147
147
|
}
|
|
148
|
-
|
|
149
|
-
return this.mapbox.
|
|
148
|
+
setOnCameraChangeListener(listener, nativeMap) {
|
|
149
|
+
return this.mapbox.setOnCameraChangeListener(listener, this.getNativeMapView());
|
|
150
150
|
}
|
|
151
151
|
setOnCameraMoveCancelListener(listener, nativeMap) {
|
|
152
152
|
return this.mapbox.setOnCameraMoveCancelListener(listener, this.getNativeMapView());
|
|
153
153
|
}
|
|
154
154
|
setOnCameraIdleListener(listener, nativeMap) {
|
|
155
|
-
return this.mapbox.
|
|
155
|
+
return this.mapbox.setOnMapIdleListener(listener, this.getNativeMapView());
|
|
156
156
|
}
|
|
157
157
|
getViewport() {
|
|
158
158
|
return this.mapbox.getViewport(this.getNativeMapView());
|
|
@@ -190,18 +190,18 @@ export class MapboxViewCommonBase extends ContentView {
|
|
|
190
190
|
hideUserLocationMarker() {
|
|
191
191
|
this.mapbox.hideUserLocationMarker(this.getNativeMapView());
|
|
192
192
|
}
|
|
193
|
-
changeUserLocationMarkerMode(renderModeString, cameraModeString) {
|
|
194
|
-
|
|
195
|
-
}
|
|
193
|
+
// changeUserLocationMarkerMode(renderModeString, cameraModeString: UserLocationCameraMode): void {
|
|
194
|
+
// this.mapbox.changeUserLocationMarkerMode(renderModeString, cameraModeString, this.getNativeMapView());
|
|
195
|
+
// }
|
|
196
196
|
forceUserLocationUpdate(location) {
|
|
197
197
|
this.mapbox.forceUserLocationUpdate(location, this.getNativeMapView());
|
|
198
198
|
}
|
|
199
199
|
trackUser(options) {
|
|
200
200
|
return this.mapbox.trackUser(options, this.getNativeMapView());
|
|
201
201
|
}
|
|
202
|
-
getUserLocationCameraMode() {
|
|
203
|
-
|
|
204
|
-
}
|
|
202
|
+
// getUserLocationCameraMode(): UserLocationCameraMode {
|
|
203
|
+
// return this.mapbox.getUserLocationCameraMode(this.getNativeMapView());
|
|
204
|
+
// }
|
|
205
205
|
addSource(id, options) {
|
|
206
206
|
return this.mapbox.addSource(id, options, this.getNativeMapView());
|
|
207
207
|
}
|
|
@@ -257,31 +257,40 @@ export class MapboxViewCommonBase extends ContentView {
|
|
|
257
257
|
return this.mapbox.removeImage(imageId, this.getNativeMapView());
|
|
258
258
|
}
|
|
259
259
|
destroy() {
|
|
260
|
-
return this.mapbox
|
|
260
|
+
return this.mapbox?.destroy(this.getNativeMapView());
|
|
261
261
|
}
|
|
262
262
|
onStart() {
|
|
263
|
-
return this.mapbox
|
|
264
|
-
}
|
|
265
|
-
onResume(nativeMap) {
|
|
266
|
-
|
|
267
|
-
}
|
|
268
|
-
onPause(nativeMap) {
|
|
269
|
-
|
|
270
|
-
}
|
|
263
|
+
return this.mapbox?.onStart(this.getNativeMapView());
|
|
264
|
+
}
|
|
265
|
+
// onResume(nativeMap?: any): Promise<any> {
|
|
266
|
+
// return this.mapbox && this.mapbox.onResume(this.getNativeMapView());
|
|
267
|
+
// }
|
|
268
|
+
// onPause(nativeMap?: any): Promise<any> {
|
|
269
|
+
// return this.mapbox && this.mapbox.onPause(this.getNativeMapView());
|
|
270
|
+
// }
|
|
271
271
|
onStop(nativeMap) {
|
|
272
|
-
return this.mapbox
|
|
273
|
-
}
|
|
274
|
-
onLowMemory(nativeMap) {
|
|
275
|
-
return this.mapbox.onLowMemory(this.getNativeMapView());
|
|
272
|
+
return this.mapbox?.onStop(this.getNativeMapView());
|
|
276
273
|
}
|
|
274
|
+
// onLowMemory(nativeMap?: any): Promise<any> {
|
|
275
|
+
// return this.mapbox.onLowMemory(this.getNativeMapView());
|
|
276
|
+
// }
|
|
277
277
|
onDestroy(nativeMap) {
|
|
278
|
-
return this.mapbox
|
|
278
|
+
return this.mapbox?.onDestroy(this.getNativeMapView());
|
|
279
279
|
}
|
|
280
280
|
project(data) {
|
|
281
|
-
return this.mapbox
|
|
281
|
+
return this.mapbox.project(data);
|
|
282
282
|
}
|
|
283
283
|
projectBack(screenCoordinate) {
|
|
284
|
-
return this.mapbox
|
|
284
|
+
return this.mapbox.projectBack(screenCoordinate);
|
|
285
|
+
}
|
|
286
|
+
downloadOfflineRegion(options) {
|
|
287
|
+
return this.mapbox.downloadOfflineRegion(options);
|
|
288
|
+
}
|
|
289
|
+
listOfflineRegions(options) {
|
|
290
|
+
return this.mapbox.listOfflineRegions(options);
|
|
291
|
+
}
|
|
292
|
+
deleteOfflineRegion(options) {
|
|
293
|
+
return this.mapbox.deleteOfflineRegion(options);
|
|
285
294
|
}
|
|
286
295
|
}
|
|
287
296
|
// -----------------------------------------------------------------
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare class ExpressionParser {
|
|
2
|
-
static parseJson(json: any[]): com.mapbox.
|
|
3
|
-
static toJson(filter: com.mapbox.
|
|
2
|
+
static parseJson(json: any[]): com.mapbox.maps.extension.style.expressions.generated.Expression;
|
|
3
|
+
static toJson(filter: com.mapbox.maps.extension.style.expressions.generated.Expression): any[];
|
|
4
4
|
}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
+
const Expression = com.mapbox.maps.extension.style.expressions.generated.Expression;
|
|
1
2
|
export class ExpressionParser {
|
|
2
3
|
static parseJson(json) {
|
|
3
|
-
const expression =
|
|
4
|
+
const expression = Expression.fromRaw(JSON.stringify(json));
|
|
4
5
|
return expression;
|
|
5
6
|
}
|
|
6
7
|
static toJson(filter) {
|
|
7
8
|
if (!filter) {
|
|
8
9
|
return null;
|
|
9
10
|
}
|
|
10
|
-
if (!(filter instanceof com.mapbox.
|
|
11
|
+
if (!(filter instanceof com.mapbox.maps.extension.style.expressions.generated.Expression)) {
|
|
11
12
|
throw new Error('Filter must be a Expression.');
|
|
12
13
|
}
|
|
13
|
-
return JSON.parse(filter.
|
|
14
|
+
return JSON.parse(filter.toJson());
|
|
14
15
|
}
|
|
15
16
|
}
|
|
16
17
|
//# sourceMappingURL=expression-parser.android.js.map
|
package/index.android.d.ts
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* @todo FIXME: The gcFix() implementation currently assumes only one map visible at a time.
|
|
5
5
|
*/
|
|
6
6
|
import { ImageSource } from '@nativescript/core';
|
|
7
|
-
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 } from './common';
|
|
7
|
+
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, ShowResult, TrackUserOptions, UpdateSourceOptions, UserLocation, UserLocationCameraMode, Viewport, telemetryProperty } from './common';
|
|
8
|
+
import { AndroidMarker } from './markers/Marker.android';
|
|
8
9
|
export * from './common';
|
|
9
10
|
export declare function setLogLevel(level: 'none' | 'info' | 'debug' | 'error' | 'fault' | 'verbose'): void;
|
|
10
11
|
/**
|
|
@@ -23,7 +24,9 @@ export declare function setLogLevel(level: 'none' | 'info' | 'debug' | 'error' |
|
|
|
23
24
|
* @see MapboxViewBase
|
|
24
25
|
*/
|
|
25
26
|
export declare class MapboxView extends MapboxViewBase {
|
|
27
|
+
[telemetryProperty.setNative]: (value: boolean) => void;
|
|
26
28
|
private nativeMapView;
|
|
29
|
+
mapbox: Mapbox;
|
|
27
30
|
private settings;
|
|
28
31
|
private initialized;
|
|
29
32
|
constructor();
|
|
@@ -40,7 +43,7 @@ export declare class MapboxView extends MapboxViewBase {
|
|
|
40
43
|
*
|
|
41
44
|
* @see Mapbox
|
|
42
45
|
*/
|
|
43
|
-
getMapboxApi():
|
|
46
|
+
getMapboxApi(): Mapbox;
|
|
44
47
|
/**
|
|
45
48
|
* Creates the native view.
|
|
46
49
|
*
|
|
@@ -60,7 +63,7 @@ export declare class MapboxView extends MapboxViewBase {
|
|
|
60
63
|
*
|
|
61
64
|
* @todo check this.
|
|
62
65
|
*/
|
|
63
|
-
createNativeView():
|
|
66
|
+
createNativeView(): object;
|
|
64
67
|
onLoaded(): void;
|
|
65
68
|
initNativeView(): void;
|
|
66
69
|
/**
|
|
@@ -85,7 +88,7 @@ export declare class MapboxView extends MapboxViewBase {
|
|
|
85
88
|
*
|
|
86
89
|
* @todo FIXME: this.nativeMapView is unused and never actually set to anything.
|
|
87
90
|
*/
|
|
88
|
-
|
|
91
|
+
initMap(): Promise<void>;
|
|
89
92
|
}
|
|
90
93
|
/**
|
|
91
94
|
* A NativeScript shim for the Mapbox API.
|
|
@@ -100,35 +103,33 @@ export declare class MapboxView extends MapboxViewBase {
|
|
|
100
103
|
export declare class Mapbox extends MapboxCommon implements MapboxApi {
|
|
101
104
|
private _mapboxMapInstance;
|
|
102
105
|
private _mapboxViewInstance;
|
|
103
|
-
private _locationComponent;
|
|
104
106
|
private _accessToken;
|
|
105
|
-
private circleManager;
|
|
106
107
|
private lineManager;
|
|
107
|
-
private
|
|
108
|
+
private polygonManager;
|
|
108
109
|
private _offlineManager;
|
|
109
|
-
private
|
|
110
|
-
private
|
|
111
|
-
private
|
|
112
|
-
private onDidFinishLoadingStyleListener;
|
|
110
|
+
private _tileStore;
|
|
111
|
+
private markerManager;
|
|
112
|
+
private customMarker;
|
|
113
113
|
private onAnnotationClickListener;
|
|
114
|
-
private onMarkerClickListener;
|
|
115
|
-
private onInfoWindowClickListener;
|
|
116
114
|
private onMapClickListener;
|
|
117
115
|
private onMapLongClickListener;
|
|
118
|
-
private
|
|
116
|
+
private onMoveEndListener;
|
|
117
|
+
private onMoveBeginListener;
|
|
119
118
|
private onScrollListener;
|
|
120
119
|
private onFlingListener;
|
|
121
120
|
private onCameraMoveListener;
|
|
122
121
|
private onCameraMoveCancelListener;
|
|
123
|
-
private
|
|
124
|
-
|
|
125
|
-
|
|
122
|
+
private onMapIdleListener;
|
|
123
|
+
onIndicatorPositionChangedListener: com.mapbox.maps.plugin.locationcomponent.OnIndicatorPositionChangedListener;
|
|
124
|
+
lastKnownLocation: com.mapbox.geojson.Point;
|
|
126
125
|
private _markers;
|
|
127
126
|
private _polylines;
|
|
128
127
|
private _polygons;
|
|
129
128
|
private lines;
|
|
130
129
|
private eventCallbacks;
|
|
131
|
-
_markerIconDownloadCache:
|
|
130
|
+
_markerIconDownloadCache: {
|
|
131
|
+
[k: string]: ImageSource;
|
|
132
|
+
};
|
|
132
133
|
constructor(view: any);
|
|
133
134
|
/**
|
|
134
135
|
* not used
|
|
@@ -153,7 +154,7 @@ export declare class Mapbox extends MapboxCommon implements MapboxApi {
|
|
|
153
154
|
*
|
|
154
155
|
* @todo FIXME: the timeout delay before showing the map works around some race condition. The source error needs to be figured out.
|
|
155
156
|
*/
|
|
156
|
-
show(options: ShowOptions): Promise<
|
|
157
|
+
show(options: ShowOptions): Promise<ShowResult>;
|
|
157
158
|
/**
|
|
158
159
|
* hide the map
|
|
159
160
|
*/
|
|
@@ -164,6 +165,7 @@ export declare class Mapbox extends MapboxCommon implements MapboxApi {
|
|
|
164
165
|
*
|
|
165
166
|
* Destroy the map instance.
|
|
166
167
|
*/
|
|
168
|
+
clear(nativeMap?: any): void;
|
|
167
169
|
destroy(nativeMap?: any): Promise<void>;
|
|
168
170
|
/**
|
|
169
171
|
* Clear Event Listeners
|
|
@@ -175,10 +177,7 @@ export declare class Mapbox extends MapboxCommon implements MapboxApi {
|
|
|
175
177
|
*/
|
|
176
178
|
private clearEventListeners;
|
|
177
179
|
onStart(nativeMap?: any): Promise<void>;
|
|
178
|
-
onResume(nativeMapViewInstance?: any): Promise<void>;
|
|
179
|
-
onPause(nativeMapViewInstance?: any): Promise<void>;
|
|
180
180
|
onStop(nativeMap?: any): Promise<void>;
|
|
181
|
-
onLowMemory(nativeMap?: any): Promise<void>;
|
|
182
181
|
onDestroy(nativeMap?: any): Promise<void>;
|
|
183
182
|
/**
|
|
184
183
|
* event handler shim
|
|
@@ -240,28 +239,33 @@ export declare class Mapbox extends MapboxCommon implements MapboxApi {
|
|
|
240
239
|
* NOTE: The style must be explicitly set using this method in the onMapReady() handler.
|
|
241
240
|
*
|
|
242
241
|
* @param {string | MapStyle } style - a style following the Mapbox style specification or a URL to a style.
|
|
243
|
-
* @param {any} nativeMapViewInstance - native map view (com.mapbox.
|
|
242
|
+
* @param {any} nativeMapViewInstance - native map view (com.mapbox.maps.MapView)
|
|
244
243
|
*
|
|
245
244
|
* @see MapboxViewCommonBase:setMapStyle()
|
|
246
245
|
*
|
|
247
246
|
* @link https://docs.mapbox.com/android/api/map-sdk/7.1.2/com/mapbox/mapboxsdk/maps/Style.Builder.html
|
|
248
|
-
* @link https://docs.mapbox.com/android/api/map-sdk/7.1.2/com/mapbox/mapboxsdk/maps/MapboxMap.html#setStyle-java.lang.String-com.mapbox.
|
|
247
|
+
* @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-
|
|
249
248
|
*/
|
|
250
249
|
setMapStyle(style: string | MapStyle, nativeMapViewInstance?: any): Promise<void>;
|
|
251
250
|
getImage(imageId: string, nativeMap?: any): Promise<ImageSource>;
|
|
252
251
|
addImage(imageId: string, imagePath: string, nativeMap?: any): Promise<void>;
|
|
253
252
|
removeImage(imageId: string, nativeMap?: any): Promise<void>;
|
|
253
|
+
/**
|
|
254
|
+
*
|
|
255
|
+
* @deprecated
|
|
256
|
+
* @link https://github.com/mapbox/mapbox-plugins-android/tree/master/plugin-annotation
|
|
257
|
+
*/
|
|
254
258
|
addMarkers(markers: MapboxMarker[], nativeMap?: any): Promise<void>;
|
|
255
|
-
removeMarkers(ids?: any, nativeMap?: any): Promise<void>;
|
|
256
|
-
iconCache: {
|
|
257
|
-
[k: string]: com.mapbox.mapboxsdk.annotations.Icon;
|
|
258
|
-
};
|
|
259
259
|
/**
|
|
260
260
|
*
|
|
261
261
|
* @deprecated
|
|
262
262
|
* @link https://github.com/mapbox/mapbox-plugins-android/tree/master/plugin-annotation
|
|
263
263
|
*/
|
|
264
|
-
|
|
264
|
+
removeMarkers(ids?: any, nativeMap?: any): Promise<void>;
|
|
265
|
+
iconCache: {
|
|
266
|
+
[k: string]: ImageSource;
|
|
267
|
+
};
|
|
268
|
+
_addMarkers(markers: MapboxMarker[], nativeMap?: any): Promise<void>;
|
|
265
269
|
/**
|
|
266
270
|
*
|
|
267
271
|
* @deprecated
|
|
@@ -297,29 +301,22 @@ export declare class Mapbox extends MapboxCommon implements MapboxApi {
|
|
|
297
301
|
removePolygons(ids?: any[], nativeMap?: any): Promise<void>;
|
|
298
302
|
removePolylines(ids?: any[], nativeMap?: any): Promise<void>;
|
|
299
303
|
animateCamera(options: AnimateCameraOptions, nativeMap?: any): Promise<void>;
|
|
300
|
-
|
|
301
|
-
* set an on map click listener.
|
|
302
|
-
*
|
|
303
|
-
* The new Mapbox Native SDK allows for multiple listeners on an event and follows the standard
|
|
304
|
-
* pattern of returning 'true' when a handler has handled the event and others shouldn't.
|
|
305
|
-
*
|
|
306
|
-
* Not returning a boolean from the listener function will cause a crash.
|
|
307
|
-
*/
|
|
308
|
-
setOnMapClickListener(listener: (data: LatLng) => boolean, nativeMap?: MapboxView): Promise<void>;
|
|
304
|
+
setOnMapClickListener(listener: (data: LatLng) => boolean, nativeMap?: any): Promise<void>;
|
|
309
305
|
setOnMapLongClickListener(listener: (data: LatLng) => boolean, nativeMap?: any): Promise<void>;
|
|
310
306
|
setOnMoveBeginListener(listener: (data?: LatLng) => void, nativeMap?: any): Promise<void>;
|
|
311
307
|
setOnMoveEndListener(listener: (data?: LatLng) => void, nativeMap?: any): Promise<void>;
|
|
312
308
|
setOnScrollListener(listener: (data?: LatLng) => void, nativeMap?: any): Promise<void>;
|
|
313
309
|
setOnFlingListener(listener: () => void, nativeMap?: any): Promise<void>;
|
|
314
|
-
|
|
310
|
+
setOnCameraChangeListener(listener: (reason: any, animated?: any) => void, nativeMap?: any): Promise<void>;
|
|
315
311
|
setOnCameraMoveCancelListener(listener: () => void, nativeMap?: any): Promise<void>;
|
|
316
|
-
|
|
312
|
+
setOnMapIdleListener(listener: () => void, nativeMap?: any): Promise<void>;
|
|
317
313
|
getViewport(nativeMap?: any): Promise<Viewport>;
|
|
318
314
|
setViewport(options: SetViewportOptions, nativeMap?: any): Promise<void>;
|
|
319
315
|
downloadOfflineRegion(options: DownloadOfflineRegionOptions): Promise<any>;
|
|
320
316
|
listOfflineRegions(options?: ListOfflineRegionsOptions): Promise<OfflineRegion[]>;
|
|
321
317
|
deleteOfflineRegion(options: DeleteOfflineRegionOptions): Promise<void>;
|
|
322
|
-
_getOfflineManager():
|
|
318
|
+
_getOfflineManager(): com.mapbox.maps.OfflineManager;
|
|
319
|
+
_getTileStore(): com.mapbox.common.TileStore;
|
|
323
320
|
addExtrusion(options: AddExtrusionOptions, nativeMap?: any): Promise<void>;
|
|
324
321
|
/**
|
|
325
322
|
* update a geojson source
|
|
@@ -334,7 +331,7 @@ export declare class Mapbox extends MapboxCommon implements MapboxApi {
|
|
|
334
331
|
*
|
|
335
332
|
* @link https://docs.mapbox.com/mapbox-gl-js/api/#map#addsource
|
|
336
333
|
*/
|
|
337
|
-
addSource(id: string, options: AddSourceOptions, nativeMap?:
|
|
334
|
+
addSource(id: string, options: AddSourceOptions, nativeMap?: com.mapbox.maps.MapboxMap): Promise<void>;
|
|
338
335
|
/**
|
|
339
336
|
* remove source by id
|
|
340
337
|
*/
|
|
@@ -353,11 +350,11 @@ export declare class Mapbox extends MapboxCommon implements MapboxApi {
|
|
|
353
350
|
* - only a subset of paint properties are available.
|
|
354
351
|
*
|
|
355
352
|
* @param {object} style - a style following the Mapbox style specification.
|
|
356
|
-
* @param {any} nativeMapView - native map view (com.mapbox.
|
|
353
|
+
* @param {any} nativeMapView - native map view (com.mapbox.maps.MapView)
|
|
357
354
|
*
|
|
358
355
|
* @link https://docs.mapbox.com/mapbox-gl-js/style-spec/#layers
|
|
359
356
|
*/
|
|
360
|
-
addLayer(style: any, belowLayerId?: string, nativeMap?:
|
|
357
|
+
addLayer(style: any, belowLayerId?: string, nativeMap?: com.mapbox.maps.MapboxMap): Promise<void>;
|
|
361
358
|
/**
|
|
362
359
|
* remove layer by ID
|
|
363
360
|
*
|
|
@@ -366,6 +363,7 @@ export declare class Mapbox extends MapboxCommon implements MapboxApi {
|
|
|
366
363
|
* @param {string} id
|
|
367
364
|
*/
|
|
368
365
|
removeLayer(id: string, nativeMap?: any): Promise<void>;
|
|
366
|
+
private getSource;
|
|
369
367
|
/**
|
|
370
368
|
* @deprecated
|
|
371
369
|
* Add a point to a line
|
|
@@ -394,22 +392,21 @@ export declare class Mapbox extends MapboxCommon implements MapboxApi {
|
|
|
394
392
|
* @link https://github.com/mapbox/mapbox-gl-native/blob/master/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMapOptions.java
|
|
395
393
|
* @link https://docs.mapbox.com/android/api/map-sdk/7.1.2/com/mapbox/mapboxsdk/maps/MapboxMapOptions.html
|
|
396
394
|
*/
|
|
397
|
-
_getMapboxMapOptions(settings: ShowOptions): com.mapbox.
|
|
395
|
+
_getMapboxMapOptions(context: android.content.Context, settings: ShowOptions): com.mapbox.maps.MapInitOptions;
|
|
398
396
|
private static mapPositionToGravity;
|
|
399
397
|
/**
|
|
400
398
|
* convert string to camera mode constant.
|
|
401
399
|
*
|
|
402
400
|
* @link https://docs.mapbox.com/android/api/map-sdk/8.1.0/com/mapbox/mapboxsdk/location/modes/CameraMode.html
|
|
403
401
|
*/
|
|
404
|
-
_stringToCameraMode(mode: UserLocationCameraMode): any;
|
|
405
|
-
/**
|
|
406
|
-
* convert string to render mode
|
|
407
|
-
*/
|
|
408
|
-
_stringToRenderMode(mode: any): any;
|
|
409
|
-
_convertCameraMode(mode: any): UserLocationCameraMode;
|
|
410
402
|
_fineLocationPermissionGranted(): boolean;
|
|
411
|
-
_getRegionName(offlineRegion: com.mapbox.
|
|
412
|
-
_getRegionMetadata(offlineRegion: com.mapbox.
|
|
403
|
+
_getRegionName(offlineRegion: com.mapbox.common.TileRegion): Promise<any>;
|
|
404
|
+
_getRegionMetadata(offlineRegion: com.mapbox.common.TileRegion): Promise<Record<string, any>>;
|
|
405
|
+
_plugins: {
|
|
406
|
+
[k: string]: com.mapbox.maps.plugin.MapPlugin;
|
|
407
|
+
};
|
|
408
|
+
_getPlugin<T extends com.mapbox.maps.plugin.MapPlugin>(pluginId: string): T;
|
|
409
|
+
_getGesturesPlugin(): com.mapbox.maps.plugin.gestures.GesturesPlugin;
|
|
413
410
|
/**
|
|
414
411
|
* show a user location marker
|
|
415
412
|
*
|
|
@@ -437,7 +434,11 @@ export declare class Mapbox extends MapboxCommon implements MapboxApi {
|
|
|
437
434
|
*
|
|
438
435
|
* @todo at least with simulated data, the location is only updated once hence adding support for forceLocation method.
|
|
439
436
|
*/
|
|
440
|
-
showUserLocationMarker(options:
|
|
437
|
+
showUserLocationMarker(options: TrackUserOptions & {
|
|
438
|
+
accuracyColor: any;
|
|
439
|
+
accuracyRingColor: any;
|
|
440
|
+
pulsingColor: any;
|
|
441
|
+
}, nativeMap?: any): Promise<void>;
|
|
441
442
|
/**
|
|
442
443
|
* hide (destroy) the user location marker
|
|
443
444
|
*
|
|
@@ -453,7 +454,7 @@ export declare class Mapbox extends MapboxCommon implements MapboxApi {
|
|
|
453
454
|
* The marker must be configured using showUserLocationMarker before this method
|
|
454
455
|
* can called.
|
|
455
456
|
*/
|
|
456
|
-
changeUserLocationMarkerMode(
|
|
457
|
+
changeUserLocationMarkerMode(renderMode: any, cameraMode: UserLocationCameraMode, nativeMap?: any): Promise<void>;
|
|
457
458
|
/**
|
|
458
459
|
* force updating of user location
|
|
459
460
|
*
|
|
@@ -464,9 +465,9 @@ export declare class Mapbox extends MapboxCommon implements MapboxApi {
|
|
|
464
465
|
forceUserLocationUpdate(location: any, nativeMap?: any): Promise<void>;
|
|
465
466
|
getLayer(name: string, nativeMap?: any): Promise<LayerCommon>;
|
|
466
467
|
getLayers(nativeMap?: any): Promise<LayerCommon[]>;
|
|
467
|
-
_getClickedMarkerDetails(clicked:
|
|
468
|
-
_downloadImage(marker:
|
|
469
|
-
_downloadMarkerImages(markers:
|
|
468
|
+
_getClickedMarkerDetails(clicked: AndroidMarker): MapboxMarker;
|
|
469
|
+
_downloadImage(marker: MapboxMarker): Promise<MapboxMarker>;
|
|
470
|
+
_downloadMarkerImages(markers: MapboxMarker[]): Promise<MapboxMarker[]>;
|
|
470
471
|
project(data: LatLng): {
|
|
471
472
|
x: number;
|
|
472
473
|
y: number;
|
|
@@ -475,5 +476,4 @@ export declare class Mapbox extends MapboxCommon implements MapboxApi {
|
|
|
475
476
|
x: number;
|
|
476
477
|
y: number;
|
|
477
478
|
}): LatLng;
|
|
478
|
-
getUserLocationCameraMode(nativeMap?: any): UserLocationCameraMode;
|
|
479
479
|
}
|