clearMarkers method

Future<void> clearMarkers()

清除所有marker

Implementation

Future<void> clearMarkers() async {
  return platform(
    android: (pool) async {
      final map = await _androidController.getMap();
      final markers = await map.getMapScreenMarkers();

      for (final marker in markers) {
        marker.remove();
      }

      pool
        ..add(map)
        ..addAll(markers);
    },
    ios: (pool) async {
      final markers = await _iosController.get_annotations();
      await _iosController.removeAnnotations(markers);

      pool..addAll(markers as List<Ref>);
    },
  );
}