@mapsindoors/react-native-maps-indoors-mapbox 2.1.1 → 2.1.2

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/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Documentation
4
4
 
5
- Visit [our reference document site](https://app.mapsindoors.com/mapsindoors/reference/react-native/mapbox/2.1.1/index.html) to get an overview of what the MapsIndoors SDK offers.
5
+ Visit [our reference document site](https://app.mapsindoors.com/mapsindoors/reference/react-native/mapbox/2.1.2/index.html) to get an overview of what the MapsIndoors SDK offers.
6
6
 
7
7
  ## Getting started
8
8
 
@@ -93,7 +93,7 @@ dependencies {
93
93
  }
94
94
 
95
95
  implementation 'com.mapbox.maps:android:11.7.0'
96
- implementation 'com.mapspeople.mapsindoors:mapbox-v11:4.8.11'
96
+ implementation 'com.mapspeople.mapsindoors:mapbox-v11:4.8.13'
97
97
  implementation 'com.facebook.react:react-native:+' // From node_modules
98
98
  implementation 'androidx.core:core-ktx:1.3.2'
99
99
  implementation 'com.github.bumptech.glide:glide:4.16.0'
@@ -11,6 +11,9 @@ import com.mapbox.maps.CameraState;
11
11
  import com.mapbox.maps.CoordinateBounds;
12
12
  import com.mapbox.maps.EdgeInsets;
13
13
  import com.mapbox.maps.MapView;
14
+ import com.mapbox.maps.plugin.animation.CameraAnimationsPlugin;
15
+ import com.mapbox.maps.plugin.animation.CameraAnimationsUtils;
16
+ import com.mapbox.maps.plugin.animation.MapAnimationOptions;
14
17
  import com.mapsindoors.core.MPIMapConfig;
15
18
  import com.mapsindoors.core.MPPoint;
16
19
  import com.mapsindoors.core.OnResultReadyListener;
@@ -34,7 +37,8 @@ public class MapboxMapView implements RCMapView {
34
37
  @Override
35
38
  public void animateCamera(MPCameraUpdate cameraUpdate, Integer duration, OnResultReadyListener onFinished) {
36
39
  CameraOptions cameraOptions = toCameraOptions(cameraUpdate);
37
- mMapView.getMapboxMap().setCamera(cameraOptions);
40
+ CameraAnimationsPlugin plugin = CameraAnimationsUtils.getCamera(mMapView);
41
+ plugin.easeTo(cameraOptions, new MapAnimationOptions.Builder().duration(duration).build(), null);
38
42
  onFinished.onResultReady(null);
39
43
  }
40
44
 
@@ -105,7 +105,7 @@ class MapBoxView: RCMapView {
105
105
  let camera = mapboxView.mapboxMap.cameraState
106
106
 
107
107
  update = CameraOptions(cameraState: camera)
108
- update.zoom = CGFloat(cameraUpdate.zoom!)
108
+ update.zoom = camera.zoom + CGFloat(cameraUpdate.zoom!)
109
109
 
110
110
  case "zoomTo":
111
111
  let camera = mapboxView.mapboxMap.cameraState
@@ -139,7 +139,7 @@ class MapBoxView: RCMapView {
139
139
 
140
140
  DispatchQueue.main.async { [self] in
141
141
  if (duration != 0) {
142
- mapboxView.mapboxMap.setCamera(to: cameraOption)
142
+ mapboxView.camera.ease(to: cameraOption, duration: TimeInterval(duration/1000))
143
143
  } else {
144
144
  mapboxView.mapboxMap.setCamera(to: cameraOption)
145
145
  }
@@ -525,19 +525,21 @@ public class MapControlModule: RCTEventEmitter {
525
525
  return doReject(reject, message: "mapControl is not available")
526
526
  }
527
527
 
528
- if (setup) {
529
- let delegate = mapsIndoorsData.mapControlListenerDelegate!
530
- mapControl.delegate = delegate
528
+ DispatchQueue.main.async {
529
+ if (setup) {
530
+ let delegate = mapsIndoorsData.mapControlListenerDelegate!
531
+ mapControl.delegate = delegate
531
532
 
532
- let floorSelector = FloorSelector(delegate: delegate)
533
- floorSelector.autoFloorChange = isAutoFloorChangeEnabled
533
+ let floorSelector = FloorSelector(delegate: delegate)
534
+ floorSelector.autoFloorChange = isAutoFloorChangeEnabled
534
535
 
535
- mapControl.floorSelector = floorSelector
536
- mapsIndoorsData.floorSelector = floorSelector
536
+ mapControl.floorSelector = floorSelector
537
+ mapsIndoorsData.floorSelector = floorSelector
537
538
 
538
- } else {
539
- mapControl.floorSelector = nil
540
- mapsIndoorsData.floorSelector = nil
539
+ } else {
540
+ mapControl.floorSelector = nil
541
+ mapsIndoorsData.floorSelector = nil
542
+ }
541
543
  }
542
544
 
543
545
  return resolve(nil)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mapsindoors/react-native-maps-indoors-mapbox",
3
3
  "title": "React Native MapsIndoors Mapbox",
4
- "version": "2.1.1",
4
+ "version": "2.1.2",
5
5
  "description": "React Native MapsIndoors component with mapbox",
6
6
  "react-native": "index.ts",
7
7
  "files": [
@@ -24,7 +24,7 @@ Pod::Spec.new do |s|
24
24
  s.requires_arc = true
25
25
 
26
26
  s.dependency "React"
27
- s.dependency "MapsIndoorsMapbox11", "4.6.1"
28
- s.dependency "MapsIndoorsCodable", "4.6.1"
27
+ s.dependency "MapsIndoorsMapbox11", "4.6.2"
28
+ s.dependency "MapsIndoorsCodable", "4.6.2"
29
29
  end
30
30
 
@@ -45,11 +45,11 @@ export default class MPHighlightBehavior {
45
45
  */
46
46
  public static create(object?: MPHighlightBehaviorParams): MPHighlightBehavior {
47
47
  return new MPHighlightBehavior(
48
- object?.allowFloorChange ? object.allowFloorChange : false,
49
- object?.moveCamera ? object.moveCamera : false,
50
- object?.animationDuration ? object.animationDuration : 0,
51
- object?.showInfoWindow ? object.showInfoWindow : false,
52
- object?.zoomToFit ? object?.zoomToFit : true
48
+ object?.allowFloorChange ?? false,
49
+ object?.moveCamera ?? false,
50
+ object?.animationDuration ?? 0,
51
+ object?.showInfoWindow ?? false,
52
+ object?.zoomToFit ?? true
53
53
  );
54
54
  };
55
55
  }
@@ -43,11 +43,11 @@ export default class MPSelectionBehavior {
43
43
  */
44
44
  static create(object: MPSelectionBehaviorParams): MPSelectionBehavior {
45
45
  return new MPSelectionBehavior(
46
- object?.allowFloorChange ? object.allowFloorChange : true,
47
- object?.moveCamera ? object.moveCamera : true,
48
- object?.animationDuration ? object.animationDuration : 500,
49
- object?.showInfoWindow ? object.showInfoWindow : true,
50
- object?.zoomToFit ? object.zoomToFit : true
46
+ object?.allowFloorChange ?? true,
47
+ object?.moveCamera ?? true,
48
+ object?.animationDuration ?? 500,
49
+ object?.showInfoWindow ?? true,
50
+ object?.zoomToFit ?? true
51
51
  );
52
52
  }
53
53
  }