question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SymbolLayer children don't render on Android

See original GitHub issue

Describe the bug I am looking for a way to display custom Symbols (in this case a FontAwesome Icon from rn-vector-icons). I have found issue #225 detailing a way to display such Icons inside SymbolLayer, the caveat being that this method works on iOS but not on Android as @arnaudambro tested https://github.com/react-native-mapbox-gl/maps/issues/225#issuecomment-573058350.

I have tried narrowing the issue down although I do not understand native components very well but I noticed iOS has this section in RCTMGLSymbolLayer.m

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wobjc-missing-super-calls"
- (void)insertReactSubview:(id<RCTComponent>)subview atIndex:(NSInteger)atIndex {
    [_reactSubviews insertObject:(UIView *)subview atIndex:(NSUInteger) atIndex];
}
#pragma clang diagnostic pop

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wobjc-missing-super-calls"
- (void)removeReactSubview:(id<RCTComponent>)subview {
    [_reactSubviews removeObject:(UIView *)subview];
}
#pragma clang diagnostic pop

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wobjc-missing-super-calls"
- (NSArray<id<RCTComponent>> *)reactSubviews {
    return nil;
}
#pragma clang diagnostic pop

Whereas RCTMGLSymbolLayerManager.java or RCTMGLSymbolLayer.java is missing any mention of children.

To Reproduce Code to reproduce is included here: https://github.com/react-native-mapbox-gl/maps/issues/225#issuecomment-573058350

Expected behavior Consistently render SymbolLayer children on both platforms.

Screenshots iOS iOS Android Android text missing

Versions (please complete the following information):

  • Platform: Android
  • Device: any
  • Emulator/ Simulator: no
  • OS: Android 9
  • react-native-mapbox-gl Version 7.2.0
  • React Native Version 0.61.5

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
AustinHuntcommented, Feb 24, 2021

Please re-open this issue. Android does not support symbol layer children?

2reactions
AppSpherecommented, Apr 9, 2020

As a Workaround I started using the Visibility property in Symbol Layer, I know this is a not a good solution but for now it worked for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SymbolLayer children don't render on Android #764 - GitHub
Describe the bug I am looking for a way to display custom Symbols (in this case a FontAwesome Icon from rn-vector-icons).
Read more >
Bountysource
SymbolLayer children don't render on Android.
Read more >
rnmapbox/Lobby - Gitter
next question, it looks like PointAnnotation renders under other layers ... was that it was that SymbolLayer does not render children views on...
Read more >
Android Studio Mapbox Layer Problem with both Symbol ...
The problem is when the two layers SymbolLayer and CircleLayer are applied at the same time they crash the mobile app, which does...
Read more >
Clustering point data in the Web SDK - Azure Maps
A bubble layer is a great way to render clustered points. ... on top of the bubble, use a symbol layer with text,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found