I add my data to mapview using source and symbol layer
and I need each point to show callout onclick
but after I query the selected feature from map
I don't know how can I add Callout to it
View callouts are currently not supported with Symbol Layers yet
@nitaliano how do I create something like a callout using symbol layer? Do we have an example for that ?
I'm refactoring my app to use ShapeSource and SymbolLayer instead of PointAnnotation (+ Callout).
@josenaves @nitaliano I actually have the same question.
@nitaliano is there any way to have something like callouts when using symbol layer ? I know we could have get textField on style but I need some box with some callback actions on it.
@nitaliano, is it foreseeable when Callouts will be supported for symbol layers? Coolest would be custom views as Callouts of course! :)
@abegehr
You can add a callout to your symbol layer, it just is slightly hacky. After reviewing the different examples I merged a few to make it work!
PointAnnotation for the features you want to click. Make it invisible with view styles, and dont accept presses on the annotation itself (like to open / close a Callout).MapLayer component (or the symbol layer you want).map.queryRenderedFeaturesAtPointselected prop is set to true on PointAnnotation when the state id that was set matches a PointAnnotationIf that was hard to follow I can try and post a code example
@jruddell I suppose it easier to make callout from PointAnnotation )
<PointAnnotation>
<View style={styles.callout}> </View>
</PointAnnotation>
Most helpful comment
@nitaliano how do I create something like a callout using symbol layer? Do we have an example for that ?
I'm refactoring my app to use ShapeSource and SymbolLayer instead of PointAnnotation (+ Callout).