showMyLocation method

Future<void> showMyLocation (bool show)

是否显示我的位置

Implementation

Future<void> showMyLocation(bool show) async {
  return platform(
    android: (pool) async {
      final map = await androidController.getMap();
      final locationStyle = await ObjectFactory_Android
          .createcom_amap_api_maps_model_MyLocationStyle__();
      await locationStyle?.showMyLocation(show);
      await map.setMyLocationStyle(locationStyle);
      await map.setMyLocationEnabled(show);

      pool..add(map)..add(locationStyle);
    },
    ios: (pool) async {
      await iosController.set_showsUserLocation(show);

      if (show) {
        await iosController.setUserTrackingModeAnimated(
            MAUserTrackingMode.MAUserTrackingModeFollow, true);
      }
    },
  );
}