@maplibre/maplibre-react-native 11.2.0 → 11.2.1

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.
@@ -42,6 +42,11 @@ static double const M2PI = M_PI * 2;
42
42
  _styleWaiters = [[NSMutableArray alloc] init];
43
43
  _logging = [[MLRNLogging alloc] init];
44
44
 
45
+ // Apply JS defaults
46
+ _reactCompassEnabled = NO;
47
+ _reactCompassHiddenFacingNorth = YES;
48
+ [self _applyCompassVisibility];
49
+
45
50
  // Setup map gesture recognizers
46
51
  UITapGestureRecognizer *tap =
47
52
  [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didTapMap:)];
@@ -478,9 +483,16 @@ static double const M2PI = M_PI * 2;
478
483
  }];
479
484
  }
480
485
 
486
+ - (void)_applyCompassVisibility {
487
+ self.compassView.compassVisibility =
488
+ !_reactCompassEnabled ? MLNOrnamentVisibilityHidden
489
+ : (_reactCompassHiddenFacingNorth ? MLNOrnamentVisibilityAdaptive
490
+ : MLNOrnamentVisibilityVisible);
491
+ }
492
+
481
493
  - (void)setReactCompassEnabled:(BOOL)reactCompassEnabled {
482
494
  _reactCompassEnabled = reactCompassEnabled;
483
- self.compassView.hidden = !_reactCompassEnabled;
495
+ [self _applyCompassVisibility];
484
496
  }
485
497
 
486
498
  - (void)setReactCompassPosition:(NSDictionary<NSString *, NSNumber *> *)position {
@@ -501,8 +513,7 @@ static double const M2PI = M_PI * 2;
501
513
 
502
514
  - (void)setReactCompassHiddenFacingNorth:(BOOL)reactCompassHiddenFacingNorth {
503
515
  _reactCompassHiddenFacingNorth = reactCompassHiddenFacingNorth;
504
- self.compassView.compassVisibility =
505
- _reactCompassHiddenFacingNorth ? MLNOrnamentVisibilityAdaptive : MLNOrnamentVisibilityVisible;
516
+ [self _applyCompassVisibility];
506
517
  }
507
518
 
508
519
  - (void)setReactScaleBarEnabled:(BOOL)reactScaleBarEnabled {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@maplibre/maplibre-react-native",
3
3
  "description": "React Native library for creating maps with MapLibre Native for Android & iOS",
4
- "version": "11.2.0",
4
+ "version": "11.2.1",
5
5
  "publishConfig": {
6
6
  "access": "public",
7
7
  "provenance": true