@rnmapbox/maps 10.0.0-beta.47 → 10.0.0-beta.49

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.
@@ -130,8 +130,8 @@ dependencies {
130
130
  implementation 'com.mapbox.mapboxsdk:mapbox-sdk-turf:5.1.0'
131
131
  }
132
132
  else if (safeExtGet("RNMapboxMapsImpl", defaultMapboxMapsImpl) == "mapbox") {
133
- implementation 'com.mapbox.maps:android:10.8.0'
134
- implementation 'com.mapbox.mapboxsdk:mapbox-sdk-turf:6.4.0'
133
+ implementation 'com.mapbox.maps:android:10.9.0'
134
+ implementation 'com.mapbox.mapboxsdk:mapbox-sdk-turf:6.8.0'
135
135
  }
136
136
  }
137
137
 
@@ -72,8 +72,8 @@ class RCTMGLCamera(private val mContext: Context, private val mManager: RCTMGLCa
72
72
  private var mFollowZoomLevel : Double? = null
73
73
  private var mFollowHeading : Double? = null
74
74
  private var mZoomLevel = -1.0
75
- private var mMinZoomLevel = -1.0
76
- private var mMaxZoomLevel = -1.0
75
+ private var mMinZoomLevel : Double? = null
76
+ private var mMaxZoomLevel : Double? = null
77
77
  private var mMaxBounds: LatLngBounds? = null
78
78
  private var mFollowUserLocation = false
79
79
  private var mFollowUserMode: String? = null
@@ -120,7 +120,6 @@ class RCTMGLCamera(private val mContext: Context, private val mManager: RCTMGLCa
120
120
  override fun addToMap(mapView: RCTMGLMapView) {
121
121
  super.addToMap(mapView)
122
122
  setInitialCamera()
123
- updateMaxMinZoomLevel()
124
123
  updateMaxBounds()
125
124
  mCameraStop?.let { updateCamera(it) }
126
125
  if (mFollowUserLocation) {
@@ -169,30 +168,17 @@ class RCTMGLCamera(private val mContext: Context, private val mManager: RCTMGLCa
169
168
  withMapView { mapView ->
170
169
  val map = mapView.getMapboxMap()
171
170
  val maxBounds = mMaxBounds
171
+ val builder = CameraBoundsOptions.Builder()
172
+
172
173
  if (maxBounds != null) {
173
- map.setBounds(CameraBoundsOptions.Builder().bounds(
174
- maxBounds.toBounds()
175
- ).build())
176
- } else {
177
- map.setBounds(CameraBoundsOptions.Builder().build())
174
+ builder.bounds(maxBounds.toBounds())
178
175
  }
179
-
176
+ mMinZoomLevel?.let { builder.minZoom(it) }
177
+ mMaxZoomLevel?.let { builder.maxZoom(it) }
178
+ map.setBounds(builder.build())
180
179
  }
181
180
  }
182
181
 
183
- private fun updateMaxMinZoomLevel() {
184
- /*
185
- MapboxMap map = getMapboxMap();
186
- if (map != null) {
187
- if (mMinZoomLevel >= 0.0) {
188
- map.setMinZoomPreference(mMinZoomLevel);
189
- }
190
- if (mMaxZoomLevel >= 0.0) {
191
- map.setMaxZoomPreference(mMaxZoomLevel);
192
- }
193
- }*/
194
- }
195
-
196
182
  private fun setInitialCamera() {
197
183
  val map = mMapView!!.getMapboxMap()
198
184
  if (mDefaultStop != null) {
@@ -332,14 +318,14 @@ class RCTMGLCamera(private val mContext: Context, private val mManager: RCTMGLCa
332
318
  }
333
319
  }
334
320
 
335
- fun setMinZoomLevel(zoomLevel: Double) {
321
+ fun setMinZoomLevel(zoomLevel: Double?) {
336
322
  mMinZoomLevel = zoomLevel
337
- updateMaxMinZoomLevel()
323
+ updateMaxBounds()
338
324
  }
339
325
 
340
- fun setMaxZoomLevel(zoomLevel: Double) {
326
+ fun setMaxZoomLevel(zoomLevel: Double?) {
341
327
  mMaxZoomLevel = zoomLevel
342
- updateMaxMinZoomLevel()
328
+ updateMaxBounds()
343
329
  }
344
330
 
345
331
  fun setZoomLevel(zoomLevel: Double) {
@@ -23,17 +23,15 @@ import com.mapbox.maps.extension.style.expressions.generated.Expression
23
23
  import com.mapbox.maps.extension.style.layers.Layer
24
24
  import com.mapbox.maps.extension.style.layers.generated.*
25
25
  import com.mapbox.maps.extension.style.layers.getLayer
26
+ import com.mapbox.maps.extension.style.layers.properties.generated.ProjectionName
26
27
  import com.mapbox.maps.extension.style.layers.properties.generated.Visibility
28
+ import com.mapbox.maps.extension.style.projection.generated.Projection
29
+ import com.mapbox.maps.extension.style.projection.generated.setProjection
27
30
  import com.mapbox.maps.plugin.annotation.Annotation
28
31
  import com.mapbox.maps.plugin.annotation.annotations
29
- import com.mapbox.maps.plugin.annotation.generated.OnPointAnnotationClickListener
30
- import com.mapbox.maps.plugin.annotation.generated.OnPointAnnotationDragListener
31
- import com.mapbox.maps.plugin.annotation.generated.PointAnnotation
32
- import com.mapbox.maps.plugin.annotation.generated.PointAnnotationManager
33
- import com.mapbox.maps.plugin.annotation.generated.createPointAnnotationManager
32
+ import com.mapbox.maps.plugin.annotation.generated.*
34
33
  import com.mapbox.maps.plugin.attribution.attribution
35
34
  import com.mapbox.maps.plugin.attribution.generated.AttributionSettings
36
- import com.mapbox.maps.plugin.scalebar.scalebar
37
35
  import com.mapbox.maps.plugin.compass.compass
38
36
  import com.mapbox.maps.plugin.compass.generated.CompassSettings
39
37
  import com.mapbox.maps.plugin.delegates.listeners.*
@@ -41,7 +39,7 @@ import com.mapbox.maps.plugin.gestures.*
41
39
  import com.mapbox.maps.plugin.logo.generated.LogoSettings
42
40
  import com.mapbox.maps.plugin.logo.logo
43
41
  import com.mapbox.maps.plugin.scalebar.generated.ScaleBarSettings
44
- import com.mapbox.maps.viewannotation.ViewAnnotationManager
42
+ import com.mapbox.maps.plugin.scalebar.scalebar
45
43
  import com.mapbox.rctmgl.R
46
44
  import com.mapbox.rctmgl.components.AbstractMapFeature
47
45
  import com.mapbox.rctmgl.components.annotation.RCTMGLMarkerView
@@ -60,6 +58,7 @@ import com.mapbox.rctmgl.events.IEvent
60
58
  import com.mapbox.rctmgl.events.MapChangeEvent
61
59
  import com.mapbox.rctmgl.events.MapClickEvent
62
60
  import com.mapbox.rctmgl.events.constants.EventTypes
61
+ import com.mapbox.rctmgl.utils.BitmapUtils
63
62
  import com.mapbox.rctmgl.utils.GeoJSONUtils
64
63
  import com.mapbox.rctmgl.utils.LatLng
65
64
  import com.mapbox.rctmgl.utils.Logger
@@ -68,6 +67,7 @@ import org.json.JSONException
68
67
  import org.json.JSONObject
69
68
  import java.util.*
70
69
 
70
+
71
71
  data class OrnamentSettings(
72
72
  var enabled : Boolean? = false,
73
73
  var margins: ReadableMap? =null,
@@ -92,6 +92,7 @@ open class RCTMGLMapView(private val mContext: Context, var mManager: RCTMGLMapV
92
92
  private val mImages: MutableList<RCTMGLImages>
93
93
  private var mPointAnnotationManager: PointAnnotationManager? = null
94
94
  private var mActiveMarkerID: Long = -1
95
+ private var mProjection: ProjectionName = ProjectionName.MERCATOR
95
96
  private var mStyleURL: String? = null
96
97
  val isDestroyed = false
97
98
  private var mCamera: RCTMGLCamera? = null
@@ -397,12 +398,24 @@ open class RCTMGLMapView(private val mContext: Context, var mManager: RCTMGLMapV
397
398
  return true
398
399
  }
399
400
 
401
+ fun setReactProjection(projection: ProjectionName) {
402
+ if (projection != null) {
403
+ mProjection = projection
404
+ }
405
+
406
+ if (mMap != null) {
407
+ mMap.getStyle()?.setProjection(Projection(projection))
408
+ }
409
+ }
410
+
400
411
  fun setReactStyleURL(styleURL: String) {
412
+ mStyleURL = styleURL
401
413
  if (mMap != null) {
402
414
  removeAllFeaturesFromMap()
403
415
  if (isJSONValid(mStyleURL)) {
404
416
  mMap.loadStyleJson(styleURL, object : Style.OnStyleLoaded {
405
417
  override fun onStyleLoaded(style: Style) {
418
+ style.setProjection(Projection(mProjection))
406
419
  addAllFeaturesToMap()
407
420
  }
408
421
  })
@@ -410,6 +423,7 @@ open class RCTMGLMapView(private val mContext: Context, var mManager: RCTMGLMapV
410
423
  mMap.loadStyleUri(styleURL, object : Style.OnStyleLoaded {
411
424
  override fun onStyleLoaded(style: Style) {
412
425
  savedStyle = style
426
+ style.setProjection(Projection(mProjection))
413
427
  addAllFeaturesToMap()
414
428
  }
415
429
  },
@@ -733,7 +747,8 @@ open class RCTMGLMapView(private val mContext: Context, var mManager: RCTMGLMapV
733
747
  }
734
748
 
735
749
  fun queryRenderedFeaturesInRect(callbackID: String?, rect: RectF, filter: Expression?, layerIDs: List<String>?) {
736
- val screenBox = ScreenBox(
750
+ val size = mMap!!.getMapOptions().size
751
+ val screenBox = if (rect.isEmpty()) ScreenBox(ScreenCoordinate(0.0, 0.0), ScreenCoordinate(size?.width!!.toDouble(), size?.height!!.toDouble())) else ScreenBox(
737
752
  ScreenCoordinate(rect.right.toDouble(), rect.bottom.toDouble() ),
738
753
  ScreenCoordinate(rect.left.toDouble(), rect.top.toDouble()),
739
754
  )
@@ -773,6 +788,28 @@ open class RCTMGLMapView(private val mContext: Context, var mManager: RCTMGLMapV
773
788
  })
774
789
  }
775
790
 
791
+ fun takeSnap(callbackID: String?, writeToDisk: Boolean) {
792
+ this.snapshot { snapshot ->
793
+ if (snapshot == null) {
794
+ Logger.e("takeSnap", "snapshot failed")
795
+
796
+ sendResponse(callbackID, {
797
+ it.putNull("data")
798
+ it.putString("error", "no snapshot")
799
+ })
800
+ } else {
801
+ val uri: String = if (writeToDisk) BitmapUtils.createTempFile(
802
+ mContext,
803
+ snapshot
804
+ ) else BitmapUtils.createBase64(snapshot)
805
+
806
+ sendResponse(callbackID, {
807
+ it.putString("uri", uri)
808
+ })
809
+ }
810
+ }
811
+ }
812
+
776
813
  fun queryTerrainElevation(callbackID: String?, longitude: Double, latitude: Double) {
777
814
  val result = mMap?.getElevation(Point.fromLngLat(longitude, latitude))
778
815
 
@@ -870,8 +907,8 @@ open class RCTMGLMapView(private val mContext: Context, var mManager: RCTMGLMapV
870
907
  private fun toGravity(kind: String, viewPosition: Int): Int {
871
908
  return when (viewPosition) {
872
909
  0 -> (Gravity.TOP or Gravity.LEFT)
873
- 1 -> (Gravity.BOTTOM or Gravity.LEFT)
874
- 2 -> (Gravity.TOP or Gravity.RIGHT)
910
+ 1 -> (Gravity.TOP or Gravity.RIGHT)
911
+ 2 -> (Gravity.BOTTOM or Gravity.LEFT)
875
912
  3 -> (Gravity.BOTTOM or Gravity.RIGHT)
876
913
  else -> {
877
914
  Logger.e(
@@ -959,7 +996,7 @@ open class RCTMGLMapView(private val mContext: Context, var mManager: RCTMGLMapV
959
996
  mScaleBarSettings.enabled = scaleBarEnabled
960
997
  updateScaleBar()
961
998
  }
962
-
999
+
963
1000
  fun setReactScaleBarViewMargins(scaleBarMargins: ReadableMap) {
964
1001
  mScaleBarSettings.margins = scaleBarMargins
965
1002
  updateScaleBar()
@@ -11,6 +11,7 @@ import com.facebook.react.uimanager.annotations.ReactProp
11
11
  import com.mapbox.rctmgl.events.constants.EventKeys
12
12
  import com.mapbox.maps.MapboxMap
13
13
  import com.facebook.react.common.MapBuilder
14
+ import com.mapbox.maps.extension.style.layers.properties.generated.ProjectionName
14
15
  import com.mapbox.maps.plugin.compass.compass
15
16
  import com.mapbox.maps.plugin.gestures.gestures
16
17
  import com.mapbox.maps.plugin.logo.logo
@@ -78,7 +79,12 @@ open class RCTMGLMapViewManager(context: ReactApplicationContext?) :
78
79
  return mViews[reactTag]
79
80
  }
80
81
 
81
- //region React Props
82
+ // region React Props
83
+ @ReactProp(name = "projection")
84
+ fun setProjection(mapView: RCTMGLMapView, projection: String?) {
85
+ mapView.setReactProjection( if (projection == "globe") ProjectionName.GLOBE else ProjectionName.MERCATOR )
86
+ }
87
+
82
88
  @ReactProp(name = "styleURL")
83
89
  fun setStyleURL(mapView: RCTMGLMapView, styleURL: String?) {
84
90
  mapView.setReactStyleURL(styleURL!!)
@@ -273,6 +279,9 @@ open class RCTMGLMapViewManager(context: ReactApplicationContext?) :
273
279
  METHOD_VISIBLE_BOUNDS -> {
274
280
  mapView.getVisibleBounds(args!!.getString(0));
275
281
  }
282
+ METHOD_TAKE_SNAP -> {
283
+ mapView.takeSnap(args!!.getString(0), args!!.getBoolean(1))
284
+ }
276
285
  }
277
286
  /*
278
287
  switch (commandID) {
@@ -594,18 +594,6 @@ public class RCTMGLStyleFactory {
594
594
  case "fillExtrusionVerticalGradient":
595
595
  RCTMGLStyleFactory.setFillExtrusionVerticalGradient(layer, styleValue);
596
596
  break;
597
- case "fillExtrusionAmbientOcclusionIntensity":
598
- RCTMGLStyleFactory.setFillExtrusionAmbientOcclusionIntensity(layer, styleValue);
599
- break;
600
- case "fillExtrusionAmbientOcclusionIntensityTransition":
601
- RCTMGLStyleFactory.setFillExtrusionAmbientOcclusionIntensityTransition(layer, styleValue);
602
- break;
603
- case "fillExtrusionAmbientOcclusionRadius":
604
- RCTMGLStyleFactory.setFillExtrusionAmbientOcclusionRadius(layer, styleValue);
605
- break;
606
- case "fillExtrusionAmbientOcclusionRadiusTransition":
607
- RCTMGLStyleFactory.setFillExtrusionAmbientOcclusionRadiusTransition(layer, styleValue);
608
- break;
609
597
  }
610
598
  }
611
599
  }
@@ -2129,38 +2117,6 @@ public class RCTMGLStyleFactory {
2129
2117
  }
2130
2118
  }
2131
2119
 
2132
- public static void setFillExtrusionAmbientOcclusionIntensity(FillExtrusionLayer layer, RCTMGLStyleValue styleValue) {
2133
- if (styleValue.isExpression()) {
2134
- layer.fillExtrusionAmbientOcclusionIntensity(styleValue.getExpression());
2135
- } else {
2136
- layer.fillExtrusionAmbientOcclusionIntensity(styleValue.getFloat(VALUE_KEY));
2137
- }
2138
- }
2139
-
2140
-
2141
- public static void setFillExtrusionAmbientOcclusionIntensityTransition(FillExtrusionLayer layer, RCTMGLStyleValue styleValue) {
2142
- StyleTransition transition = styleValue.getTransition();
2143
- if (transition != null) {
2144
- layer.fillExtrusionAmbientOcclusionIntensityTransition(transition);
2145
- }
2146
- }
2147
-
2148
- public static void setFillExtrusionAmbientOcclusionRadius(FillExtrusionLayer layer, RCTMGLStyleValue styleValue) {
2149
- if (styleValue.isExpression()) {
2150
- layer.fillExtrusionAmbientOcclusionRadius(styleValue.getExpression());
2151
- } else {
2152
- layer.fillExtrusionAmbientOcclusionRadius(styleValue.getFloat(VALUE_KEY));
2153
- }
2154
- }
2155
-
2156
-
2157
- public static void setFillExtrusionAmbientOcclusionRadiusTransition(FillExtrusionLayer layer, RCTMGLStyleValue styleValue) {
2158
- StyleTransition transition = styleValue.getTransition();
2159
- if (transition != null) {
2160
- layer.fillExtrusionAmbientOcclusionRadiusTransition(transition);
2161
- }
2162
- }
2163
-
2164
2120
  public static void setVisibility(RasterLayer layer, RCTMGLStyleValue styleValue) {
2165
2121
  layer.visibility(Visibility.valueOf(styleValue.getEnumName()));
2166
2122
  }
@@ -217,7 +217,7 @@ public class ConvertUtils {
217
217
  public static RectF toRectF(ReadableArray array) {
218
218
  RectF rectF = new RectF();
219
219
 
220
- if (array == null) {
220
+ if (array == null || array.size() == 0) {
221
221
  return rectF;
222
222
  }
223
223
 
@@ -28,8 +28,6 @@ FillExtrusionLayer is a style layer that renders one or more 3D extruded polygon
28
28
  * <a href="#fillextrusionheight">fillExtrusionHeight</a><br/>
29
29
  * <a href="#fillextrusionbase">fillExtrusionBase</a><br/>
30
30
  * <a href="#fillextrusionverticalgradient">fillExtrusionVerticalGradient</a><br/>
31
- * <a href="#fillextrusionambientocclusionintensity">fillExtrusionAmbientOcclusionIntensity</a><br/>
32
- * <a href="#fillextrusionambientocclusionradius">fillExtrusionAmbientOcclusionRadius</a><br/>
33
31
 
34
32
  ___
35
33
 
@@ -346,88 +344,3 @@ Whether to apply a vertical gradient to the sides of a fillExtrusion layer. If t
346
344
 
347
345
  Parameters: `zoom`
348
346
 
349
- ___
350
-
351
- ### fillExtrusionAmbientOcclusionIntensity
352
- Name: `fillExtrusionAmbientOcclusionIntensity`
353
-
354
- ### Description
355
- Controls the intensity of ambient occlusion (AO) shading. Current AO implementation is a lowCost bestEffort approach that shades area near ground and concave angles between walls. Default value 0.0 disables ambient occlusion and values around 0.3 provide the most plausible results for buildings.
356
-
357
- ### Type
358
- `number`
359
- ### Default Value
360
- `0`
361
-
362
- ### Minimum
363
- `0`
364
-
365
-
366
- ### Maximum
367
- `1`
368
-
369
- ### Expression
370
-
371
- Parameters: `zoom`
372
- ___
373
-
374
- ### Name
375
-
376
- `fillExtrusionAmbientOcclusionIntensityTransition`
377
-
378
- ### Description
379
-
380
- The transition affecting any changes to this layer’s fillExtrusionAmbientOcclusionIntensity property.
381
-
382
- ### Type
383
-
384
- `{ duration, delay }`
385
-
386
- ### Units
387
- `milliseconds`
388
-
389
- ### Default Value
390
- `{duration: 300, delay: 0}`
391
-
392
-
393
- ___
394
-
395
- ### fillExtrusionAmbientOcclusionRadius
396
- Name: `fillExtrusionAmbientOcclusionRadius`
397
-
398
- ### Description
399
- The radius of ambient occlusion (AO) shading, in meters. Current AO implementation is a lowCost bestEffort approach that shades area near ground and concave angles between walls where the radius defines only vertical impact. Default value 3.0 corresponds to hight of one floor and brings the most plausible results for buildings.
400
-
401
- ### Type
402
- `number`
403
- ### Default Value
404
- `3`
405
-
406
- ### Minimum
407
- `0`
408
-
409
-
410
- ### Expression
411
-
412
- Parameters: `zoom`
413
- ___
414
-
415
- ### Name
416
-
417
- `fillExtrusionAmbientOcclusionRadiusTransition`
418
-
419
- ### Description
420
-
421
- The transition affecting any changes to this layer’s fillExtrusionAmbientOcclusionRadius property.
422
-
423
- ### Type
424
-
425
- `{ duration, delay }`
426
-
427
- ### Units
428
- `milliseconds`
429
-
430
- ### Default Value
431
- `{duration: 300, delay: 0}`
432
-
433
-
package/docs/MapView.md CHANGED
@@ -6,6 +6,7 @@ MapView backed by Mapbox Native GL
6
6
  | Prop | Type | Default | Required | Description |
7
7
  | ---- | :-- | :----- | :------ | :---------- |
8
8
  | contentInset | `union` | `none` | `false` | The distance from the edges of the map view’s frame to the edges of the map view’s logical viewport. |
9
+ | projection | `enum` | `'mercator'` | `false` | The projection used when rendering the map |
9
10
  | style | `any` | `none` | `false` | Style for wrapping React Native View |
10
11
  | styleURL | `string` | `none` | `false` | Style URL for map - notice, if non is set it _will_ default to `MapboxGL.StyleURL.Street` |
11
12
  | styleJSON | `string` | `none` | `false` | StyleJSON for map - according to TileJSON specs: https://github.com/mapbox/tilejson-spec |
@@ -118,12 +119,12 @@ this._map.queryRenderedFeaturesAtPoint([30, 40], ['==', 'type', 'Point'], ['id1'
118
119
 
119
120
  ### queryRenderedFeaturesInRect(bbox[, filter][, layerIDs])
120
121
 
121
- Returns an array of rendered map features that intersect with the given rectangle,<br/>restricted to the given style layers and filtered by the given predicate.
122
+ Returns an array of rendered map features that intersect with the given rectangle,<br/>restricted to the given style layers and filtered by the given predicate. In v10,<br/>passing an empty array will query the entire visible bounds of the map.
122
123
 
123
124
  #### arguments
124
125
  | Name | Type | Required | Description |
125
126
  | ---- | :--: | :------: | :----------: |
126
- | `bbox` | `Array` | `Yes` | A rectangle expressed in the map view’s coordinate system. |
127
+ | `bbox` | `Array` | `Yes` | A rectangle expressed in the map view’s coordinate system. For v10, this can be an empty array to query the visible map area. |
127
128
  | `filter` | `Array` | `No` | A set of strings that correspond to the names of layers defined in the current style. Only the features contained in these layers are included in the returned array. |
128
129
  | `layerIDs` | `Array` | `No` | A array of layer id's to filter the features by |
129
130
 
package/docs/docs.json CHANGED
@@ -1425,43 +1425,6 @@
1425
1425
  ]
1426
1426
  },
1427
1427
  "transition": false
1428
- },
1429
- {
1430
- "name": "fillExtrusionAmbientOcclusionIntensity",
1431
- "type": "number",
1432
- "values": [],
1433
- "minimum": 0,
1434
- "maximum": 1,
1435
- "default": 0,
1436
- "description": "Controls the intensity of ambient occlusion (AO) shading. Current AO implementation is a lowCost bestEffort approach that shades area near ground and concave angles between walls. Default value 0.0 disables ambient occlusion and values around 0.3 provide the most plausible results for buildings.",
1437
- "requires": [],
1438
- "disabledBy": [],
1439
- "allowedFunctionTypes": [],
1440
- "expression": {
1441
- "interpolated": true,
1442
- "parameters": [
1443
- "zoom"
1444
- ]
1445
- },
1446
- "transition": true
1447
- },
1448
- {
1449
- "name": "fillExtrusionAmbientOcclusionRadius",
1450
- "type": "number",
1451
- "values": [],
1452
- "minimum": 0,
1453
- "default": 3,
1454
- "description": "The radius of ambient occlusion (AO) shading, in meters. Current AO implementation is a lowCost bestEffort approach that shades area near ground and concave angles between walls where the radius defines only vertical impact. Default value 3.0 corresponds to hight of one floor and brings the most plausible results for buildings.",
1455
- "requires": [],
1456
- "disabledBy": [],
1457
- "allowedFunctionTypes": [],
1458
- "expression": {
1459
- "interpolated": true,
1460
- "parameters": [
1461
- "zoom"
1462
- ]
1463
- },
1464
- "transition": true
1465
1428
  }
1466
1429
  ]
1467
1430
  },
@@ -2733,14 +2696,14 @@
2733
2696
  },
2734
2697
  {
2735
2698
  "name": "queryRenderedFeaturesInRect",
2736
- "docblock": "Returns an array of rendered map features that intersect with the given rectangle,\nrestricted to the given style layers and filtered by the given predicate.\n\n@example\nthis._map.queryRenderedFeaturesInRect([30, 40, 20, 10], ['==', 'type', 'Point'], ['id1', 'id2'])\n\n@param {Array<Number>} bbox - A rectangle expressed in the map view’s coordinate system.\n@param {Array=} filter - A set of strings that correspond to the names of layers defined in the current style. Only the features contained in these layers are included in the returned array.\n@param {Array=} layerIDs - A array of layer id's to filter the features by\n@return {FeatureCollection}",
2699
+ "docblock": "Returns an array of rendered map features that intersect with the given rectangle,\nrestricted to the given style layers and filtered by the given predicate. In v10,\npassing an empty array will query the entire visible bounds of the map.\n\n@example\nthis._map.queryRenderedFeaturesInRect([30, 40, 20, 10], ['==', 'type', 'Point'], ['id1', 'id2'])\n\n@param {Array<Number>} bbox - A rectangle expressed in the map view’s coordinate system. For v10, this can be an empty array to query the visible map area.\n@param {Array=} filter - A set of strings that correspond to the names of layers defined in the current style. Only the features contained in these layers are included in the returned array.\n@param {Array=} layerIDs - A array of layer id's to filter the features by\n@return {FeatureCollection}",
2737
2700
  "modifiers": [
2738
2701
  "async"
2739
2702
  ],
2740
2703
  "params": [
2741
2704
  {
2742
2705
  "name": "bbox",
2743
- "description": "A rectangle expressed in the map view’s coordinate system.",
2706
+ "description": "A rectangle expressed in the map view’s coordinate system. For v10, this can be an empty array to query the visible map area.",
2744
2707
  "type": {
2745
2708
  "name": "Array"
2746
2709
  },
@@ -2769,7 +2732,7 @@
2769
2732
  "name": "FeatureCollection"
2770
2733
  }
2771
2734
  },
2772
- "description": "Returns an array of rendered map features that intersect with the given rectangle,\nrestricted to the given style layers and filtered by the given predicate.",
2735
+ "description": "Returns an array of rendered map features that intersect with the given rectangle,\nrestricted to the given style layers and filtered by the given predicate. In v10,\npassing an empty array will query the entire visible bounds of the map.",
2773
2736
  "examples": [
2774
2737
  "\nthis._map.queryRenderedFeaturesInRect([30, 40, 20, 10], ['==', 'type', 'Point'], ['id1', 'id2'])\n\n"
2775
2738
  ]
@@ -2928,6 +2891,13 @@
2928
2891
  "default": "none",
2929
2892
  "description": "The distance from the edges of the map view’s frame to the edges of the map view’s logical viewport."
2930
2893
  },
2894
+ {
2895
+ "name": "projection",
2896
+ "required": false,
2897
+ "type": "enum",
2898
+ "default": "'mercator'",
2899
+ "description": "The projection used when rendering the map"
2900
+ },
2931
2901
  {
2932
2902
  "name": "style",
2933
2903
  "required": false,
package/index.d.ts CHANGED
@@ -526,6 +526,7 @@ export interface MapViewProps extends ViewProps {
526
526
  userTrackingMode?: MapboxGL.UserTrackingModes;
527
527
  userLocationVerticalAlignment?: number;
528
528
  contentInset?: Array<number>;
529
+ projection?: 'mercator' | 'globe';
529
530
  style?: StyleProp<ViewStyle>;
530
531
  styleURL?: string;
531
532
  styleJSON?: string;
@@ -138,8 +138,12 @@ class RCTMGLCamera : RCTMGLMapComponentBase, LocationConsumer {
138
138
  _updateCameraFromTrackingMode()
139
139
  }
140
140
  }
141
- @objc var maxZoomLevel: NSNumber?
142
- @objc var minZoomLevel: NSNumber?
141
+ @objc var maxZoomLevel: NSNumber? {
142
+ didSet { _updateMaxBounds() }
143
+ }
144
+ @objc var minZoomLevel: NSNumber? {
145
+ didSet { _updateMaxBounds() }
146
+ }
143
147
  @objc var onUserTrackingModeChange: RCTBubblingEventBlock? = nil
144
148
  @objc var stop: [String: Any]? {
145
149
  didSet {
@@ -151,12 +155,15 @@ class RCTMGLCamera : RCTMGLMapComponentBase, LocationConsumer {
151
155
  didSet {
152
156
  if let maxBounds = maxBounds {
153
157
  logged("RCTMGLCamera.maxBounds") {
154
- let maxBoundsFeature = try JSONDecoder().decode(FeatureCollection.self, from: maxBounds.data(using: .utf8)!)
155
- try _updateMaxBounds(maxBoundsFeature)
158
+ maxBoundsFeature = try JSONDecoder().decode(FeatureCollection.self, from: maxBounds.data(using: .utf8)!)
156
159
  }
160
+ } else {
161
+ maxBoundsFeature = nil
157
162
  }
163
+ _updateMaxBounds()
158
164
  }
159
165
  }
166
+ var maxBoundsFeature : FeatureCollection? = nil
160
167
 
161
168
  // MARK: Update methods
162
169
 
@@ -213,10 +220,24 @@ class RCTMGLCamera : RCTMGLMapComponentBase, LocationConsumer {
213
220
  return CoordinateBounds(southwest: sw.coordinates, northeast: ne.coordinates)
214
221
  }
215
222
 
216
- func _updateMaxBounds(_ bounds: FeatureCollection) throws {
223
+ func _updateMaxBounds() {
217
224
  withMapView { map in
225
+ var options = CameraBoundsOptions()
226
+
227
+ if let maxBounds = self.maxBoundsFeature {
228
+ logged("RCTMGLCamera._updateMaxBounds._toCoordinateBounds") {
229
+ options.bounds = try self._toCoordinateBounds(maxBounds)
230
+ }
231
+ }
232
+ if let minZoomLevel = self.minZoomLevel {
233
+ options.minZoom = minZoomLevel.CGFloat
234
+ }
235
+ if let maxZoomLevel = self.maxZoomLevel {
236
+ options.maxZoom = maxZoomLevel.CGFloat
237
+ }
238
+
218
239
  logged("RCTMGLCamera._updateMaxBounds") {
219
- try map.mapboxMap.setCameraBounds(with: CameraBoundsOptions(bounds: try self._toCoordinateBounds(bounds)))
240
+ try map.mapboxMap.setCameraBounds(with: options)
220
241
  }
221
242
  }
222
243
  }
@@ -135,6 +135,14 @@ open class RCTMGLMapView : MapView {
135
135
 
136
136
 
137
137
  // MARK: - React Native properties
138
+
139
+ @objc func setReactProjection(_ value: String?) {
140
+ if let value = value {
141
+ var projection = StyleProjection(name: value == "globe" ? .globe : .mercator)
142
+ try! self.mapboxMap.style.setProjection(projection)
143
+ }
144
+ }
145
+
138
146
 
139
147
  @objc func setReactAttributionEnabled(_ value: Bool) {
140
148
  mapView.ornaments.options.attributionButton.visibility = value ? .visible : .hidden
@@ -188,15 +196,15 @@ open class RCTMGLMapView : MapView {
188
196
  let glPosition = MapboxGLPosition(rawValue: position)
189
197
  switch glPosition {
190
198
  case .topLeft:
191
- return .topLeft
199
+ return .topLeading
192
200
  case .bottomRight:
193
- return .bottomRight
201
+ return .bottomTrailing
194
202
  case .topRight:
195
- return .topRight
203
+ return .topTrailing
196
204
  case .bottomLeft:
197
- return .bottomLeft
205
+ return .bottomLeading
198
206
  case .none:
199
- return .topLeft
207
+ return .topLeading
200
208
  }
201
209
  }
202
210
 
@@ -231,7 +239,7 @@ open class RCTMGLMapView : MapView {
231
239
  }
232
240
 
233
241
  @objc func setReactRotateEnabled(_ value: Bool) {
234
- self.mapView.gestures.options.pinchRotateEnabled = value
242
+ self.mapView.gestures.options.rotateEnabled = value
235
243
  }
236
244
 
237
245
  @objc func setReactPitchEnabled(_ value: Bool) {
@@ -251,20 +259,20 @@ open class RCTMGLMapView : MapView {
251
259
  }
252
260
  }
253
261
 
254
- private func getOrnamentOptionsFromPosition(_ position: [String: Int]!) -> (position: OrnamentPosition, margins: CGPoint)? {
262
+ private func getOrnamentOptionsFromPosition(_ position: [String: Int]) -> (position: OrnamentPosition, margins: CGPoint)? {
255
263
  let left = position["left"]
256
264
  let right = position["right"]
257
265
  let top = position["top"]
258
266
  let bottom = position["bottom"]
259
267
 
260
268
  if let left = left, let top = top {
261
- return (OrnamentPosition.topLeft, CGPoint(x: left, y: top))
269
+ return (OrnamentPosition.topLeading, CGPoint(x: left, y: top))
262
270
  } else if let right = right, let top = top {
263
- return (OrnamentPosition.topRight, CGPoint(x: right, y: top))
271
+ return (OrnamentPosition.topTrailing, CGPoint(x: right, y: top))
264
272
  } else if let bottom = bottom, let right = right {
265
- return (OrnamentPosition.bottomRight, CGPoint(x: right, y: bottom))
273
+ return (OrnamentPosition.bottomTrailing, CGPoint(x: right, y: bottom))
266
274
  } else if let bottom = bottom, let left = left {
267
- return (OrnamentPosition.bottomLeft, CGPoint(x: left, y: bottom))
275
+ return (OrnamentPosition.bottomLeading, CGPoint(x: left, y: bottom))
268
276
  }
269
277
 
270
278
  return nil
@@ -520,7 +528,7 @@ extension RCTMGLMapView: GestureManagerDelegate {
520
528
  let options = RenderedQueryOptions(
521
529
  layerIds: source.getLayerIDs(), filter: nil
522
530
  )
523
- self.mapboxMap.queryRenderedFeatures(in: hitboxRect, options: options) {
531
+ self.mapboxMap.queryRenderedFeatures(with: hitboxRect, options: options) {
524
532
  result in
525
533
 
526
534
  var newHits = hits
@@ -772,12 +780,6 @@ class PointAnnotationManager : AnnotationInteractionDelegate {
772
780
  }
773
781
  }
774
782
  }
775
- /*
776
-
777
- let rctmglPointAnnotation = userInfo[RCTMGLPointAnnotation.key] as? WeakRef<RCTMGLPointAnnotation>,
778
- let rctmglPointAnnotation = rctmglPointAnnotation.object {
779
- rctmglPointAnnotation.didTap()
780
- }*/
781
783
  }
782
784
  }
783
785
 
@@ -874,12 +876,6 @@ class PointAnnotationManager : AnnotationInteractionDelegate {
874
876
  }
875
877
  }
876
878
  }
877
- /*
878
-
879
- let rctmglPointAnnotation = userInfo[RCTMGLPointAnnotation.key] as? WeakRef<RCTMGLPointAnnotation>,
880
- let rctmglPointAnnotation = rctmglPointAnnotation.object {
881
- rctmglPointAnnotation.didTap()
882
- }*/
883
879
  }
884
880
  }
885
881
 
@@ -896,8 +892,8 @@ class PointAnnotationManager : AnnotationInteractionDelegate {
896
892
  }
897
893
  switch sender.state {
898
894
  case .began:
899
- mapFeatureQueryable.queryRenderedFeatures(
900
- at: sender.location(in: sender.view),
895
+ mapFeatureQueryable.queryRenderedFeatures(
896
+ with: sender.location(in: sender.view),
901
897
  options: options) { [weak self] (result) in
902
898
 
903
899
  guard let self = self else { return }
@@ -21,6 +21,7 @@ RCT_REMAP_VIEW_PROPERTY(scrollEnabled, reactScrollEnabled, BOOL)
21
21
  RCT_REMAP_VIEW_PROPERTY(rotateEnabled, reactRotateEnabled, BOOL)
22
22
  RCT_REMAP_VIEW_PROPERTY(pitchEnabled, reactPitchEnabled, BOOL)
23
23
 
24
+ RCT_REMAP_VIEW_PROPERTY(projection, reactProjection, NSString)
24
25
 
25
26
  RCT_REMAP_VIEW_PROPERTY(styleURL, reactStyleURL, NSString)
26
27
  RCT_REMAP_VIEW_PROPERTY(onPress, reactOnPress, RCTBubblingEventBlock)
@@ -190,7 +190,7 @@ extension RCTMGLMapViewManager {
190
190
  logged("queryRenderedFeaturesAtPoint.option", rejecter: rejecter) {
191
191
  let options = try RenderedQueryOptions(layerIds: layerIDs, filter: filter?.asExpression())
192
192
 
193
- mapboxMap.queryRenderedFeatures(at: point, options: options) { result in
193
+ mapboxMap.queryRenderedFeatures(with: point, options: options) { result in
194
194
  switch result {
195
195
  case .success(let features):
196
196
  resolver([
@@ -214,17 +214,15 @@ extension RCTMGLMapViewManager {
214
214
  withLayerIDs layerIDs: [String]?,
215
215
  resolver: @escaping RCTPromiseResolveBlock,
216
216
  rejecter: @escaping RCTPromiseRejectBlock) -> Void {
217
- withMapboxMap(reactTag, name:"queryRenderedFeaturesInRect", rejecter: rejecter) { mapboxMap in
218
- let left = CGFloat(bbox[0].floatValue)
219
- let bottom = CGFloat(bbox[1].floatValue)
220
- let right = CGFloat(bbox[2].floatValue)
221
- let top = CGFloat(bbox[3].floatValue)
222
- let rect = CGRect(x: [left,right].min()!, y: [bottom,top].min()!, width: fabs(right-left), height: fabs(top-bottom))
223
-
217
+ withMapView(reactTag, name:"queryRenderedFeaturesInRect", rejecter: rejecter) { mapView in
218
+ let left = bbox.isEmpty ? 0.0 : CGFloat(bbox[0].floatValue)
219
+ let bottom = bbox.isEmpty ? 0.0 : CGFloat(bbox[1].floatValue)
220
+ let right = bbox.isEmpty ? 0.0 : CGFloat(bbox[2].floatValue)
221
+ let top = bbox.isEmpty ? 0.0 : CGFloat(bbox[3].floatValue)
222
+ let rect = bbox.isEmpty ? CGRect(x: 0.0, y: 0.0, width: mapView.bounds.size.width, height: mapView.bounds.size.height) : CGRect(x: [left,right].min()!, y: [top,bottom].min()!, width: abs(right-left), height: abs(bottom-top))
224
223
  logged("queryRenderedFeaturesInRect.option", rejecter: rejecter) {
225
224
  let options = try RenderedQueryOptions(layerIds: layerIDs, filter: filter?.asExpression())
226
-
227
- mapboxMap.queryRenderedFeatures(in: rect, options: options) { result in
225
+ mapView.mapboxMap.queryRenderedFeatures(with: rect, options: options) { result in
228
226
  switch result {
229
227
  case .success(let features):
230
228
  resolver([
@@ -233,7 +231,7 @@ extension RCTMGLMapViewManager {
233
231
  }]
234
232
  ])
235
233
  case .failure(let error):
236
- rejecter("queryRenderedFeaturesAtPoint","failed to query features", error)
234
+ rejecter("queryRenderedFeaturesInRect","failed to query features", error)
237
235
  }
238
236
  }
239
237
  }
@@ -516,14 +516,6 @@ func fillExtrusionLayer(layer: inout FillExtrusionLayer, reactStyle:Dictionary<S
516
516
  self.setFillExtrusionBaseTransition(&layer, styleValue:styleValue);
517
517
  } else if (prop == "fillExtrusionVerticalGradient") {
518
518
  self.setFillExtrusionVerticalGradient(&layer, styleValue:styleValue);
519
- } else if (prop == "fillExtrusionAmbientOcclusionIntensity") {
520
- self.setFillExtrusionAmbientOcclusionIntensity(&layer, styleValue:styleValue);
521
- } else if (prop == "fillExtrusionAmbientOcclusionIntensityTransition") {
522
- self.setFillExtrusionAmbientOcclusionIntensityTransition(&layer, styleValue:styleValue);
523
- } else if (prop == "fillExtrusionAmbientOcclusionRadius") {
524
- self.setFillExtrusionAmbientOcclusionRadius(&layer, styleValue:styleValue);
525
- } else if (prop == "fillExtrusionAmbientOcclusionRadiusTransition") {
526
- self.setFillExtrusionAmbientOcclusionRadiusTransition(&layer, styleValue:styleValue);
527
519
  } else {
528
520
  Logger.log(level:.error, message: "Unexpected property \(prop) for layer: fill-extrusion")
529
521
  }
@@ -2027,34 +2019,6 @@ func setFillExtrusionVerticalGradient(_ layer: inout FillExtrusionLayer, styleVa
2027
2019
 
2028
2020
  }
2029
2021
 
2030
- func setFillExtrusionAmbientOcclusionIntensity(_ layer: inout FillExtrusionLayer, styleValue: RCTMGLStyleValue)
2031
- {
2032
-
2033
-
2034
- layer.fillExtrusionAmbientOcclusionIntensity = styleValue.mglStyleValueNumber();
2035
-
2036
-
2037
- }
2038
-
2039
- func setFillExtrusionAmbientOcclusionIntensityTransition(_ layer: inout FillExtrusionLayer, styleValue: RCTMGLStyleValue)
2040
- {
2041
- layer.fillExtrusionAmbientOcclusionIntensityTransition = styleValue.getTransition();
2042
- }
2043
-
2044
- func setFillExtrusionAmbientOcclusionRadius(_ layer: inout FillExtrusionLayer, styleValue: RCTMGLStyleValue)
2045
- {
2046
-
2047
-
2048
- layer.fillExtrusionAmbientOcclusionRadius = styleValue.mglStyleValueNumber();
2049
-
2050
-
2051
- }
2052
-
2053
- func setFillExtrusionAmbientOcclusionRadiusTransition(_ layer: inout FillExtrusionLayer, styleValue: RCTMGLStyleValue)
2054
- {
2055
- layer.fillExtrusionAmbientOcclusionRadiusTransition = styleValue.getTransition();
2056
- }
2057
-
2058
2022
 
2059
2023
 
2060
2024
  func setRasterStyleLayerVisibility(_ layer: inout RasterLayer, styleValue: RCTMGLStyleValue)
@@ -57,6 +57,11 @@ class MapView extends NativeBridgeComponent(
57
57
  PropTypes.number,
58
58
  ]),
59
59
 
60
+ /**
61
+ * The projection used when rendering the map
62
+ */
63
+ projection: PropTypes.oneOf(['mercator', 'globe']),
64
+
60
65
  /**
61
66
  * Style for wrapping React Native View
62
67
  */
@@ -294,6 +299,7 @@ class MapView extends NativeBridgeComponent(
294
299
  };
295
300
 
296
301
  static defaultProps = {
302
+ projection: 'mercator',
297
303
  localizeLabels: false,
298
304
  scrollEnabled: true,
299
305
  pitchEnabled: true,
@@ -391,21 +397,27 @@ class MapView extends NativeBridgeComponent(
391
397
  );
392
398
  if (props.onRegionDidChange) {
393
399
  console.warn(
394
- 'rnmapbox/maps: only one of MapView.onRegionDidChange or onMapIdle is supported',
400
+ 'rnmapbox/maps: only one of MapView.onRegionDidChange or onMapIdle is supported',
395
401
  );
396
402
  }
397
403
  }
398
404
  if (addIfHasHandler('CameraChanged')) {
399
405
  console.warn(
400
- 'onCameraChanged is deprecated and will be removed in next beta - please use onRegionWillChange',
406
+ 'onCameraChanged is deprecated and will be removed in next beta - please use onRegionIsChanging',
401
407
  );
402
- if (props.onRegionWillChange) {
408
+ if (props.onRegionIsChanging) {
403
409
  console.warn(
404
- 'rnmapbox/maps: only one of MapView.onRegionWillChange or onCameraChanged is supported',
410
+ 'rnmapbox/maps: only one of MapView.onRegionIsChanging or onCameraChanged is supported',
405
411
  );
406
412
  }
407
413
  }
408
414
 
415
+ if (props.onRegionWillChange) {
416
+ console.warn(
417
+ 'onRegionWillChange is deprecated and will be removed in v10 - please use onRegionIsChanging',
418
+ );
419
+ }
420
+
409
421
  this._runNativeCommand('setHandledMapChangedEvents', this._nativeRef, [
410
422
  events,
411
423
  ]);
@@ -495,33 +507,38 @@ class MapView extends NativeBridgeComponent(
495
507
 
496
508
  /**
497
509
  * Returns an array of rendered map features that intersect with the given rectangle,
498
- * restricted to the given style layers and filtered by the given predicate.
510
+ * restricted to the given style layers and filtered by the given predicate. In v10,
511
+ * passing an empty array will query the entire visible bounds of the map.
499
512
  *
500
513
  * @example
501
514
  * this._map.queryRenderedFeaturesInRect([30, 40, 20, 10], ['==', 'type', 'Point'], ['id1', 'id2'])
502
515
  *
503
- * @param {Array<Number>} bbox - A rectangle expressed in the map view’s coordinate system.
516
+ * @param {Array<Number>} bbox - A rectangle expressed in the map view’s coordinate system. For v10, this can be an empty array to query the visible map area.
504
517
  * @param {Array=} filter - A set of strings that correspond to the names of layers defined in the current style. Only the features contained in these layers are included in the returned array.
505
518
  * @param {Array=} layerIDs - A array of layer id's to filter the features by
506
519
  * @return {FeatureCollection}
507
520
  */
508
521
  async queryRenderedFeaturesInRect(bbox, filter = [], layerIDs = []) {
509
- if (!bbox || bbox.length !== 4) {
510
- throw new Error(
511
- 'Must pass in a valid bounding box[top, right, bottom, left]',
522
+ if (
523
+ bbox != null &&
524
+ (bbox.length === 4 || (MapboxGL.MapboxV10 && bbox.length === 0))
525
+ ) {
526
+ const res = await this._runNativeCommand(
527
+ 'queryRenderedFeaturesInRect',
528
+ this._nativeRef,
529
+ [bbox, getFilter(filter), layerIDs],
512
530
  );
513
- }
514
- const res = await this._runNativeCommand(
515
- 'queryRenderedFeaturesInRect',
516
- this._nativeRef,
517
- [bbox, getFilter(filter), layerIDs],
518
- );
519
531
 
520
- if (isAndroid()) {
521
- return JSON.parse(res.data);
522
- }
532
+ if (isAndroid()) {
533
+ return JSON.parse(res.data);
534
+ }
523
535
 
524
- return res.data;
536
+ return res.data;
537
+ } else {
538
+ throw new Error(
539
+ 'Must pass in a valid bounding box: [top, right, bottom, left]. An empty array [] is also acceptable in v10.',
540
+ );
541
+ }
525
542
  }
526
543
 
527
544
  /**
@@ -120,18 +120,15 @@ class MarkerView extends React.PureComponent<Props> {
120
120
  allowOverlap={this.props.allowOverlap}
121
121
  isSelected={this.props.isSelected}
122
122
  onTouchEnd={(e) => {
123
- console.log('e => ');
124
123
  e.stopPropagation();
125
124
  }}
126
125
  >
127
126
  <View
128
127
  style={{ flex: 0, alignSelf: 'flex-start' }}
129
128
  onStartShouldSetResponder={(_event) => {
130
- console.log('+> onStart');
131
129
  return true;
132
130
  }}
133
131
  onTouchEnd={(e) => {
134
- console.log('e => ');
135
132
  e.stopPropagation();
136
133
  }}
137
134
  >
@@ -82,11 +82,11 @@ export class SymbolLayer extends AbstractLayer<Props, NativeTypeProps> {
82
82
  _shouldSnapshot() {
83
83
  let isSnapshot = false;
84
84
 
85
- if (React.Children.count(this.props.children) <= 0) {
85
+ if (React.Children.count(this.baseProps.children) <= 0) {
86
86
  return isSnapshot;
87
87
  }
88
88
 
89
- React.Children.forEach(this.props.children, (child) => {
89
+ React.Children.forEach(this.baseProps.children, (child) => {
90
90
  if (child?.type === View) {
91
91
  isSnapshot = true;
92
92
  }
@@ -1258,24 +1258,6 @@ export interface FillExtrusionLayerStyleProps {
1258
1258
  * Whether to apply a vertical gradient to the sides of a fillExtrusion layer. If true, sides will be shaded slightly darker farther down.
1259
1259
  */
1260
1260
  fillExtrusionVerticalGradient?: Value<boolean, ['zoom']>;
1261
- /**
1262
- * Controls the intensity of ambient occlusion (AO) shading. Current AO implementation is a lowCost bestEffort approach that shades area near ground and concave angles between walls. Default value 0.0 disables ambient occlusion and values around 0.3 provide the most plausible results for buildings.
1263
- */
1264
- fillExtrusionAmbientOcclusionIntensity?: Value<number, ['zoom']>;
1265
-
1266
- /**
1267
- * The transition affecting any changes to this layer’s fillExtrusionAmbientOcclusionIntensity property.
1268
- */
1269
- fillExtrusionAmbientOcclusionIntensityTransition?: Transition;
1270
- /**
1271
- * The radius of ambient occlusion (AO) shading, in meters. Current AO implementation is a lowCost bestEffort approach that shades area near ground and concave angles between walls where the radius defines only vertical impact. Default value 3.0 corresponds to hight of one floor and brings the most plausible results for buildings.
1272
- */
1273
- fillExtrusionAmbientOcclusionRadius?: Value<number, ['zoom']>;
1274
-
1275
- /**
1276
- * The transition affecting any changes to this layer’s fillExtrusionAmbientOcclusionRadius property.
1277
- */
1278
- fillExtrusionAmbientOcclusionRadiusTransition?: Transition;
1279
1261
  }
1280
1262
  export interface RasterLayerStyleProps {
1281
1263
  /**
@@ -1196,38 +1196,6 @@ export const FillExtrusionLayerStyleProp = PropTypes.shape({
1196
1196
  PropTypes.bool,
1197
1197
  PropTypes.array,
1198
1198
  ]),
1199
-
1200
- /**
1201
- * Controls the intensity of ambient occlusion (AO) shading. Current AO implementation is a lowCost bestEffort approach that shades area near ground and concave angles between walls. Default value 0.0 disables ambient occlusion and values around 0.3 provide the most plausible results for buildings.
1202
- */
1203
- fillExtrusionAmbientOcclusionIntensity: PropTypes.oneOfType([
1204
- PropTypes.number,
1205
- PropTypes.array,
1206
- ]),
1207
-
1208
- /**
1209
- * The transition affecting any changes to this layer’s fillExtrusionAmbientOcclusionIntensity property.
1210
- */
1211
- fillExtrusionAmbientOcclusionIntensityTransition: PropTypes.shape({
1212
- duration: PropTypes.number,
1213
- delay: PropTypes.number,
1214
- }),
1215
-
1216
- /**
1217
- * The radius of ambient occlusion (AO) shading, in meters. Current AO implementation is a lowCost bestEffort approach that shades area near ground and concave angles between walls where the radius defines only vertical impact. Default value 3.0 corresponds to hight of one floor and brings the most plausible results for buildings.
1218
- */
1219
- fillExtrusionAmbientOcclusionRadius: PropTypes.oneOfType([
1220
- PropTypes.number,
1221
- PropTypes.array,
1222
- ]),
1223
-
1224
- /**
1225
- * The transition affecting any changes to this layer’s fillExtrusionAmbientOcclusionRadius property.
1226
- */
1227
- fillExtrusionAmbientOcclusionRadiusTransition: PropTypes.shape({
1228
- duration: PropTypes.number,
1229
- delay: PropTypes.number,
1230
- }),
1231
1199
  });
1232
1200
 
1233
1201
  export const RasterLayerStyleProp = PropTypes.shape({
@@ -1847,10 +1815,6 @@ const styleMap = {
1847
1815
  fillExtrusionBase: StyleTypes.Constant,
1848
1816
  fillExtrusionBaseTransition: StyleTypes.Transition,
1849
1817
  fillExtrusionVerticalGradient: StyleTypes.Constant,
1850
- fillExtrusionAmbientOcclusionIntensity: StyleTypes.Constant,
1851
- fillExtrusionAmbientOcclusionIntensityTransition: StyleTypes.Transition,
1852
- fillExtrusionAmbientOcclusionRadius: StyleTypes.Constant,
1853
- fillExtrusionAmbientOcclusionRadiusTransition: StyleTypes.Transition,
1854
1818
 
1855
1819
  rasterOpacity: StyleTypes.Constant,
1856
1820
  rasterOpacityTransition: StyleTypes.Transition,
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.0.0-beta.47",
4
+ "version": "10.0.0-beta.49",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
package/plugin/install.md CHANGED
@@ -32,8 +32,6 @@ After installing this package, add the [config plugin](https://docs.expo.io/guid
32
32
  }
33
33
  ```
34
34
 
35
- Next, rebuild your app as described in the ["Adding custom native code"](https://docs.expo.io/workflow/customizing/) guide.
36
-
37
35
  For `mapbox` or `mapbox-gl` you'll need to provide `RNMapboxMapsDownloadToken` as well.
38
36
 
39
37
  ```json
@@ -52,6 +50,8 @@ For `mapbox` or `mapbox-gl` you'll need to provide `RNMapboxMapsDownloadToken` a
52
50
  }
53
51
  ```
54
52
 
53
+ Next, rebuild your app as described in the ["Adding custom native code"](https://docs.expo.io/workflow/customizing/) guide.
54
+
55
55
  ## Manual Setup
56
56
 
57
57
  For bare workflow projects, you can follow the manual setup guides:
@@ -20,7 +20,7 @@ require 'json'
20
20
  package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
21
21
 
22
22
  ## Warning: these lines are scanned by autogenerate.js
23
- rnMapboxMapsDefaultMapboxVersion = '~> 10.8.1'
23
+ rnMapboxMapsDefaultMapboxVersion = '~> 10.9.0'
24
24
  rnMapboxMapsDefaultMapboxGLVersion = '~> 5.9.0'
25
25
  rnMapboxMapsDefaultMapLibreVersion = 'exactVersion 5.12.1'
26
26
 
@@ -348,6 +348,9 @@ function isTranslate(attrName) {
348
348
 
349
349
  function isAttrSupported(attr, only) {
350
350
  const support = getAttributeSupport(attr['sdk-support']);
351
+ if (attr.private === true) {
352
+ return false;
353
+ }
351
354
  if (only != null) {
352
355
  return support.basic[only].android && support.basic[only].ios;
353
356
  }
@@ -196,7 +196,7 @@
196
196
  },
197
197
  "promoteId": {
198
198
  "type": "promoteId",
199
- "doc": "A property to use as a feature id (for feature state). Either a property name, or an object of the form `{<sourceLayer>: <propertyName>}`. If specified as a string for a vector tile source, the same property is used across all its source layers."
199
+ "doc": "A property to use as a feature id (for feature state). Either a property name, or an object of the form `{<sourceLayer>: <propertyName>}`. If specified as a string for a vector tile source, the same property is used across all its source layers. If specified as an object only specified source layers will have id overriden, others will fallback to original feature id"
200
200
  },
201
201
  "volatile": {
202
202
  "type": "boolean",
@@ -877,6 +877,22 @@
877
877
  }
878
878
  },
879
879
  "property-type": "constant"
880
+ },
881
+ "fill-extrusion-edge-radius": {
882
+ "type": "number",
883
+ "private": true,
884
+ "default": 0,
885
+ "minimum": 0,
886
+ "maximum": 1,
887
+ "doc": "Radius of a fill extrusion edge in meters. If not zero, rounds extrusion edges for a smoother appearance.",
888
+ "sdk-support": {
889
+ "basic functionality": {
890
+ "js": "v2.10.0",
891
+ "android": "10.7.0",
892
+ "ios": "10.7.0"
893
+ }
894
+ },
895
+ "property-type": "constant"
880
896
  }
881
897
  },
882
898
  "layout_line": {
@@ -1890,7 +1906,9 @@
1890
1906
  "macos": "0.1.0"
1891
1907
  },
1892
1908
  "data-driven styling": {
1893
- "js": "2.3.0"
1909
+ "js": "2.3.0",
1910
+ "android": "10.0.0",
1911
+ "ios": "10.0.0"
1894
1912
  }
1895
1913
  },
1896
1914
  "expression": {
@@ -2798,7 +2816,9 @@
2798
2816
  "group": "Lookup",
2799
2817
  "sdk-support": {
2800
2818
  "basic functionality": {
2801
- "js": "1.10.0"
2819
+ "js": "1.10.0",
2820
+ "android": "10.0.0",
2821
+ "ios": "10.0.0"
2802
2822
  }
2803
2823
  }
2804
2824
  },
@@ -2807,7 +2827,9 @@
2807
2827
  "group": "Lookup",
2808
2828
  "sdk-support": {
2809
2829
  "basic functionality": {
2810
- "js": "1.10.0"
2830
+ "js": "1.10.0",
2831
+ "android": "10.0.0",
2832
+ "ios": "10.0.0"
2811
2833
  }
2812
2834
  }
2813
2835
  },
@@ -3194,12 +3216,14 @@
3194
3216
  "group": "Feature data",
3195
3217
  "sdk-support": {
3196
3218
  "basic functionality": {
3197
- "js": "0.46.0"
3219
+ "js": "0.46.0",
3220
+ "android": "10.0.0",
3221
+ "ios": "10.0.0"
3198
3222
  }
3199
3223
  }
3200
3224
  },
3201
3225
  "geometry-type": {
3202
- "doc": "Returns the feature's geometry type: `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`. `Multi*` feature types are only returned in GeoJSON sources. When working with vector tile sources, use the singular forms.",
3226
+ "doc": "Returns the feature's geometry type: `Point`, `LineString` or `Polygon`. `Multi*` feature types return the singular forms.",
3203
3227
  "group": "Feature data",
3204
3228
  "sdk-support": {
3205
3229
  "basic functionality": {
@@ -3239,7 +3263,9 @@
3239
3263
  "group": "Camera",
3240
3264
  "sdk-support": {
3241
3265
  "basic functionality": {
3242
- "js": "2.6.0"
3266
+ "js": "2.6.0",
3267
+ "android": "10.9.0",
3268
+ "ios": "10.9.0"
3243
3269
  }
3244
3270
  }
3245
3271
  },
@@ -3248,7 +3274,9 @@
3248
3274
  "group": "Camera",
3249
3275
  "sdk-support": {
3250
3276
  "basic functionality": {
3251
- "js": "2.6.0"
3277
+ "js": "2.6.0",
3278
+ "android": "10.9.0",
3279
+ "ios": "10.9.0"
3252
3280
  }
3253
3281
  }
3254
3282
  },
@@ -3736,7 +3764,9 @@
3736
3764
  "sdk-support": {
3737
3765
  "basic functionality": {
3738
3766
  "js": "0.45.0",
3739
- "android": "6.6.0"
3767
+ "android": "6.6.0",
3768
+ "ios": "4.1.0",
3769
+ "macos": "0.8.0"
3740
3770
  }
3741
3771
  }
3742
3772
  },
@@ -4659,6 +4689,7 @@
4659
4689
  "fill-extrusion-ambient-occlusion-intensity": {
4660
4690
  "property-type": "data-constant",
4661
4691
  "type": "number",
4692
+ "private": true,
4662
4693
  "default": 0.0,
4663
4694
  "minimum": 0,
4664
4695
  "maximum": 1,
@@ -4669,10 +4700,10 @@
4669
4700
  ]
4670
4701
  },
4671
4702
  "transition": true,
4672
- "doc": "Controls the intensity of ambient occlusion (AO) shading. Current AO implementation is a low-cost best-effort approach that shades area near ground and concave angles between walls. Default value 0.0 disables ambient occlusion and values around 0.3 provide the most plausible results for buildings.",
4703
+ "doc": "Controls the intensity of shading near ground and concave angles between walls. Default value 0.0 disables ambient occlusion and values around 0.3 provide the most plausible results for buildings.",
4673
4704
  "sdk-support": {
4674
4705
  "basic functionality": {
4675
- "js": "2.8.3",
4706
+ "js": "2.10.0",
4676
4707
  "android": "10.7.0",
4677
4708
  "ios": "10.7.0"
4678
4709
  }
@@ -4681,6 +4712,7 @@
4681
4712
  "fill-extrusion-ambient-occlusion-radius": {
4682
4713
  "property-type": "data-constant",
4683
4714
  "type": "number",
4715
+ "private": true,
4684
4716
  "default": 3.0,
4685
4717
  "minimum": 0,
4686
4718
  "expression": {
@@ -4690,10 +4722,13 @@
4690
4722
  ]
4691
4723
  },
4692
4724
  "transition": true,
4693
- "doc": "The radius of ambient occlusion (AO) shading, in meters. Current AO implementation is a low-cost best-effort approach that shades area near ground and concave angles between walls where the radius defines only vertical impact. Default value 3.0 corresponds to hight of one floor and brings the most plausible results for buildings.",
4725
+ "doc": "Shades area near ground and concave angles between walls where the radius defines only vertical impact. Default value 3.0 corresponds to height of one floor and brings the most plausible results for buildings.",
4726
+ "requires": [
4727
+ "fill-extrusion-edge-radius"
4728
+ ],
4694
4729
  "sdk-support": {
4695
4730
  "basic functionality": {
4696
- "js": "2.8.3",
4731
+ "js": "2.10.0",
4697
4732
  "android": "10.7.0",
4698
4733
  "ios": "10.7.0"
4699
4734
  }