@nativescript-community/ui-mapbox 6.2.21 → 6.2.22
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 +6 -0
- package/README.md +26 -0
- package/blueprint.md +25 -0
- package/common.d.ts +6 -6
- package/index.android.js +37 -15
- package/package.json +2 -2
- package/platforms/android/include.gradle +22 -18
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
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.22](https://github.com/nativescript-community/ui-mapbox/compare/v6.2.21...v6.2.22) (2023-11-29)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **android:** trying to handle all sdk versions ([bbfa0aa](https://github.com/nativescript-community/ui-mapbox/commit/bbfa0aa5c16750bbcd3c331be18b9a6bf35f4d49))
|
|
11
|
+
|
|
6
12
|
## [6.2.21](https://github.com/nativescript-community/ui-mapbox/compare/v6.2.20...v6.2.21) (2023-11-17)
|
|
7
13
|
|
|
8
14
|
### Bug Fixes
|
package/README.md
CHANGED
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
## Table of Contents
|
|
39
39
|
|
|
40
40
|
* [Prerequisites](#prerequisites)
|
|
41
|
+
* [Android](#android)
|
|
41
42
|
* [Installation](#installation)
|
|
42
43
|
* [Configuration](#configuration)
|
|
43
44
|
* [Issues](#issues)
|
|
@@ -110,6 +111,31 @@
|
|
|
110
111
|
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/).
|
|
111
112
|
Once you've registered go to your Account > Apps > New token. The 'Default Secret Token' is what you'll need.
|
|
112
113
|
|
|
114
|
+
### Android
|
|
115
|
+
|
|
116
|
+
Mapbox now requires (version > 8.6.6) an api key to download the sdk
|
|
117
|
+
|
|
118
|
+
If you want to use newer version than the default 8.6.6 you need to add this to your `app.gradle`
|
|
119
|
+
```gradle
|
|
120
|
+
allprojects {
|
|
121
|
+
repositories {
|
|
122
|
+
maven {
|
|
123
|
+
url 'https://api.mapbox.com/downloads/v2/releases/maven'
|
|
124
|
+
authentication {
|
|
125
|
+
basic(BasicAuthentication)
|
|
126
|
+
}
|
|
127
|
+
credentials {
|
|
128
|
+
// Do not change the username below.
|
|
129
|
+
// This should always be `mapbox` (not your username).
|
|
130
|
+
username = 'mapbox'
|
|
131
|
+
// Use the secret token you stored in gradle.properties as the password
|
|
132
|
+
password = project.properties['MAPBOX_DOWNLOADS_TOKEN'] ?: ""
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
113
139
|
|
|
114
140
|
[](#installation)
|
|
115
141
|
|
package/blueprint.md
CHANGED
|
@@ -10,6 +10,31 @@
|
|
|
10
10
|
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/).
|
|
11
11
|
Once you've registered go to your Account > Apps > New token. The 'Default Secret Token' is what you'll need.
|
|
12
12
|
|
|
13
|
+
### Android
|
|
14
|
+
|
|
15
|
+
Mapbox now requires (version > 8.6.6) an api key to download the sdk
|
|
16
|
+
|
|
17
|
+
If you want to use newer version than the default 8.6.6 you need to add this to your `app.gradle`
|
|
18
|
+
```gradle
|
|
19
|
+
allprojects {
|
|
20
|
+
repositories {
|
|
21
|
+
maven {
|
|
22
|
+
url 'https://api.mapbox.com/downloads/v2/releases/maven'
|
|
23
|
+
authentication {
|
|
24
|
+
basic(BasicAuthentication)
|
|
25
|
+
}
|
|
26
|
+
credentials {
|
|
27
|
+
// Do not change the username below.
|
|
28
|
+
// This should always be `mapbox` (not your username).
|
|
29
|
+
username = 'mapbox'
|
|
30
|
+
// Use the secret token you stored in gradle.properties as the password
|
|
31
|
+
password = project.properties['MAPBOX_DOWNLOADS_TOKEN'] ?: ""
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
13
38
|
## Installation
|
|
14
39
|
Run the following command from the root of your project:
|
|
15
40
|
|
package/common.d.ts
CHANGED
|
@@ -197,8 +197,8 @@ export interface AddGeoJsonClusteredOptions {
|
|
|
197
197
|
clusterRadius?: number;
|
|
198
198
|
clusters?: MapboxCluster[];
|
|
199
199
|
}
|
|
200
|
-
export
|
|
201
|
-
export
|
|
200
|
+
export type LayerType = "fill" | "line" | "symbol" | "circle" | "heatmap" | "fill-extrusion" | "raster" | "hillshade" | "background" | "sky";
|
|
201
|
+
export type SupportedLayerType = LayerType & ("line" | "circle" | "fill" | "symbol" | "raster");
|
|
202
202
|
export interface AddLayerOptions {
|
|
203
203
|
id: string;
|
|
204
204
|
source: string;
|
|
@@ -229,9 +229,9 @@ export interface AddLayerOptions {
|
|
|
229
229
|
lineOpacity?: number;
|
|
230
230
|
lineWidth?: number;
|
|
231
231
|
}
|
|
232
|
-
export
|
|
233
|
-
export
|
|
234
|
-
export
|
|
232
|
+
export type UserTrackingMode = 'NONE' | 'FOLLOW' | 'FOLLOW_WITH_HEADING' | 'FOLLOW_WITH_COURSE';
|
|
233
|
+
export type AddSourceOptions = VectorSource | GeoJSONSource | RasterSource;
|
|
234
|
+
export type UpdateSourceOptions = VectorSource | GeoJSONSource | RasterSource;
|
|
235
235
|
export interface Source {
|
|
236
236
|
type: 'vector' | 'raster' | 'geojson';
|
|
237
237
|
scheme?: 'xyz' | 'tms';
|
|
@@ -267,7 +267,7 @@ export interface GeoJSONSource extends Source {
|
|
|
267
267
|
};
|
|
268
268
|
};
|
|
269
269
|
}
|
|
270
|
-
export
|
|
270
|
+
export type UserLocationCameraMode = 'NONE' | 'NONE_COMPASS' | 'NONE_GPS' | 'TRACKING' | 'TRACKING_COMPASS' | 'TRACKING_GPS' | 'TRACKING_GPS_NORTH';
|
|
271
271
|
export interface TrackUserOptions {
|
|
272
272
|
cameraMode: UserLocationCameraMode;
|
|
273
273
|
renderMode?: string;
|
package/index.android.js
CHANGED
|
@@ -10,6 +10,29 @@ import { Layer, LayerFactory } from './layers/layer-factory';
|
|
|
10
10
|
import { CLog, CLogTypes, MapStyle, MapboxCommon, MapboxTraceCategory, MapboxViewBase, telemetryProperty } from './common';
|
|
11
11
|
// Export the enums for devs not using TS
|
|
12
12
|
export * from './common';
|
|
13
|
+
let libraryLoadedOverloaded = false;
|
|
14
|
+
function overrideLibraryLoader() {
|
|
15
|
+
try {
|
|
16
|
+
if (true && !libraryLoadedOverloaded) {
|
|
17
|
+
var LibraryLoader = /** @class */ (function (_super) {
|
|
18
|
+
__extends(LibraryLoader, _super);
|
|
19
|
+
function LibraryLoader() {
|
|
20
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
21
|
+
}
|
|
22
|
+
LibraryLoader.prototype.load = function (name) {
|
|
23
|
+
java.lang.System.loadLibrary(name);
|
|
24
|
+
};
|
|
25
|
+
return LibraryLoader;
|
|
26
|
+
}(com.mapbox.mapboxsdk.LibraryLoader));
|
|
27
|
+
com.mapbox.mapboxsdk.LibraryLoader.setLibraryLoader(new LibraryLoader());
|
|
28
|
+
libraryLoadedOverloaded = true;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
console.error(error);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
overrideLibraryLoader();
|
|
13
36
|
function _getLocation(loc) {
|
|
14
37
|
if (loc === null) {
|
|
15
38
|
return null;
|
|
@@ -218,7 +241,6 @@ export class MapboxView extends MapboxViewBase {
|
|
|
218
241
|
if (this.telemetry === false) {
|
|
219
242
|
try {
|
|
220
243
|
com.mapbox.mapboxsdk.Mapbox.getTelemetry().setUserTelemetryRequestState(false);
|
|
221
|
-
console.error('telemtry disabled!');
|
|
222
244
|
}
|
|
223
245
|
catch (err) {
|
|
224
246
|
console.error('telemtry', err);
|
|
@@ -1105,7 +1127,7 @@ export class Mapbox extends MapboxCommon {
|
|
|
1105
1127
|
markerOptions.setIcon(cached);
|
|
1106
1128
|
}
|
|
1107
1129
|
else {
|
|
1108
|
-
console.
|
|
1130
|
+
console.warn(`No icon found for this device density for icon ' ${marker.icon}'. Falling back to the default icon.`);
|
|
1109
1131
|
}
|
|
1110
1132
|
}
|
|
1111
1133
|
else if (marker.icon.startsWith('http')) {
|
|
@@ -1133,7 +1155,7 @@ export class Mapbox extends MapboxCommon {
|
|
|
1133
1155
|
markerOptions.setIcon(cached);
|
|
1134
1156
|
}
|
|
1135
1157
|
else {
|
|
1136
|
-
console.
|
|
1158
|
+
console.warn(`Marker icon not found, using the default instead. Requested path: '" + ${marker.iconPath}'.`);
|
|
1137
1159
|
}
|
|
1138
1160
|
}
|
|
1139
1161
|
marker.android = this._mapboxMapInstance.addMarker(markerOptions);
|
|
@@ -1917,7 +1939,7 @@ export class Mapbox extends MapboxCommon {
|
|
|
1917
1939
|
reject(`${error.getMessage()}, reason: ${error.getReason()}`);
|
|
1918
1940
|
},
|
|
1919
1941
|
mapboxTileCountLimitExceeded: (limit) => {
|
|
1920
|
-
console.
|
|
1942
|
+
console.warn(`dl mapboxTileCountLimitExceeded: ${limit}`);
|
|
1921
1943
|
}
|
|
1922
1944
|
}));
|
|
1923
1945
|
}
|
|
@@ -2567,21 +2589,21 @@ export class Mapbox extends MapboxCommon {
|
|
|
2567
2589
|
const modeRef = com.mapbox.mapboxsdk.location.modes.CameraMode;
|
|
2568
2590
|
switch (mode) {
|
|
2569
2591
|
case modeRef.NONE:
|
|
2570
|
-
return
|
|
2592
|
+
return 'NONE';
|
|
2571
2593
|
case modeRef.NONE_COMPASS:
|
|
2572
|
-
return
|
|
2594
|
+
return 'NONE_COMPASS';
|
|
2573
2595
|
case modeRef.NONE_GPS:
|
|
2574
|
-
return
|
|
2596
|
+
return 'NONE_GPS';
|
|
2575
2597
|
case modeRef.TRACKING:
|
|
2576
|
-
return
|
|
2598
|
+
return 'TRACKING';
|
|
2577
2599
|
case modeRef.TRACKING_COMPASS:
|
|
2578
|
-
return
|
|
2600
|
+
return 'TRACKING_COMPASS';
|
|
2579
2601
|
case modeRef.TRACKING_GPS:
|
|
2580
|
-
return
|
|
2602
|
+
return 'TRACKING_GPS';
|
|
2581
2603
|
case modeRef.TRACKING_GPS_NORTH:
|
|
2582
|
-
return
|
|
2604
|
+
return 'TRACKING_GPS_NORTH';
|
|
2583
2605
|
}
|
|
2584
|
-
return
|
|
2606
|
+
return 'NONE';
|
|
2585
2607
|
}
|
|
2586
2608
|
_fineLocationPermissionGranted() {
|
|
2587
2609
|
let hasPermission = android.os.Build.VERSION.SDK_INT < 23; // Android M. (6.0)
|
|
@@ -2918,7 +2940,7 @@ export class Mapbox extends MapboxCommon {
|
|
|
2918
2940
|
this._markerIconDownloadCache[marker.icon] = marker.iconDownloaded;
|
|
2919
2941
|
resolve(marker);
|
|
2920
2942
|
}, (e) => {
|
|
2921
|
-
console.
|
|
2943
|
+
console.error(`Download failed for ' ${marker.icon}' with error: ${e}`);
|
|
2922
2944
|
resolve(marker);
|
|
2923
2945
|
});
|
|
2924
2946
|
});
|
|
@@ -2955,10 +2977,10 @@ export class Mapbox extends MapboxCommon {
|
|
|
2955
2977
|
}
|
|
2956
2978
|
getUserLocationCameraMode(nativeMap) {
|
|
2957
2979
|
if (!this._mapboxMapInstance) {
|
|
2958
|
-
return
|
|
2980
|
+
return 'NONE';
|
|
2959
2981
|
}
|
|
2960
2982
|
if (!this._locationComponent) {
|
|
2961
|
-
return
|
|
2983
|
+
return 'NONE';
|
|
2962
2984
|
}
|
|
2963
2985
|
return this._convertCameraMode(this._locationComponent.getCameraMode());
|
|
2964
2986
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nativescript-community/ui-mapbox",
|
|
3
|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.22",
|
|
4
4
|
"description": "Interactive, thoroughly customizable maps powered by vector tiles and OpenGL.",
|
|
5
5
|
"main": "index",
|
|
6
6
|
"typings": "index.d.ts",
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@nativescript-community/perms": "^2.3.0"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "970a3622c251a6b45b63711c7239f7965e2bc049"
|
|
58
58
|
}
|
|
@@ -5,35 +5,39 @@ repositories {
|
|
|
5
5
|
// see https://www.mapbox.com/android-sdk/
|
|
6
6
|
dependencies {
|
|
7
7
|
def mapboxVersion = project.hasProperty("mapboxVersion") ? project.mapboxVersion : "8.6.6"
|
|
8
|
-
def mapboxServicesVersion = project.hasProperty("mapboxServicesVersion") ? project.mapboxServicesVersion : "5.6.0"
|
|
9
|
-
def mapboxTelemetryVersion = project.hasProperty("mapboxTelemetryVersion") ? project.mapboxTelemetryVersion : "6.1.0"
|
|
8
|
+
// def mapboxServicesVersion = project.hasProperty("mapboxServicesVersion") ? project.mapboxServicesVersion : "5.6.0"
|
|
9
|
+
// def mapboxTelemetryVersion = project.hasProperty("mapboxTelemetryVersion") ? project.mapboxTelemetryVersion : "6.1.0"
|
|
10
10
|
def mapboxPluginsVersion = project.hasProperty("mapboxPluginsVersion") ? project.mapboxPluginsVersion : "v9"
|
|
11
11
|
def mapboxAnnotationPluginVersion = project.hasProperty("mapboxAnnotationPluginVersion") ? project.mapboxAnnotationPluginVersion : "0.9.0"
|
|
12
|
-
def mapboxGesturesVersion = project.hasProperty("mapboxGesturesVersion") ? project.mapboxGesturesVersion : "0.7.0"
|
|
12
|
+
// def mapboxGesturesVersion = project.hasProperty("mapboxGesturesVersion") ? project.mapboxGesturesVersion : "0.7.0"
|
|
13
13
|
def okHttpVersion = project.hasProperty("okHttpVersion") ? project.okHttpVersion : "4.9.0"
|
|
14
14
|
implementation ("com.mapbox.mapboxsdk:mapbox-android-sdk:$mapboxVersion") {
|
|
15
|
-
transitive=false
|
|
15
|
+
// transitive=false
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
if (project.hasProperty("mapboxTelemetryVersion")) {
|
|
18
|
+
def mapboxTelemetryVersion = project.hasProperty("mapboxTelemetryVersion") ? project.mapboxTelemetryVersion : "6.1.0"
|
|
19
|
+
implementation ("com.mapbox.mapboxsdk:mapbox-android-telemetry:$mapboxTelemetryVersion")
|
|
20
20
|
}
|
|
21
|
+
// implementation ("com.mapbox.mapboxsdk:mapbox-android-telemetry:$mapboxTelemetryVersion") {
|
|
22
|
+
// transitive=false
|
|
23
|
+
// }
|
|
21
24
|
implementation ("com.mapbox.mapboxsdk:mapbox-sdk-geojson:$mapboxServicesVersion"){
|
|
22
|
-
transitive=false
|
|
23
|
-
}
|
|
24
|
-
implementation ("com.mapbox.mapboxsdk:mapbox-android-gestures:$mapboxGesturesVersion"){
|
|
25
|
-
transitive=false
|
|
26
|
-
}
|
|
27
|
-
implementation ("com.mapbox.mapboxsdk:mapbox-sdk-services:$mapboxServicesVersion"){
|
|
28
|
-
transitive=false
|
|
29
|
-
}
|
|
30
|
-
implementation ("com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-$mapboxPluginsVersion:$mapboxAnnotationPluginVersion"){
|
|
31
|
-
transitive=false
|
|
25
|
+
// transitive=false
|
|
32
26
|
}
|
|
27
|
+
// implementation ("com.mapbox.mapboxsdk:mapbox-android-gestures:$mapboxGesturesVersion"){
|
|
28
|
+
// transitive=false
|
|
29
|
+
// }
|
|
30
|
+
// implementation ("com.mapbox.mapboxsdk:mapbox-sdk-services:$mapboxServicesVersion"){
|
|
31
|
+
// transitive=false
|
|
32
|
+
// }
|
|
33
|
+
|
|
34
|
+
implementation ("com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-$mapboxPluginsVersion:$mapboxAnnotationPluginVersion")
|
|
35
|
+
// implementation ("com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-$mapboxPluginsVersion:$mapboxAnnotationPluginVersion"){
|
|
36
|
+
// }
|
|
33
37
|
|
|
34
38
|
implementation "com.squareup.okhttp3:okhttp:$okHttpVersion"
|
|
35
39
|
|
|
36
|
-
println
|
|
40
|
+
println "com.mapbox.mapboxsdk:mapbox-android-sdk:$mapboxVersion"
|
|
37
41
|
|
|
38
42
|
}
|
|
39
43
|
|