fix(PointAnnotationManager): override getDelegate on Android view manager#4246
Merged
Merged
Conversation
…ager RNMBXPointAnnotationManagerViewManager (added in #4240) never overrode getDelegate(), so under Fabric its props (slot, iconAllowOverlap, …) were never applied and React Native logged: ReactNoCrashSoftException: ViewManager using codegen must override getDelegate method (name: RNMBXPointAnnotationManager). As a result multiple PointAnnotationManagers rendered blank on Android. Provide the codegen delegate like the other view managers (RNMBXCalloutManager, RNMBXMarkerViewManager).
…efault The Android annotation plugin defaults iconAllowOverlap/iconIgnorePlacement to true so annotations always show. applyProps() unconditionally wrote the (nullable) props, so when they were unset it pushed null and reset the manager to the style-spec default (false), culling colliding pins. In the PointAnnotationManager Slot example this dropped pin 2. Only write each option when the prop is actually set.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes an Android regression introduced by #4240. The new
RNMBXPointAnnotationManagerViewManagernever overrodegetDelegate(), so under Fabric its props (slot,iconAllowOverlap,textAllowOverlap, …) were never applied and React Native logged a soft exception:As a result,
PointAnnotationManagers rendered blank on Android — thePointAnnotationManager Multipleexample showed no pins. This adds the codegen delegate, matching the other view managers (RNMBXCalloutManager,RNMBXMarkerViewManager). iOS was unaffected (props are applied viaupdatePropsin the component view).Verified on an emulator (New Architecture): with the fix the soft exception is gone and the
top-slot pins render in front of the Standard style's 3D buildings while thebottom-slot pins are occluded behind them, matching iOS.Checklist
CONTRIBUTING.mdyarn generatein the root folder/exampleapp./example)Component to reproduce the issue you're fixing
Two managers in different slots — renders blank on Android without this fix
Or run
Annotations › PointAnnotationManager Multiplein the example app.