Skip to content

Commit

Permalink
fix applying of bool properties for MapView compoennt on iOS with New…
Browse files Browse the repository at this point in the history
… Architecture enabled (#3730)
  • Loading branch information
TuTejsy authored Jan 9, 2025
1 parent fa80ae5 commit b386d37
Showing 1 changed file with 9 additions and 33 deletions.
42 changes: 9 additions & 33 deletions ios/RNMBX/RNMBXMapViewComponentView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -136,35 +136,23 @@ - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &
const auto &oldViewProps = static_cast<const RNMBXMapViewProps &>(*oldProps);
const auto &newViewProps = static_cast<const RNMBXMapViewProps &>(*props);

id attributionEnabled = RNMBXConvertFollyDynamicToId(newViewProps.attributionEnabled);
if (attributionEnabled != nil) {
_view.reactAttributionEnabled = attributionEnabled;
}
RNMBX_REMAP_OPTIONAL_PROP_BOOL(attributionEnabled, reactAttributionEnabled)

id attributionPosition = RNMBXConvertFollyDynamicToId(newViewProps.attributionPosition);
if (attributionPosition != nil) {
_view.reactAttributionPosition = attributionPosition;
}

id logoEnabled = RNMBXConvertFollyDynamicToId(newViewProps.logoEnabled);
if (logoEnabled != nil) {
_view.reactLogoEnabled = logoEnabled;
}
RNMBX_REMAP_OPTIONAL_PROP_BOOL(logoEnabled, reactLogoEnabled)

id logoPosition = RNMBXConvertFollyDynamicToId(newViewProps.logoPosition);
if (logoPosition != nil) {
_view.reactLogoPosition = logoPosition;
}

id compassEnabled = RNMBXConvertFollyDynamicToId(newViewProps.compassEnabled);
if (compassEnabled != nil) {
_view.reactCompassEnabled = compassEnabled;
}
RNMBX_REMAP_OPTIONAL_PROP_BOOL(compassEnabled, reactCompassEnabled)

id compassFadeWhenNorth = RNMBXConvertFollyDynamicToId(newViewProps.compassFadeWhenNorth);
if (compassFadeWhenNorth != nil) {
_view.reactCompassFadeWhenNorth = compassFadeWhenNorth;
}
RNMBX_REMAP_OPTIONAL_PROP_BOOL(compassFadeWhenNorth, reactCompassFadeWhenNorth)

id compassPosition = RNMBXConvertFollyDynamicToId(newViewProps.compassPosition);
if (compassPosition != nil) {
Expand Down Expand Up @@ -194,25 +182,13 @@ - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &
_view.reactScaleBarPosition = scaleBarPosition;
}

id zoomEnabled = RNMBXConvertFollyDynamicToId(newViewProps.zoomEnabled);
if (zoomEnabled != nil) {
_view.reactZoomEnabled = zoomEnabled;
}
RNMBX_REMAP_OPTIONAL_PROP_BOOL(zoomEnabled, reactZoomEnabled)

id scrollEnabled = RNMBXConvertFollyDynamicToId(newViewProps.scrollEnabled);
if (scrollEnabled != nil) {
_view.reactScrollEnabled = scrollEnabled;
}

id rotateEnabled = RNMBXConvertFollyDynamicToId(newViewProps.rotateEnabled);
if (rotateEnabled != nil) {
_view.reactRotateEnabled = rotateEnabled;
}
RNMBX_REMAP_OPTIONAL_PROP_BOOL(scrollEnabled, reactScrollEnabled)

id pitchEnabled = RNMBXConvertFollyDynamicToId(newViewProps.pitchEnabled);
if (pitchEnabled != nil) {
_view.reactPitchEnabled = pitchEnabled;
}
RNMBX_REMAP_OPTIONAL_PROP_BOOL(rotateEnabled, reactRotateEnabled)

RNMBX_REMAP_OPTIONAL_PROP_BOOL(pitchEnabled, reactPitchEnabled)

id projection = RNMBXConvertFollyDynamicToId(newViewProps.projection);
if (projection != nil) {
Expand Down

0 comments on commit b386d37

Please sign in to comment.