【问题标题】:Add navigation button at bottomRight on marker tap Flutter Google Maps on ios在标记点击的右下角添加导航按钮 Flutter Google Maps on ios
【发布时间】:2023-04-04 18:55:01
【问题描述】:

我已经创建了一个颤振的 android 应用程序并且工作正常。我正在使用 google_maps_flutter 插件来显示带有标记的地图。在尝试将我的应用程序运行到 ios 之后,我遇到了一个奇怪的问题。它按我预期的那样运行,但右下角的导航工具栏没有像在 android 设备上那样显示。我只从这个问题中看到了如何禁用它:

Flutter Google Maps remove navigation button at bottomRight on marker tap

Marker(
       markerId: MarkerId('firstMarker'),
       draggable: false,
       icon: BitmapDescriptor.fromBytes(_markerIcon),
       infoWindow: InfoWindow(
          title: f.name,
          snippet: f.time,
          onTap: (){
          displayInfo(f, context);
          }
     ),
     position: LatLng(f.lat, f.lon));

这是由颤动引起的还是我必须对我的源代码进行一些更改?

【问题讨论】:

    标签: flutter google-maps-flutter


    【解决方案1】:

    对于 Android,您需要将 mapToolbarEnabled: true 添加为 GoogleMap 小部件的属性。

    例子:

    GoogleMap(
      mapToolbarEnabled: true,
      buildingsEnabled: true,
      mapType: MapType.normal,
      onMapCreated: (controller) {
        _initMap(controller);
      },
    );
    

    【讨论】:

    • // 如果在您与地图交互时地图应显示工具栏,则为真。 仅限安卓。 final bool mapToolbarEnabled;我还是有问题。 iOS 上未显示导航按钮。
    猜你喜欢
    • 2019-12-02
    • 1970-01-01
    • 1970-01-01
    • 2011-10-01
    • 2014-01-05
    • 1970-01-01
    • 1970-01-01
    • 2019-07-18
    • 1970-01-01
    相关资源
    最近更新 更多