Flutter 使用mapbox插件将自定义标记添加到Flatter中的地图
为了给我的应用程序提供更好的用户界面,我需要显示一张带有用户名的小卡片和一个带有用户图片或头像的小圆圈Flutter 使用mapbox插件将自定义标记添加到Flatter中的地图,flutter,mapbox,mapbox-gl,Flutter,Mapbox,Mapbox Gl,为了给我的应用程序提供更好的用户界面,我需要显示一张带有用户名的小卡片和一个带有用户图片或头像的小圆圈 使用Flatter mapbox gl插件有什么方法可以做到这一点吗?最好的解决方案是在mapbox gl软件包示例文件夹中: 这里是你能做的小例子 Widget build(BuildContext context) { mapController.addSymbol( SymbolOptions( geometry: LatLng(-33.86711, 151.1947
使用Flatter mapbox gl插件有什么方法可以做到这一点吗?最好的解决方案是在mapbox gl软件包示例文件夹中: 这里是你能做的小例子
Widget build(BuildContext context) {
mapController.addSymbol(
SymbolOptions(
geometry: LatLng(-33.86711, 151.1947171),
iconImage: "assets/images/ur_image.png",
),
);
return Scaffold(
body: Center(
child: SizedBox(
width: double.infinity,
height: 300.0,
child: MapboxMap(
styleString: themeControl.themeSet.mapStyle,
onMapCreated: _onMapCreated,
onStyleLoadedCallback: _onStyleLoaded,
zoomGesturesEnabled: _zoomGesturesEnabled,
myLocationEnabled: _myLocationEnabled,
initialCameraPosition: const CameraPosition(
target: LatLng(-33.852, 151.211),
zoom: 11.0,
),
),
),
),
);}