我正处于尝试在最近创建的Flutter应用中显示地图的开始阶段。问题是,我只得到一个空白屏幕,而不是使用MapBox.com上的内置Studio工具创建的地图。
我尝试为我正在工作的项目在iOS文件夹中修改'Info.plist',
class _HomePageState extends State<HomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: new AppBar(
centerTitle: true,
title: new Text("Orlando"),
actions: <Widget>[
IconButton(
icon: Icon(FontAwesomeIcons.mapMarkerAlt), onPressed: () {}),
],
),
body: new FlutterMap(
options: new MapOptions(
center: new LatLng(51.5, -0.09),
zoom: 13.0,
),
layers: [
new TileLayerOptions(
urlTemplate:
"mapbox://styles/carlosblancorocks/cjzk2tc9i5hqd1cpi5oz5gg5y",
additionalOptions: {
'accessToken':
'pk.eyJ1IjoiY2FybG9zYmxhbmNvcm9ja3MiLCJhIjoiY2p6azhsYmFkMDAyYTNncWlwZXo4ZWJ1cyJ9.ZD6ww-uwtXAM13ZCgRTqZw',
'id': 'mapbox.mapbox-streets-v8',
},
),
new MarkerLayerOptions(
markers: [
new Marker(
width: 80.0,
height: 80.0,
point: new LatLng(51.5, -0.09),
builder: (ctx) => new Container(
child: IconButton(
icon: Icon(Icons.location_on),
color: Colors.red,
iconSize: 45.0,
onPressed: () {
print('yeahaa');
},
),
),
),
],
),
],
),
);
}
}