@rnmapbox/maps 10.1.0-beta.25 → 10.1.0-beta.26

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.
@@ -30,6 +30,7 @@ import java.nio.file.StandardCopyOption
30
30
  import java.util.concurrent.CountDownLatch
31
31
 
32
32
  import com.rnmapbox.rnmbx.v11compat.offlinemanager.*
33
+ import com.rnmapbox.rnmbx.v11compat.resourceoption.getMapboxAccessToken
33
34
 
34
35
  data class ZoomRange(val minZoom: Byte, val maxZoom: Byte) {
35
36
 
@@ -103,7 +104,9 @@ class RNMBXOfflineModule(private val mReactContext: ReactApplicationContext) :
103
104
 
104
105
 
105
106
  val tileStore: TileStore by lazy {
106
- TileStore.create()
107
+ val result = TileStore.create()
108
+ result.setAccessToken(RNMBXModule.getAccessToken(mReactContext));
109
+ result
107
110
  }
108
111
 
109
112
  val offlineManager: OfflineManager by lazy {
@@ -1,6 +1,8 @@
1
1
  package com.rnmapbox.rnmbx.v11compat.offlinemanager;
2
2
 
3
3
  import com.mapbox.common.TileStore
4
+ import com.mapbox.common.TileStoreOptions
5
+ import com.mapbox.common.toValue
4
6
  import com.mapbox.maps.OfflineManager
5
7
  import com.mapbox.maps.OfflineRegionManager
6
8
  import com.mapbox.maps.ResourceOptions
@@ -16,4 +18,8 @@ fun getOfflineManager(tileStore: TileStore, getAccessToken: () -> String): Offli
16
18
  tileStore
17
19
  ).build()
18
20
  )
21
+ }
22
+
23
+ fun TileStore.setAccessToken(token: String) {
24
+ this.setOption(TileStoreOptions.MAPBOX_ACCESS_TOKEN, token.toValue());
19
25
  }
@@ -1,5 +1,6 @@
1
1
  package com.rnmapbox.rnmbx.v11compat.offlinemanager;
2
2
 
3
+ import com.mapbox.common.MapboxOptions
3
4
  import com.mapbox.common.TileStore
4
5
  import com.mapbox.maps.OfflineManager
5
6
  import com.mapbox.maps.OfflineRegionManager
@@ -9,4 +10,7 @@ fun getOfflineRegionManager(getAccessToken: () -> String): OfflineRegionManager
9
10
  }
10
11
  fun getOfflineManager(tileStore: TileStore, getAccessToken: () -> String): OfflineManager {
11
12
  return OfflineManager()
13
+ }
14
+ fun TileStore.setAccessToken(token: String) {
15
+ MapboxOptions.accessToken = token
12
16
  }
@@ -46,23 +46,16 @@ class CustomHttpHeaders : HttpServiceInterceptorInterface {
46
46
  return request
47
47
  }
48
48
 
49
+ #if !RNMBX_11
49
50
  func onDownload(forDownload download: DownloadOptions) -> DownloadOptions {
50
51
  customHeaders.forEach {(key,value) in
51
52
  download.request.headers[key] = value
52
53
  }
53
54
  return download
54
55
  }
56
+ #endif
55
57
 
56
58
  func onResponse(for response: HttpResponse) -> HttpResponse {
57
59
  return response
58
60
  }
59
-
60
- #if RNMBX_11
61
- func onUpload(forUpload upload: UploadOptions) -> UploadOptions {
62
- customHeaders.forEach {(key,value) in
63
- upload.headers[key] = value
64
- }
65
- return upload
66
- }
67
- #endif
68
61
  }
@@ -18,7 +18,7 @@ declare type FollowPuckOptions = {
18
18
  * - number: sets the camera bearing to the constant value on every frame
19
19
  *
20
20
  * On Android, 'heading' and 'coruse' sets the camera bearing to the same as the location puck's bearing. See
21
- * [syncWithLocationPuck](https://docs.mapbox.com/android/maps/api/11.0.0-rc.1/mapbox-maps-android/com.mapbox.maps.plugin.viewport.data/-follow-puck-viewport-state-bearing/-sync-with-location-puck/)
21
+ * [syncWithLocationPuck](https://docs.mapbox.com/android/maps/api/11.0.0/mapbox-maps-android/com.mapbox.maps.plugin.viewport.data/-follow-puck-viewport-state-bearing/-sync-with-location-puck/)
22
22
  *
23
23
  * @default 'heading'
24
24
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rnmapbox/maps",
3
3
  "description": "A Mapbox react native module for creating custom maps",
4
- "version": "10.1.0-beta.25",
4
+ "version": "10.1.0-beta.26",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -53,7 +53,7 @@
53
53
  "build:examples.json": "cd example; jest __tests__/dumpExamplesJson.ts",
54
54
  "lint:plugin": "yarn eslint plugin/src/*",
55
55
  "build": "yarn bob build",
56
- "prepare": "yarn bob build && yarn husky install"
56
+ "prepare": "yarn bob build"
57
57
  },
58
58
  "peerDependencies": {
59
59
  "expo": ">=47.0.0",
@@ -41,7 +41,7 @@ type FollowPuckOptions = {
41
41
  * - number: sets the camera bearing to the constant value on every frame
42
42
  *
43
43
  * On Android, 'heading' and 'coruse' sets the camera bearing to the same as the location puck's bearing. See
44
- * [syncWithLocationPuck](https://docs.mapbox.com/android/maps/api/11.0.0-rc.1/mapbox-maps-android/com.mapbox.maps.plugin.viewport.data/-follow-puck-viewport-state-bearing/-sync-with-location-puck/)
44
+ * [syncWithLocationPuck](https://docs.mapbox.com/android/maps/api/11.0.0/mapbox-maps-android/com.mapbox.maps.plugin.viewport.data/-follow-puck-viewport-state-bearing/-sync-with-location-puck/)
45
45
  *
46
46
  * @default 'heading'
47
47
  */