We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can we tap symbols added with SymbolLayer?
SymbolLayer
I have the source code below to show a symbol, but can't find how to make this tappable.
class _MapScreenState extends State<MapScreen> { final position = Position.named(lng: 24.9458, lat: 60.17180); MapboxMap? _mapboxMap; @override Widget build(BuildContext context) { return Scaffold( body: MapWidget( cameraOptions: CameraOptions(zoom: 3.0), styleUri: '[my_style_uri]', textureView: true, onMapCreated: (map) => _mapboxMap = map, onStyleLoadedListener: _onStyleLoadedCallback, ), ); } Future<void> _onStyleLoadedCallback(StyleLoadedEventData event) async { final point = Point(coordinates: position); await _mapboxMap?.style.addSource(GeoJsonSource( id: 'sourceId', data: json.encode(point), )); var modelLayer = SymbolLayer( id: 'layerId', sourceId: 'sourceId', iconImage: '[my_icon_name]', ); _mapboxMap?.style.addLayer(modelLayer); } }
This shows one icon on my map, but that's it.
Do we have any examples or docs for this? Thanks.
The text was updated successfully, but these errors were encountered:
What do you use a style layer with symbols for?
Atm i can only think of a PointAnnotation that can do this.
Future<PointAnnotationManager> createPointManager( MapboxMap controller, { required void Function(PointAnnotation) callback, }) async { final pointManager = await controller.annotations.createPointAnnotationManager(); pointManager.addOnPointAnnotationClickListener( AnnotationClickListener(callback: callback), ); return pointManager; }
Sorry, something went wrong.
No branches or pull requests
How can we tap symbols added with
SymbolLayer
?I have the source code below to show a symbol, but can't find how to make this tappable.
This shows one icon on my map, but that's it.
Do we have any examples or docs for this? Thanks.
The text was updated successfully, but these errors were encountered: