How to disable map rotation
DeltaFox0018 opened this issue · comments
Hi,
I am using SuperclusterLayer.mutable
this is the complete widget code:
width: MediaQuery.of(context).size.width * 0.8,
height: MediaQuery.of(context).size.height * 0.7,
child: FlutterMap(
options: MapOptions(
center: position,
zoom: 6,
maxZoom: 15,
rotationThreshold: 0,
rotation: 0,
pinchMoveWinGestures: MultiFingerGesture.pinchMove,
pinchZoomWinGestures: MultiFingerGesture.pinchZoom,
rotationWinGestures: MultiFingerGesture.none,
),
children: [
TileLayer(
urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
keepBuffer: 5,
),
SuperclusterLayer.mutable(
initialMarkers: markers,
indexBuilder: IndexBuilders.rootIsolate,
builder: (context, position, markerCount, extraClusterData) => Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20.0),
color: Colors.blue,
),
child: Center(
child: Text(
markerCount.toString(),
style: const TextStyle(color: Colors.white),
),
),
),
),
],
),
But I can't turn off rotation when using the map from phone
How should I do it?
Best Regards
i use this in MapOptions
interactiveFlags: InteractiveFlag.all & ~InteractiveFlag.rotate,