@nativescript-community/ui-mapbox 6.2.9 → 6.2.13

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.
Files changed (30) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +199 -99
  3. package/{mapbox.common.d.ts → common.d.ts} +20 -3
  4. package/{mapbox.common.js → common.js} +18 -1
  5. package/{filter/filter-parser.android.d.ts → expression/expression-parser.android.d.ts} +1 -1
  6. package/{filter/filter-parser.android.js → expression/expression-parser.android.js} +2 -2
  7. package/expression/expression-parser.d.ts +4 -0
  8. package/{filter/filter-parser.ios.d.ts → expression/expression-parser.ios.d.ts} +1 -1
  9. package/{filter/filter-parser.ios.js → expression/expression-parser.ios.js} +2 -2
  10. package/{mapbox.android.d.ts → index.android.d.ts} +5 -14
  11. package/{mapbox.android.js → index.android.js} +142 -66
  12. package/index.d.ts +98 -6
  13. package/{mapbox.ios.d.ts → index.ios.d.ts} +3 -30
  14. package/{mapbox.ios.js → index.ios.js} +1300 -1250
  15. package/layers/layer-factory.android.d.ts +14 -1
  16. package/layers/layer-factory.android.js +33 -2
  17. package/layers/layer-factory.d.ts +15 -1
  18. package/layers/layer-factory.ios.d.ts +14 -1
  19. package/layers/layer-factory.ios.js +42 -2
  20. package/layers/parser/property-parser.android.d.ts +1 -0
  21. package/layers/parser/property-parser.android.js +25 -0
  22. package/layers/parser/property-parser.d.ts +4 -0
  23. package/layers/parser/property-parser.ios.d.ts +1 -0
  24. package/layers/parser/property-parser.ios.js +21 -0
  25. package/package.json +55 -49
  26. package/platforms/android/include.gradle +4 -1
  27. package/platforms/android/ui_mapbox.aar +0 -0
  28. package/platforms/ios/Podfile +2 -2
  29. package/typings/Mapbox.ios.d.ts +2 -0
  30. package/LICENSE +0 -21
