@rnmapbox/maps 10.0.0-beta.38 → 10.0.0-beta.39

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.
@@ -2,63 +2,67 @@
2
2
 
3
3
  ## We're supporting 3 implementations at the moment:
4
4
 
5
- - maplibre: *DEFAULT* open source fork of older open source mapbox libraries with many improvements
6
- - mapbox: v10 latest mapbox implementation - not opensource requires access for download
7
- - mapbox-gl: classic mapbox libraries - should work but will be dropped, recent versions are not open source and requires acess for download
5
+ - mapbox: v10 latest mapbox implementation - *recommended*, not opensource requires access for download
6
+ - maplibre: *DEFAULT* open source fork of older open source mapbox libraries with many improvements, will be removed in next version
7
+ - mapbox-gl: classic mapbox libraries - should work but will be dropped, recent versions are not open source and requires acess for download, will be removed in next version
8
8
 
9
+ ## Mapbox Maps SDK v10
9
10
 
10
- ## Using MapLibre
11
-
12
- [MapLibre](https://github.com/maplibre/maplibre-gl-native) is an OSS fork of MapboxGL.
13
- This is the default, and should work without any changes in gradle files.
11
+ Add `RNMapboxMapsImpl = "mapbox"` to your gradle file - see bellow for details.
14
12
 
15
13
  ### Custom versions
16
14
 
15
+ *Warning*: If you set a custome version make sure you revisit, any time you update @rnmapbox/maps. Setting it to earlier version to what we exepect will likely result in a build error.
16
+
17
17
  Overwrite mapbox dependencies within your `android/build.gradle > buildscript > ext` section
18
18
 
19
+
19
20
  ```groovy
20
21
  buildscript {
21
22
  ext {
22
23
  // ...
23
- RNMapboxMapsImpl = "maplibre" // optional - as this is the default
24
+ RNMapboxMapsImpl = "mapbox" // required for v10
24
25
 
25
26
  RNMapboxMapsLibs = { // optional - only required if you want to customize it
26
- implementation ("org.maplibre.gl:android-sdk:9.5.2")
27
- implementation ("org.maplibre.gl:android-sdk-turf:5.9.0")
28
-
29
- implementation ("org.maplibre.gl:android-plugin-localization-v9:1.0.0")
30
- implementation ("org.maplibre.gl:android-plugin-annotation-v9:1.0.0")
31
- implementation ("org.maplibre.gl:android-plugin-markerview-v9:1.0.0")
27
+ implementation 'com.mapbox.maps:android:10.6.0'
28
+ implementation 'com.mapbox.mapboxsdk:mapbox-sdk-turf:5.4.1'
32
29
  }
33
30
  }
34
31
  }
35
32
  ```
36
33
 
37
- Feel free to check out the `/example` projects [`android/build.gradle`](https://github.com/rnmapbox/maps/blob/main/example/android/build.gradle) for inspiration!
38
34
 
39
- ## Mapbox Maps SDK v10
40
35
 
41
- Add `RNMapboxMapsImpl = "mapbox"` to your gradle file - see bellow for details.
36
+ ## Using MapLibre
37
+
38
+ [MapLibre](https://github.com/maplibre/maplibre-gl-native) is an OSS fork of MapboxGL.
39
+ This is the default, and should work without any changes in gradle files.
42
40
 
43
41
  ### Custom versions
44
42
 
45
43
  Overwrite mapbox dependencies within your `android/build.gradle > buildscript > ext` section
46
44
 
47
-
48
45
  ```groovy
49
46
  buildscript {
50
47
  ext {
51
48
  // ...
52
- RNMapboxMapsImpl = "mapbox" // required for v10
49
+ RNMapboxMapsImpl = "maplibre" // optional - as this is the default
53
50
 
54
51
  RNMapboxMapsLibs = { // optional - only required if you want to customize it
55
- implementation 'com.mapbox.maps:android:10.6.0'
56
- implementation 'com.mapbox.mapboxsdk:mapbox-sdk-turf:5.4.1'
52
+ implementation ("org.maplibre.gl:android-sdk:9.5.2")
53
+ implementation ("org.maplibre.gl:android-sdk-turf:5.9.0")
54
+
55
+ implementation ("org.maplibre.gl:android-plugin-localization-v9:1.0.0")
56
+ implementation ("org.maplibre.gl:android-plugin-annotation-v9:1.0.0")
57
+ implementation ("org.maplibre.gl:android-plugin-markerview-v9:1.0.0")
57
58
  }
58
59
  }
59
60
  }
60
61
  ```
61
62
 
63
+ Feel free to check out the `/example` projects [`android/build.gradle`](https://github.com/rnmapbox/maps/blob/main/example/android/build.gradle) for inspiration!
64
+
65
+
62
66
  ## Mapbox Maps GL Native SDK (pre v10)
63
67
 
64
68
 
@@ -910,5 +910,16 @@ class PointAnnotationManager : AnnotationInteractionDelegate {
910
910
  manager.annotations.append(annotation)
911
911
  manager.syncSourceAndLayerIfNeeded()
912
912
  }
913
+
914
+ func refresh(_ annotation: PointAnnotation) {
915
+ let index = manager.annotations.firstIndex { $0.id == annotation.id }
916
+ if let index = index {
917
+ manager.annotations[index] = annotation
918
+ manager.syncSourceAndLayerIfNeeded()
919
+ } else {
920
+ Logger.log(level: .warn, message: "RCTMGL - PointAnnotation.refresh: expected annotation already there - adding")
921
+ add(annotation)
922
+ }
923
+ }
913
924
  }
914
925
 
@@ -36,12 +36,17 @@ class RCTMGLPointAnnotation : RCTMGLInteractiveElement {
36
36
  return result
37
37
  }
38
38
 
39
+ func _refresh(_ annotation: PointAnnotation) {
40
+ map?.pointAnnotationManager.refresh(annotation)
41
+ }
42
+
39
43
  func _updateCoordinate() {
40
44
  guard let point = point() else {
41
45
  return
42
46
  }
43
47
  if var annotation = annotation {
44
48
  annotation.point = point
49
+ _refresh(annotation)
45
50
  } else {
46
51
  annotation = _create(point: point)
47
52
  setAnnotationImage(inital: true)
@@ -11,7 +11,7 @@ class AbstractLayer extends React.PureComponent {
11
11
  ...this.props,
12
12
  id: this.props.id,
13
13
  sourceID: this.props.sourceID,
14
- reactStyle: this.getStyle(),
14
+ reactStyle: this.getStyle(this.props.style),
15
15
  minZoomLevel: this.props.minZoomLevel,
16
16
  maxZoomLevel: this.props.maxZoomLevel,
17
17
  aboveLayerID: this.props.aboveLayerID,
@@ -28,8 +28,8 @@ class AbstractLayer extends React.PureComponent {
28
28
  }
29
29
  }
30
30
 
31
- getStyle() {
32
- return transformStyle(this.props.style);
31
+ getStyle(style) {
32
+ return transformStyle(style);
33
33
  }
34
34
 
35
35
  setNativeProps(props) {
@@ -34,7 +34,7 @@ class Light extends AbstractLayer {
34
34
  testID="rctmglLight"
35
35
  {...this.props}
36
36
  style={undefined}
37
- reactStyle={this.getStyle()}
37
+ reactStyle={this.getStyle(this.props.style)}
38
38
  />
39
39
  );
40
40
  }
@@ -285,7 +285,7 @@ class ShapeSource extends NativeBridgeComponent(AbstractSource) {
285
285
  const shallowProps = Object.assign({}, props);
286
286
 
287
287
  // Adds support for Animated
288
- if (shallowProps.shape && typeof shallowProps !== 'string') {
288
+ if (shallowProps.shape && typeof shallowProps.shape !== 'string') {
289
289
  shallowProps.shape = JSON.stringify(shallowProps.shape);
290
290
  }
291
291
 
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.38",
4
+ "version": "10.0.0-beta.39",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },