flutterfluttermap

Disabling flutter_map package rotation in Flutter


How do you disable the rotation of the map in flutter_map?


Solution

  • As written by @pskink the answer is to use the InteractiveFlag provided by flutter_map in such a way

    MapOptions(
        minZoom: 11.0,
        maxZoom: 17.0,
        center: LatLng(lat, lng),
        interactionOptions: const InteractionOptions(
            flags: InteractiveFlag.pinchZoom | InteractiveFlag.drag),
        zoom: 13.0,
      ),
    

    By doing this, you can ensure that only pinchZoom and drag actions are allowed in your map.