import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:latlong2/latlong.dart';
class Testing extends StatefulWidget {
@override
State<Testing> createState() => _TestingState();
}
class _TestingState extends State<Testing> {
final mapController = MapController();
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Test'),
),
body: Stack(
children: [
FlutterMap(
options: const MapOptions(
initialCenter: LatLng(0, 0),
initialZoom: 8,
minZoom: 0,
maxZoom: 19,
),
mapController: mapController,
children: [
TileLayer(
urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
userAgentPackageName: 'test',
maxZoom: 19,
),
const CircleLayer(
circles: [CircleMarker(point: LatLng(0, 0), radius: 100)],
),
],
),
Align(
child: Transform.translate(
offset: const Offset(0, 100),
child: const FlutterLogo(),
),
),
Positioned(
right: 20,
bottom: 20,
child: FloatingActionButton(
onPressed: () {
setState(() {
mapController.rotateAroundPoint(
(mapController.camera.rotation + 90) % 360,
offset: const Offset(0, 100),
);
});
},
child: const Icon(
Icons.rotate_right,
color: Colors.white,
),
),
),
],
),
);
}
}
What is the bug?
In v8, mapController.rotateAroundPoint only work if the map is having rotation = 0 before this opperation.
Originally posted by @tlserver in #1996 (comment)
How can we reproduce it?
MRE
In this code, it:
(0,100):Reproduce step:
Do you have a potential solution?
No response