package/CHANGELOG.md CHANGED
@@ -3,6 +3,42 @@
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
+ ## [6.2.13](https://github.com/nativescript-community/ui-mapbox/compare/v6.2.12...v6.2.13) (2022-01-19)
7
+
8
+ **Note:** Version bump only for package @nativescript-community/ui-mapbox
9
+
10
+
11
+
12
+
13
+
14
+ ## [6.2.12](https://github.com/nativescript-community/ui-mapbox/compare/v6.2.11...v6.2.12) (2022-01-17)
15
+
16
+ **Note:** Version bump only for package @nativescript-community/ui-mapbox
17
+
18
+
19
+
20
+
21
+
22
+ ## [6.2.11](https://github.com/nativescript-community/ui-mapbox/compare/v6.2.10...v6.2.11) (2022-01-09)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * add okhttp implementation ([f73304f](https://github.com/nativescript-community/ui-mapbox/commit/f73304faf9fae447bf0e56c794ed818d2357d887))
28
+ * downgrade iOS Mapbox version ([3aa8196](https://github.com/nativescript-community/ui-mapbox/commit/3aa8196259497799a2f8c1019b0210b9834bb2cf))
29
+
30
+
31
+
32
+
33
+
34
+ ## [6.2.10](https://github.com/nativescript-community/ui-mapbox/compare/v6.2.9...v6.2.10) (2021-09-28)
35
+
36
+ **Note:** Version bump only for package @nativescript-community/ui-mapbox
37
+
38
+
39
+
40
+
41
+
6
42
  ## [6.2.9](https://github.com/nativescript-community/ui-mapbox/compare/v6.2.8...v6.2.9) (2021-05-07)
7
43
 
8
44
  **Note:** Version bump only for package @nativescript-community/ui-mapbox
package/README.md CHANGED
@@ -1,93 +1,127 @@
1
- <a href="https://www.mapbox.com">
2
- <img src="https://raw.githubusercontent.com/nativescript-community/ui-mapbox/master/screenshots/mapbox_logo.png" width="400"/>
3
- </a>
1
+ <!-- ⚠️ This README has been generated from the file(s) "blueprint.md" ⚠️-->
2
+ <!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
4
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
5
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
6
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
8
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
9
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
11
+ DO NOT EDIT THIS READEME DIRECTLY! Edit "bluesprint.md" instead.
12
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
13
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
14
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
15
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
16
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
17
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
18
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
19
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
20
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
21
+ <h1 align="center">@nativescript-community/ui-mapbox</h1>
22
+ <p align="center">
23
+ <a href="https://npmcharts.com/compare/@nativescript-community/ui-mapbox?minimal=true"><img alt="Downloads per month" src="https://img.shields.io/npm/dm/@nativescript-community/ui-mapbox.svg" height="20"/></a>
24
+ <a href="https://www.npmjs.com/package/@nativescript-community/ui-mapbox"><img alt="NPM Version" src="https://img.shields.io/npm/v/@nativescript-community/ui-mapbox.svg" height="20"/></a>
25
+ </p>
26
+
27
+ <p align="center">
28
+ <b>Interactive, thoroughly customizable maps powered by vector tiles and OpenGL.</b></br>
29
+ <sub><sub>
30
+ </p>
31
+
32
+ <br />
33
+
34
+
35
+
36
+ [](#table-of-contents)
37
+
38
+ ## Table of Contents
39
+
40
+ * [Prerequisites](#prerequisites)
41
+ * [Installation](#installation)
42
+ * [Configuration](#configuration)
43
+ * [Issues](#issues)
44
+ * [Usage](#usage)
45
+ * [XML](#xml)
46
+ * [Angular](#angular)
47
+ * [API](#api)
48
+ * [Markers](#markers)
49
+ * [Viewport](#viewport)
50
+ * [Declaring Programmatically](#declaring-programmatically)
51
+ * [Methods](#methods)
52
+ * [show](#show)
53
+ * [hide](#hide)
54
+ * [unhide](#unhide)
55
+ * [destroy 💥](#destroy-)
56
+ * [setMapStyle](#setmapstyle)
57
+ * [addMarkers](#addmarkers)
58
+ * [Updating markers](#updating-markers)
59
+ * [removeMarkers](#removemarkers)
60
+ * [setViewport](#setviewport)
61
+ * [getViewport](#getviewport)
62
+ * [setCenter](#setcenter)
63
+ * [getCenter](#getcenter)
64
+ * [setZoomLevel](#setzoomlevel)
65
+ * [getZoomLevel](#getzoomlevel)
66
+ * [animateCamera](#animatecamera)
67
+ * [setTilt (Android only)](#settilt-android-only)
68
+ * [getTilt (Android only)](#gettilt-android-only)
69
+ * [getUserLocation](#getuserlocation)
70
+ * [trackUser](#trackuser)
71
+ * [addSource](#addsource)
72
+ * [removeSource](#removesource)
73
+ * [addLayer](#addlayer)
74
+ * [removeLayer](#removelayer)
75
+ * [queryRenderedFeatures](#queryrenderedfeatures)
76
+ * [querySourceFeatures](#querysourcefeatures)
77
+ * [addLinePoint](#addlinepoint)
78
+ * [addPolygon (**deprecated**, use addLayer() instead)](#addpolygon-deprecated-use-addlayer-instead)
79
+ * [removePolygons](#removepolygons)
80
+ * [addPolyline](#addpolyline)
81
+ * [removePolylines](#removepolylines)
82
+ * [setOnMapClickListener](#setonmapclicklistener)
83
+ * [setOnMapLongClickListener](#setonmaplongclicklistener)
84
+ * [setOnScrollListener](#setonscrolllistener)
85
+ * [Offline maps](#offline-maps)
86
+ * [downloadOfflineRegion](#downloadofflineregion)
87
+ * [Advanced example: download the current viewport](#advanced-example-download-the-current-viewport)
88
+ * [listOfflineRegions](#listofflineregions)
89
+ * [deleteOfflineRegion](#deleteofflineregion)
90
+ * [Permissions](#permissions)
91
+ * [hasFineLocationPermission / requestFineLocationPermission](#hasfinelocationpermission--requestfinelocationpermission)
92
+ * [Using marker images from the internet](#using-marker-images-from-the-internet)
93
+ * [Demos and Development](#demos-and-development)
94
+ * [Setup](#setup)
95
+ * [Build](#build)
96
+ * [Demos](#demos)
97
+ * [Questions](#questions)
98
+
99
+
100
+ [](#prerequisites)
101
+
102
+ ## Prerequisites
4
103
 
5
- # NativeScript Mapbox plugin
6
-
7
- [npm-image]:http://img.shields.io/npm/v/@nativescript-community/ui-mapbox.svg
8
- [npm-url]:https://npmjs.org/package/@nativescript-community/ui-mapbox
9
- [downloads-image]:http://img.shields.io/npm/dm/@nativescript-community/ui-mapbox.svg
10
-
11
- Awesome native OpenGL-powered maps - by Mapbox
12
-
13
- <img src="https://raw.githubusercontent.com/nativescript-community/ui-mapbox/master/screenshots/ios-demoapp-slice.png" width="375px" height="196px" />
14
-
15
-
16
- # WARNING
17
-
18
- As we switched to a community managed plugin we upgraded the version of the Mapbox SDKs. Though starting from iOS SDK 6.0 and android SDK 9.0 they need special handling for downloading the SDK:
19
- [iOS](https://docs.mapbox.com/ios/maps/overview/#configure-credentials)
20
-
21
- [Android](https://docs.mapbox.com/android/maps/overview/#configure-credentials)
22
-
23
- On android the plugin default to 8.x. You can change it by creating a `before-plugins.gradle` in `App_Resources/Android` with (showing current versions):
24
- ```
25
- ext {
26
- okHttpVersion = "3.12.10"
27
- def mapboxVersion = "8.6.6"
28
- def mapboxTelemetryVersion = "6.1.0"
29
- def mapboxPluginsVersion = "v9"
30
- def mapboxAnnotationPluginVersion = "0.9.0"
31
- def mapboxGesturesVersion = "0.7.0"
32
- }
33
-
34
- ```
35
-
36
- On iOS we dont force anything so it will get the latest one. If you want to change it create a `Podfile` in `App_Resources/iOS` with (see demo app):
37
- ```
38
- pod 'Mapbox-iOS-SDK', '~> 5.1.1'
39
- ```
40
-
41
-
42
- ## Before you begin - Prerequisites
43
104
  You either need your own tile server such as the one provided by [openmaptiles.org](https://openmaptiles.org) or a Mapbox API access token (they have a 🆓 Starter plan!), so [sign up with Mapbox](https://www.mapbox.com/signup/).
44
105
  Once you've registered go to your Account > Apps > New token. The 'Default Secret Token' is what you'll need.
45
106
 
46
- You will also need to set up your development environment. Please refer to the [NativeScript documentation](https://docs.nativescript.org/start/quick-setup).
47
-
48
- # Installation
49
-
50
- ```
51
- $ ns plugin install @nativescript-community/ui-mapbox
52
- ```
53
-
54
- # DEMOS
55
-
56
- Two demo applications are available in the repository.
57
-
58
- To run them, you'll need to clone the github repository and build the plugin. See below.
107
+
108
+ [](#installation)
109
+
110
+ ## Installation
111
+ Run the following command from the root of your project:
59
112
 
60
- You will also need an access token. Your access_token can then be set in the top level mapbox_config.ts file.
113
+ `ns plugin add @nativescript-community/ui-mapbox`
61
114
 
62
- The style can be set to one of the Mapbox style names or it can be the URL of your own hosted tile server.
115
+
116
+ [](#configuration)
117
+
118
+ ## Configuration
63
119
 
64
- > NOTE: As of this writing, the NativeScript demo only works with a mapbox token. The demo-angular will work with either a self hosted tile server or a mapbox token.
65
-
66
- ## Demo prerequisites
67
- ```
68
- npm i
69
- npm run setup
70
- ```
71
-
72
-
73
- ## To run the Angular demo
74
-
75
- ```
76
- npm run build
77
- cd ./demo-angular
78
- ns run <platform>
79
- ```
80
-
81
- ## To run the plain Nativescript demo
82
- ```
83
- npm run build
84
- cd ./demo
85
- ns run <platform>
86
- ```
87
-
88
- ## Roadmap
89
- [https://github.com/orgs/nativescript-community/projects/4](https://github.com/orgs/nativescript-community/projects/4)
120
+ Add any other additional configuration instructions here.
90
121
 
122
+
123
+ [](#issues)
124
+
91
125
  ## Issues
92
126
 
93
127
  If you get an error during iOS build related to Podspec versions, probably the easiest fix is:
@@ -101,23 +135,17 @@ On Android the plugin adds this to the `<application>` node of `app/App_Resource
101
135
 
102
136
  If you get an error related to `TelemetryService` then please check it's there.
103
137
 
138
+
139
+ [](#usage)
140
+
104
141
  ## Usage
105
142
 
106
- ### Demo app (XML + TypeScript)
107
- If you want a quickstart, see the demo in this repository.
108
- It shows you how to draw a map in XML and JS with almost all possible options.
109
-
110
- ### Demo app (Angular)
111
- There is also the beginnings of an Angular demo in demo-angular in this repository.
112
-
113
- ## Declaring a map in the view
114
-
115
143
  ### XML
116
144
  You can instantiate a map from JS or TS. As the map is yet another view component it will play nice with any NativeScript layout you throw it in. You can also easily add multiple maps to the same page or to different pages in any layout you like.
117
145
 
118
146
  A simple layout could look like this:
119
147
 
120
- <img src="https://raw.githubusercontent.com/nativescript-community/ui-mapbox/master/screenshots/ios-xml-declared.png" width="373px" height="361px" />
148
+ <img src="https://raw.githubusercontent.com/nativescript-community/ui-mapbox/master/images/ios-xml-declared.png" width="373px" height="361px" />
121
149
 
122
150
  Could be rendered by a definition like this:
123
151
 
@@ -144,7 +172,7 @@ Could be rendered by a definition like this:
144
172
  Component:
145
173
 
146
174
  ```typescript
147
- import { registerElement } from "nativescript-angular/element-registry";
175
+ import { registerElement } from '@nativescript/angular';
148
176
  registerElement("Mapbox", () => require("@nativescript-community/ui-mapbox").MapboxView);
149
177
  ```
150
178
 
@@ -169,7 +197,10 @@ View:
169
197
  </ContentView>
170
198
  ```
171
199
 
172
- ### Available XML/Angular options
200
+
201
+ [](#api)
202
+
203
+ ## API
173
204
  All currently supported options for your XML based map are (__don't__ use other properties - if you need styling wrap the map in a `ContentView` and apply things like `width` to that container!):
174
205
 
175
206
  |option|default|description
@@ -189,11 +220,15 @@ All currently supported options for your XML based map are (__don't__ use other
189
220
  |`disableScroll`|false|Don't allow the user to move the center of the map (one finger drag)
190
221
  |`disableTilt`|false|Don't allow the user to tilt the map (two finger drag up or down)
191
222
  |`mapReady`|-|The name of a callback function you can declare to interact with the map after it has been drawn
192
- |`moveBeginEvent`|-|The name of a function to be called when the map is moved.
223
+ |`moveBeginEvent`|-|The name of a function to be called when the map has begun to move.
224
+ |`moveEndEvent`|-|The name of a function to be called when the map has completed moving.
193
225
  |`locationPermissionGranted`|-|The name of a callback function you can declare to get notified when the user granted location permissions
194
226
  |`locationPermissionDenied`|-|The name of a callback function you can declare to get notified when the user denied location permissions (will never fire on iOS because there's nothing to deny)
195
227
 
196
- ### Want to add markers?
228
+
229
+ [](#markers)
230
+
231
+ ## Markers
197
232
  This is where that last option in the table above comes in - `mapReady`.
198
233
  It allows you to interact with the map after it has been drawn to the page.
199
234
 
@@ -223,7 +258,10 @@ function onMapReady(args) {
223
258
  exports.onMapReady = onMapReady;
224
259
  ```
225
260
 
226
- ### .. or want to set the viewport bounds?
261
+
262
+ [](#viewport)
263
+
264
+ ## Viewport
227
265
 
228
266
  ```js
229
267
  var mapbox = require("@nativescript-community/ui-mapbox");
@@ -250,7 +288,10 @@ The methods you can invoke like this from an XML-declared map are:
250
288
 
251
289
  Check out the usage details on the functions below.
252
290
 
253
- ## Declaring a map programmatically
291
+
292
+ [](#declaring-programmatically)
293
+
294
+ ## Declaring Programmatically
254
295
 
255
296
  Add a container to your view XML where you want to programmatically add the map. Give it an id.
256
297
 
@@ -258,6 +299,11 @@ Add a container to your view XML where you want to programmatically add the map.
258
299
  <ContentView id="mapContainer" />
259
300
  ```
260
301
 
302
+
303
+ [](#methods)
304
+
305
+ ## Methods
306
+
261
307
  ### show
262
308
  ```ts
263
309
 
@@ -404,7 +450,7 @@ You can update the map style after you've loaded it.
404
450
  ])
405
451
  ```
406
452
 
407
- #### Updating markers
453
+ ### Updating markers
408
454
  Plugin version 4.2.0 added the option to update makers. Just call `update` on the `MapboxMarker` reference you created above.
409
455
  You can update the following properties (all but the icon really):
410
456
 
@@ -853,6 +899,9 @@ Add a listener to retrieve lat and lng of where the user scrolls to on the map.
853
899
  });
854
900
  ```
855
901
 
902
+
903
+ [](#offline-maps)
904
+
856
905
  ## Offline maps
857
906
  For situations where you want the user to pre-load certain regions you can use these methods to create and remove offline regions.
858
907
 
@@ -947,6 +996,9 @@ You can remove regions you've previously downloaded. Any region(s) matching the
947
996
  ```
948
997
 
949
998
 
999
+
1000
+ [](#permissions)
1001
+
950
1002
  ## Permissions
951
1003
 
952
1004
  ### hasFineLocationPermission / requestFineLocationPermission
@@ -980,6 +1032,9 @@ Note that `hasFineLocationPermission` will return true when:
980
1032
  Note that the `show` function will also check for permission if you passed in `showUserLocation : true`.
981
1033
  If you didn't request permission before showing the map, and permission was needed, the plugin will ask the user permission while rendering the map.
982
1034
 
1035
+
1036
+ [](#using-marker-images-from-the-internet)
1037
+
983
1038
  ## Using marker images from the internet
984
1039
  If you specify `icon: 'http(s)://some-remote-image'`, then on iOS you'll need to whitelist
985
1040
  the domain. Google for iOS ATS for detailed options, but for a quick test you can add this to
@@ -992,3 +1047,48 @@ the domain. Google for iOS ATS for detailed options, but for a quick test you ca
992
1047
  <true/>
993
1048
  </dict>
994
1049
  ```
1050
+
1051
+
1052
+ [](#demos-and-development)
1053
+
1054
+ ## Demos and Development
1055
+
1056
+
1057
+ ### Setup
1058
+
1059
+ To run the demos, you must clone this repo **recursively**.
1060
+
1061
+ ```
1062
+ git clone https://github.com/@nativescript-community/ui-mapbox.git --recursive
1063
+ ```
1064
+
1065
+ **Install Dependencies:**
1066
+ ```bash
1067
+ npm i # or 'yarn install' or 'pnpm install'
1068
+ ```
1069
+
1070
+ **Interactive Menu:**
1071
+
1072
+ To start the interactive menu, run `npm start` (or `yarn start` or `pnpm start`). This will list all of the commonly used scripts.
1073
+
1074
+ ### Build
1075
+
1076
+ ```bash
1077
+ npm run build
1078
+
1079
+ npm run build.angular # or for Angular
1080
+ ```
1081
+
1082
+ ### Demos
1083
+
1084
+ ```bash
1085
+ npm run demo.[ng|react|svelte|vue].[ios|android]
1086
+
1087
+ npm run demo.svelte.ios # Example
1088
+ ```
1089
+
1090
+ [](#questions)
1091
+
1092
+ ## Questions
1093
+
1094
+ If you have any questions/issues/comments please feel free to create an issue or start a conversation in the [NativeScript Community Discord](https://nativescript.org/discord).
@@ -1,4 +1,8 @@
1
1
  import { Color, ContentView, ImageSource, Property } from '@nativescript/core';
2
+ export * from './geo.utils';
3
+ export * from './expression/expression-parser';
4
+ export * from './layers/layer-factory';
5
+ export * from './layers/parser/property-parser';
2
6
  export declare const MapboxTraceCategory = "NativescriptMapbox";
3
7
  export declare enum CLogTypes {
4
8
  log,
@@ -102,7 +106,8 @@ export interface SetViewportOptions {
102
106
  padding?: number;
103
107
  }
104
108
  export interface DeleteOfflineRegionOptions {
105
- name: string;
109
+ id?: string;
110
+ name?: string;
106
111
  }
107
112
  export interface MapboxCluster {
108
113
  points: number;
@@ -165,11 +170,15 @@ export interface GeoJSONSource extends Source {
165
170
  cluster?: {
166
171
  radius: any;
167
172
  maxZoom: any;
173
+ properties?: {
174
+ [property: string]: [any, any];
175
+ };
168
176
  };
169
177
  }
170
- export declare type UserLocationCameraMode = 'NONE' | 'NONE_COMPASS' | 'NONE_GPS' | 'TRACKING' | 'TRACK_COMPASS' | 'TRACKING_GPS' | 'TRACK_GPS_NORTH';
178
+ export declare type UserLocationCameraMode = 'NONE' | 'NONE_COMPASS' | 'NONE_GPS' | 'TRACKING' | 'TRACKING_COMPASS' | 'TRACKING_GPS' | 'TRACKING_GPS_NORTH';
171
179
  export interface TrackUserOptions {
172
- mode: UserLocationCameraMode;
180
+ cameraMode: UserLocationCameraMode;
181
+ renderMode?: string;
173
182
  animated?: boolean;
174
183
  }
175
184
  export interface AddExtrusionOptions {
@@ -180,6 +189,9 @@ export interface OfflineRegion {
180
189
  minZoom: number;
181
190
  maxZoom: number;
182
191
  style: MapStyle;
192
+ metadata?: any;
193
+ pixelRatio?: any;
194
+ type?: any;
183
195
  }
184
196
  export interface DownloadProgress {
185
197
  name: string;
@@ -296,6 +308,7 @@ export interface MapboxApi {
296
308
  setOnMapLongClickListener(listener: (data: LatLng) => boolean, nativeMap?: any): Promise<any>;
297
309
  setOnScrollListener(listener: (data?: LatLng) => void, nativeMap?: any): Promise<void>;
298
310
  setOnMoveBeginListener(listener: (data?: LatLng) => void, nativeMap?: any): Promise<void>;
311
+ setOnMoveEndListener(listener: (data?: LatLng) => void, nativeMap?: any): Promise<void>;
299
312
  setOnFlingListener(listener: () => void, nativeMap?: any): Promise<any>;
300
313
  setOnCameraMoveListener(listener: (reason: any, animated?: boolean) => void, nativeMap?: any): Promise<any>;
301
314
  setOnCameraMoveCancelListener(listener: () => void, nativeMap?: any): Promise<any>;
@@ -332,6 +345,7 @@ export declare abstract class MapboxCommon implements MapboxCommonApi {
332
345
  };
333
346
  zoomLevel: number;
334
347
  showUserLocation: boolean;
348
+ locationComponentOptions: {};
335
349
  hideLogo: boolean;
336
350
  hideAttribution: boolean;
337
351
  hideCompass: boolean;
@@ -410,6 +424,7 @@ export declare abstract class MapboxViewCommonBase extends ContentView implement
410
424
  setOnMapLongClickListener(listener: (data: LatLng) => boolean): Promise<any>;
411
425
  setOnScrollListener(listener: (data?: LatLng) => void, nativeMap?: any): Promise<void>;
412
426
  setOnMoveBeginListener(listener: (data?: LatLng) => void, nativeMap?: any): Promise<void>;
427
+ setOnMoveEndListener(listener: (data?: LatLng) => void, nativeMap?: any): Promise<void>;
413
428
  setOnFlingListener(listener: () => void, nativeMap?: any): Promise<any>;
414
429
  setOnCameraMoveListener(listener: (reason: any, animated?: boolean) => void, nativeMap?: any): Promise<any>;
415
430
  setOnCameraMoveCancelListener(listener: () => void, nativeMap?: any): Promise<any>;
@@ -466,6 +481,7 @@ export declare const mapStyleProperty: Property<MapboxViewCommonBase, string>;
466
481
  export declare const latitudeProperty: Property<MapboxViewCommonBase, number>;
467
482
  export declare const longitudeProperty: Property<MapboxViewCommonBase, number>;
468
483
  export declare const showUserLocationProperty: Property<MapboxViewCommonBase, boolean>;
484
+ export declare const locationComponentOptionsProperty: Property<MapboxViewCommonBase, object>;
469
485
  export declare const hideLogoProperty: Property<MapboxViewCommonBase, boolean>;
470
486
  export declare const hideAttributionProperty: Property<MapboxViewCommonBase, boolean>;
471
487
  export declare const telemetryProperty: Property<MapboxViewCommonBase, boolean>;
@@ -479,6 +495,7 @@ export declare abstract class MapboxViewBase extends MapboxViewCommonBase {
479
495
  static mapReadyEvent: string;
480
496
  static scrollEvent: string;
481
497
  static moveBeginEvent: string;
498
+ static moveEndEvent: string;
482
499
  static locationPermissionGrantedEvent: string;
483
500
  static locationPermissionDeniedEvent: string;
484
501
  protected config: any;
@@ -1,4 +1,8 @@
1
1
  import { ContentView, Property, Trace, booleanConverter } from '@nativescript/core';
2
+ export * from './geo.utils';
3
+ export * from './expression/expression-parser';
4
+ export * from './layers/layer-factory';
5
+ export * from './layers/parser/property-parser';
2
6
  export const MapboxTraceCategory = 'NativescriptMapbox';
3
7
  export var CLogTypes;
4
8
  (function (CLogTypes) {
@@ -59,6 +63,7 @@ MapboxCommon.defaults = {
59
63
  },
60
64
  zoomLevel: 0,
61
65
  showUserLocation: false,
66
+ locationComponentOptions: {},
62
67
  hideLogo: false,
63
68
  hideAttribution: true,
64
69
  hideCompass: false,
@@ -93,6 +98,9 @@ export class MapboxViewCommonBase extends ContentView {
93
98
  setOnMoveBeginListener(listener, nativeMap) {
94
99
  return this.mapbox.setOnMoveBeginListener(listener, this.getNativeMapView());
95
100
  }
101
+ setOnMoveEndListener(listener, nativeMap) {
102
+ return this.mapbox.setOnMoveEndListener(listener, this.getNativeMapView());
103
+ }
96
104
  setOnFlingListener(listener, nativeMap) {
97
105
  return this.mapbox.setOnFlingListener(listener, this.getNativeMapView());
98
106
  }
@@ -247,6 +255,11 @@ export const showUserLocationProperty = new Property({
247
255
  valueConverter: booleanConverter
248
256
  });
249
257
  showUserLocationProperty.register(MapboxViewCommonBase);
258
+ export const locationComponentOptionsProperty = new Property({
259
+ name: 'locationComponentOptions',
260
+ defaultValue: MapboxCommon.defaults.locationComponentOptions
261
+ });
262
+ locationComponentOptionsProperty.register(MapboxViewCommonBase);
250
263
  export const hideLogoProperty = new Property({
251
264
  name: 'hideLogo',
252
265
  defaultValue: MapboxCommon.defaults.hideLogo,
@@ -326,6 +339,9 @@ export class MapboxViewBase extends MapboxViewCommonBase {
326
339
  [showUserLocationProperty.setNative](value) {
327
340
  this.config.showUserLocation = value;
328
341
  }
342
+ [locationComponentOptionsProperty.setNative](value) {
343
+ this.config.locationComponentOptions = value || {};
344
+ }
329
345
  [hideLogoProperty.setNative](value) {
330
346
  this.config.hideLogo = value;
331
347
  }
@@ -351,6 +367,7 @@ export class MapboxViewBase extends MapboxViewCommonBase {
351
367
  MapboxViewBase.mapReadyEvent = 'mapReady';
352
368
  MapboxViewBase.scrollEvent = 'scrollEvent';
353
369
  MapboxViewBase.moveBeginEvent = 'moveBeginEvent';
370
+ MapboxViewBase.moveEndEvent = 'moveEndEvent';
354
371
  MapboxViewBase.locationPermissionGrantedEvent = 'locationPermissionGranted';
355
372
  MapboxViewBase.locationPermissionDeniedEvent = 'locationPermissionDenied';
356
- //# sourceMappingURL=mapbox.common.js.map
373
+ //# sourceMappingURL=common.js.map
@@ -1,4 +1,4 @@
1
- export declare class FilterParser {
1
+ export declare class ExpressionParser {
2
2
  static parseJson(json: any[]): com.mapbox.mapboxsdk.style.expressions.Expression;
3
3
  static toJson(filter: com.mapbox.mapboxsdk.style.expressions.Expression): any[];
4
4
  }
@@ -1,4 +1,4 @@
1
- export class FilterParser {
1
+ export class ExpressionParser {
2
2
  static parseJson(json) {
3
3
  const expression = com.mapbox.mapboxsdk.style.expressions.Expression.Converter.convert(JSON.stringify(json));
4
4
  return expression;
@@ -13,4 +13,4 @@ export class FilterParser {
13
13
  return JSON.parse(filter.toString());
14
14
  }
15
15
  }
16
- //# sourceMappingURL=filter-parser.android.js.map
16
+ //# sourceMappingURL=expression-parser.android.js.map
@@ -0,0 +1,4 @@
1
+ export declare class ExpressionParser {
2
+ static parseJson(json: any[]): any;
3
+ static toJson(filter: any): any[];
4
+ }
@@ -1,4 +1,4 @@
1
- export declare class FilterParser {
1
+ export declare class ExpressionParser {
2
2
  static parseJson(json: any[]): NSPredicate;
3
3
  static toJson(filter: NSPredicate): any[];
4
4
  }
@@ -1,4 +1,4 @@
1
- export class FilterParser {
1
+ export class ExpressionParser {
2
2
  static parseJson(json) {
3
3
  const filterStr = NSString.stringWithString(JSON.stringify(json));
4
4
  const filterData = filterStr.dataUsingEncoding(NSUTF8StringEncoding);
@@ -19,4 +19,4 @@ export class FilterParser {
19
19
  return JSON.parse(expression);
20
20
  }
21
21
  }
22
- //# sourceMappingURL=filter-parser.ios.js.map
22
+ //# sourceMappingURL=expression-parser.ios.js.map
@@ -1,6 +1,6 @@
1
1
  import { ImageSource } from '@nativescript/core';
2
- import { AddExtrusionOptions, AddGeoJsonClusteredOptions, AddPolygonOptions, AddPolylineOptions, AddSourceOptions, AnimateCameraOptions, DeleteOfflineRegionOptions, DownloadOfflineRegionOptions, Feature, LatLng, LayerCommon, ListOfflineRegionsOptions, MapStyle, MapboxApi, MapboxCommon, MapboxMarker, MapboxTraceCategory, MapboxViewBase, OfflineRegion, QueryRenderedFeaturesOptions, QuerySourceFeaturesOptions, SetCenterOptions, SetTiltOptions, SetViewportOptions, SetZoomLevelOptions, ShowOptions, TrackUserOptions, UpdateSourceOptions, UserLocation, UserLocationCameraMode, Viewport } from './mapbox.common';
3
- export { MapboxTraceCategory, MapStyle };
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
+ export * from './common';
4
4
  export declare function setLogLevel(level: 'none' | 'info' | 'debug' | 'error' | 'fault' | 'verbose'): void;
5
5
  export declare class MapboxView extends MapboxViewBase {
6
6
  private nativeMapView;
@@ -96,6 +96,7 @@ export declare class Mapbox extends MapboxCommon implements MapboxApi {
96
96
  setOnMapClickListener(listener: (data: LatLng) => boolean, nativeMap?: MapboxView): Promise<void>;
97
97
  setOnMapLongClickListener(listener: (data: LatLng) => boolean, nativeMap?: any): Promise<void>;
98
98
  setOnMoveBeginListener(listener: (data?: LatLng) => void, nativeMap?: any): Promise<void>;
99
+ setOnMoveEndListener(listener: (data?: LatLng) => void, nativeMap?: any): Promise<void>;
99
100
  setOnScrollListener(listener: (data?: LatLng) => void, nativeMap?: any): Promise<void>;
100
101
  setOnFlingListener(listener: () => void, nativeMap?: any): Promise<void>;
101
102
  setOnCameraMoveListener(listener: (reason: any, animated?: any) => void, nativeMap?: any): Promise<void>;
@@ -103,7 +104,7 @@ export declare class Mapbox extends MapboxCommon implements MapboxApi {
103
104
  setOnCameraIdleListener(listener: () => void, nativeMap?: any): Promise<void>;
104
105
  getViewport(nativeMap?: any): Promise<Viewport>;
105
106
  setViewport(options: SetViewportOptions, nativeMap?: any): Promise<void>;
106
- downloadOfflineRegion(options: DownloadOfflineRegionOptions): Promise<void>;
107
+ downloadOfflineRegion(options: DownloadOfflineRegionOptions): Promise<any>;
107
108
  listOfflineRegions(options?: ListOfflineRegionsOptions): Promise<OfflineRegion[]>;
108
109
  deleteOfflineRegion(options: DeleteOfflineRegionOptions): Promise<void>;
109
110
  _getOfflineManager(): any;
@@ -123,6 +124,7 @@ export declare class Mapbox extends MapboxCommon implements MapboxApi {
123
124
  _stringToRenderMode(mode: any): any;
124
125
  _fineLocationPermissionGranted(): boolean;
125
126
  _getRegionName(offlineRegion: com.mapbox.mapboxsdk.offline.OfflineRegion): string;
127
+ _getRegionMetadata(offlineRegion: com.mapbox.mapboxsdk.offline.OfflineRegion): any;
126
128
  showUserLocationMarker(options: any, nativeMap?: any): Promise<void>;
127
129
  hideUserLocationMarker(nativeMap?: any): Promise<void>;
128
130
  changeUserLocationMarkerMode(renderModeString: any, cameraModeString: UserLocationCameraMode, nativeMap?: any): Promise<void>;
@@ -137,14 +139,3 @@ export declare class Mapbox extends MapboxCommon implements MapboxApi {
137
139
  y: number;
138
140
  };
139
141
  }
140
- export declare class Layer implements LayerCommon {
141
- id: string;
142
- private instance;
143
- constructor(instance: any);
144
- visibility(): boolean;
145
- show(): void;
146
- hide(): void;
147
- getNativeInstance(): any;
148
- setFilter(filter: any[]): void;
149
- getFilter(): any[];
150
- }