@nativescript-community/ui-mapbox 6.2.19 → 6.2.20
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 +3 -115
- package/README.md +72 -12
- package/common.d.ts +199 -0
- package/common.js +43 -3
- package/expression/expression-parser.ios.js +1 -1
- package/geo.utils.d.ts +13 -0
- package/geo.utils.js +14 -1
- package/index.android.d.ts +332 -1
- package/index.android.js +448 -17
- package/index.ios.d.ts +179 -0
- package/index.ios.js +353 -45
- package/layers/layer-factory.android.js +2 -1
- package/layers/layer-factory.ios.js +4 -1
- package/layers/parser/property-parser.android.js +1 -0
- package/layers/parser/property-parser.ios.js +3 -3
- package/package.json +3 -3
package/index.ios.d.ts
CHANGED
|
@@ -2,19 +2,62 @@ import { ImageSource } from '@nativescript/core';
|
|
|
2
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 } from './common';
|
|
3
3
|
export * from './common';
|
|
4
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
|
+
*/
|
|
5
11
|
export declare class MapboxView extends MapboxViewBase {
|
|
6
12
|
private nativeMapView;
|
|
7
13
|
private delegate;
|
|
8
14
|
private settings;
|
|
9
15
|
private initialized;
|
|
10
16
|
private initCountHack;
|
|
17
|
+
/**
|
|
18
|
+
* programmatically include settings
|
|
19
|
+
*/
|
|
11
20
|
setConfig(settings: any): void;
|
|
12
21
|
getNativeMapView(): any;
|
|
13
22
|
createNativeView(): Object;
|
|
23
|
+
/**
|
|
24
|
+
* init the native view.
|
|
25
|
+
*
|
|
26
|
+
* FIXME: It appears that the order of events is different between iOS and Android.
|
|
27
|
+
* In the demo under Android, the main-page event handler is called first then the one
|
|
28
|
+
* in the plugin. Under iOS it's the reverse.
|
|
29
|
+
*
|
|
30
|
+
* The symptom is that any properties that reference a binding aren't available
|
|
31
|
+
* at the time this method is called. For example {{access_token}}.
|
|
32
|
+
*
|
|
33
|
+
* I'm sure there is something I do not understand about how this is supposed to work
|
|
34
|
+
* and that the handstands below are not necessary.
|
|
35
|
+
*/
|
|
14
36
|
onLoaded(): void;
|
|
15
37
|
initNativeView(): void;
|
|
38
|
+
/**
|
|
39
|
+
* when the view is destroyed.
|
|
40
|
+
*
|
|
41
|
+
* This is called by the framework when the view is destroyed (made not visible).
|
|
42
|
+
*
|
|
43
|
+
* However, it does not seem to be called when the page is unloaded.
|
|
44
|
+
*
|
|
45
|
+
* @link https://docs.nativescript.org/plugins/ui-plugin-custom
|
|
46
|
+
*/
|
|
16
47
|
disposeNativeView(): Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* returns a reference to the class Mapbox API shim instance
|
|
50
|
+
*
|
|
51
|
+
* @see Mapbox
|
|
52
|
+
*/
|
|
17
53
|
getMapboxApi(): any;
|
|
54
|
+
/**
|
|
55
|
+
* initialize the map
|
|
56
|
+
*
|
|
57
|
+
* @see MGLMapViewDelegateImpl
|
|
58
|
+
*
|
|
59
|
+
* @todo FIXME: figure out why the accessToken property (which is using a binding in the demo XML) isn't set before we arrive here.
|
|
60
|
+
*/
|
|
18
61
|
initMap(): void;
|
|
19
62
|
onLayout(left: number, top: number, right: number, bottom: number): void;
|
|
20
63
|
}
|
|
@@ -22,12 +65,37 @@ export declare class Mapbox extends MapboxCommon implements MapboxApi {
|
|
|
22
65
|
private _mapboxViewInstance;
|
|
23
66
|
private eventCallbacks;
|
|
24
67
|
private userLocationRenderMode;
|
|
68
|
+
/**
|
|
69
|
+
* set the mapboxViewInstance
|
|
70
|
+
*
|
|
71
|
+
* @see MapboxView::initMap();
|
|
72
|
+
*/
|
|
25
73
|
setMapboxViewInstance(mapboxViewInstance: any): void;
|
|
74
|
+
/**
|
|
75
|
+
* event handler shim
|
|
76
|
+
*
|
|
77
|
+
* Initialize our event handler shim so that we can intercept events here.
|
|
78
|
+
*
|
|
79
|
+
* @param { MapboxView } mapboxView
|
|
80
|
+
*/
|
|
26
81
|
initEventHandlerShim(settings: any, mapboxNativeViewInstance: any): void;
|
|
82
|
+
/**
|
|
83
|
+
* register a map event handler
|
|
84
|
+
*
|
|
85
|
+
* The NativeScript ContentView base class as on() and off() methods.
|
|
86
|
+
*/
|
|
27
87
|
onMapEvent(eventName: any, id: any, callback: any, nativeMapView?: any): void;
|
|
28
88
|
offMapEvent(eventName: any, id: any, nativeMapView?: any): void;
|
|
89
|
+
/**
|
|
90
|
+
* If click events registered and a feature found for the event, then fire listener.
|
|
91
|
+
*/
|
|
29
92
|
private checkForClickEvent;
|
|
30
93
|
private _addMarkers;
|
|
94
|
+
/**
|
|
95
|
+
* create an display the map
|
|
96
|
+
*
|
|
97
|
+
* @todo FIXME: This method is not called. See MapboxView::initMap().
|
|
98
|
+
*/
|
|
31
99
|
show(options: ShowOptions): Promise<any>;
|
|
32
100
|
hide(): Promise<void>;
|
|
33
101
|
unhide(): Promise<void>;
|
|
@@ -38,6 +106,9 @@ export declare class Mapbox extends MapboxCommon implements MapboxApi {
|
|
|
38
106
|
onStop(nativeMap?: any): Promise<void>;
|
|
39
107
|
onLowMemory(nativeMap?: any): Promise<void>;
|
|
40
108
|
onDestroy(nativeMap?: any): Promise<void>;
|
|
109
|
+
/**
|
|
110
|
+
* explicitly set a map style
|
|
111
|
+
*/
|
|
41
112
|
setMapStyle(style: string | MapStyle, nativeMap?: any): Promise<void>;
|
|
42
113
|
getImage(imageId: string, nativeMap?: any): Promise<ImageSource>;
|
|
43
114
|
addImage(imageId: string, image: string, nativeMap?: any): Promise<void>;
|
|
@@ -51,15 +122,58 @@ export declare class Mapbox extends MapboxCommon implements MapboxApi {
|
|
|
51
122
|
setTilt(options: SetTiltOptions, nativeMap?: any): Promise<void>;
|
|
52
123
|
getTilt(nativeMap?: any): Promise<number>;
|
|
53
124
|
getUserLocation(nativeMap?: any): Promise<UserLocation>;
|
|
125
|
+
/**
|
|
126
|
+
* convert string to camera mode constant.
|
|
127
|
+
*
|
|
128
|
+
* Supported modes on iOS are different than on Android.
|
|
129
|
+
*
|
|
130
|
+
* @todo come up with a reasonable set of cross platform defaults.
|
|
131
|
+
*/
|
|
54
132
|
_stringToCameraMode(mode: UserLocationCameraMode): any;
|
|
55
133
|
_stringToRenderMode(mode: any): any;
|
|
56
134
|
_convertCameraMode(mode: MGLUserTrackingMode): UserLocationCameraMode;
|
|
135
|
+
/**
|
|
136
|
+
* show a user location marker
|
|
137
|
+
*
|
|
138
|
+
* This method must not be called before location permissions have been granted.
|
|
139
|
+
*
|
|
140
|
+
* Supported options under iOS are:
|
|
141
|
+
*
|
|
142
|
+
* - renderMode
|
|
143
|
+
* - cameraMode
|
|
144
|
+
* - clickListener
|
|
145
|
+
*
|
|
146
|
+
* Other options are ignored. Compare with the android version that supports a
|
|
147
|
+
* different set of options.
|
|
148
|
+
*
|
|
149
|
+
* @param {object} options
|
|
150
|
+
*/
|
|
57
151
|
showUserLocationMarker(options: any, nativeMap?: any): Promise<void>;
|
|
152
|
+
/**
|
|
153
|
+
* hide the user location marker
|
|
154
|
+
*
|
|
155
|
+
* @todo unfinished
|
|
156
|
+
*/
|
|
58
157
|
hideUserLocationMarker(nativeMap?: any): Promise<void>;
|
|
158
|
+
/**
|
|
159
|
+
* Change the mode of the user location marker
|
|
160
|
+
*
|
|
161
|
+
* Used to change the camera tracking and render modes of an existing
|
|
162
|
+
* marker.
|
|
163
|
+
*
|
|
164
|
+
* The marker must be configured using showUserLocationMarker before this method
|
|
165
|
+
* can called.
|
|
166
|
+
*/
|
|
59
167
|
changeUserLocationMarkerMode(renderModeString: any, cameraModeString: UserLocationCameraMode, nativeMap?: any): Promise<void>;
|
|
168
|
+
/**
|
|
169
|
+
* ignored on iOS
|
|
170
|
+
*/
|
|
60
171
|
forceUserLocationUpdate(location: any, nativeMap?: any): void;
|
|
61
172
|
queryRenderedFeatures(options: QueryRenderedFeaturesOptions, nativeMap?: any): Promise<Feature[]>;
|
|
62
173
|
querySourceFeatures(sourceId: string, options?: QuerySourceFeaturesOptions, nativeMap?: any): Promise<Feature[]>;
|
|
174
|
+
/**
|
|
175
|
+
* @deprecated
|
|
176
|
+
*/
|
|
63
177
|
addPolygon(options: AddPolygonOptions, nativeMap?: any): Promise<void>;
|
|
64
178
|
addPolyline(options: AddPolylineOptions, nativeMap?: any): Promise<void>;
|
|
65
179
|
private removePolyById;
|
|
@@ -67,9 +181,19 @@ export declare class Mapbox extends MapboxCommon implements MapboxApi {
|
|
|
67
181
|
removePolygons(ids?: any[], nativeMap?: any): Promise<void>;
|
|
68
182
|
removePolylines(ids?: any[], nativeMap?: any): Promise<void>;
|
|
69
183
|
animateCamera(options: AnimateCameraOptions, nativeMap?: any): Promise<void>;
|
|
184
|
+
/**
|
|
185
|
+
* sets a map level click listener
|
|
186
|
+
*
|
|
187
|
+
*/
|
|
70
188
|
setOnMapClickListener(listener: (data: LatLng) => void, nativeMap?: any): Promise<void>;
|
|
71
189
|
setOnMapLongClickListener(listener: (data: LatLng) => void, nativeMap?: any): Promise<void>;
|
|
72
190
|
setOnScrollListener(listener: (data?: LatLng) => void, nativeMap?: any): Promise<void>;
|
|
191
|
+
/**
|
|
192
|
+
* simulates onMoveBegin single event callback
|
|
193
|
+
*
|
|
194
|
+
* This will call the listener provided once per pan akin to the way
|
|
195
|
+
* onMoveBegin on the Android side works.
|
|
196
|
+
*/
|
|
73
197
|
setOnMoveBeginListener(listener: (data?: LatLng) => void, nativeMap?: any): Promise<void>;
|
|
74
198
|
setOnMoveEndListener(listener: () => void, nativeMap?: any): Promise<void>;
|
|
75
199
|
setOnFlingListener(listener: () => void, nativeMap?: any): Promise<void>;
|
|
@@ -82,11 +206,66 @@ export declare class Mapbox extends MapboxCommon implements MapboxApi {
|
|
|
82
206
|
listOfflineRegions(options?: ListOfflineRegionsOptions): Promise<OfflineRegion[]>;
|
|
83
207
|
deleteOfflineRegion(options: DeleteOfflineRegionOptions): Promise<void>;
|
|
84
208
|
addExtrusion(options: AddExtrusionOptions, nativeMap?: any): Promise<void>;
|
|
209
|
+
/**
|
|
210
|
+
* update a geojson source
|
|
211
|
+
*
|
|
212
|
+
*/
|
|
85
213
|
updateSource(id: string, options: UpdateSourceOptions, nativeMap?: any): Promise<void>;
|
|
214
|
+
/**
|
|
215
|
+
* add a vector or geojson source
|
|
216
|
+
*
|
|
217
|
+
* Add a source that can then be referenced in the style specification
|
|
218
|
+
* passed to addLayer().
|
|
219
|
+
*
|
|
220
|
+
* @link https://docs.mapbox.com/mapbox-gl-js/api/#map#addsource
|
|
221
|
+
*/
|
|
86
222
|
addSource(id: string, options: AddSourceOptions, nativeMap?: any): Promise<void>;
|
|
223
|
+
/**
|
|
224
|
+
* remove source by id
|
|
225
|
+
*/
|
|
87
226
|
removeSource(id: string, nativeMap?: any): Promise<void>;
|
|
227
|
+
/**
|
|
228
|
+
* a rough analogue to the mapbox-gl-js addLayer() method
|
|
229
|
+
*
|
|
230
|
+
* It would be nice if this {N} API matched the mapbox-gl-js API which
|
|
231
|
+
* would make it much easier to share mapping applications between the web
|
|
232
|
+
* and {N} apps.
|
|
233
|
+
*
|
|
234
|
+
* This method accepts a Mapbox-GL-JS style specification JSON object with some
|
|
235
|
+
* limitations:
|
|
236
|
+
*
|
|
237
|
+
* - the source: must be a GeoJSON object.
|
|
238
|
+
* - only a subset of paint properties are available.
|
|
239
|
+
*
|
|
240
|
+
* @param {object} style - a style following the Mapbox style specification.
|
|
241
|
+
* @param {any} nativeMapView - native map view (com.mapbox.mapboxsdk.maps.MapView)
|
|
242
|
+
*
|
|
243
|
+
* @link https://docs.mapbox.com/mapbox-gl-js/style-spec/#layers
|
|
244
|
+
*/
|
|
88
245
|
addLayer(style: any, belowLayerId?: string, nativeMapView?: any): Promise<void>;
|
|
246
|
+
/**
|
|
247
|
+
* remove layer by ID
|
|
248
|
+
*
|
|
249
|
+
* Removes a layer given a layer id
|
|
250
|
+
*
|
|
251
|
+
* @param {string} id
|
|
252
|
+
*/
|
|
89
253
|
removeLayer(id: string, nativeMapViewInstance?: any): Promise<void>;
|
|
254
|
+
/**
|
|
255
|
+
* @deprecated
|
|
256
|
+
* Add a point to a line
|
|
257
|
+
*
|
|
258
|
+
* This method appends a point to a line and is useful for drawing a users track.
|
|
259
|
+
*
|
|
260
|
+
* The process for adding a point to a line is different in the iOS sdk than in
|
|
261
|
+
* the Android java sdk.
|
|
262
|
+
*
|
|
263
|
+
* @param {id} id - id of line to add a point to.
|
|
264
|
+
* @param {array} lnglat - [lng,lat] to append to the line.
|
|
265
|
+
*
|
|
266
|
+
* @link https://github.com/mapbox/mapbox-gl-native/issues/13983
|
|
267
|
+
* @link https://docs.mapbox.com/ios/maps/examples/runtime-animate-line/
|
|
268
|
+
*/
|
|
90
269
|
addLinePoint(id: string, lnglat: any, sourceId?: string, nativeMapView?: any): Promise<void>;
|
|
91
270
|
addGeoJsonClustered(options: AddGeoJsonClusteredOptions, nativeMapViewInstance?: any): Promise<void>;
|
|
92
271
|
trackUser(options: TrackUserOptions, nativeMap?: any): Promise<void>;
|