File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,9 @@ class CustomMap extends StatefulWidget {
21
21
22
22
class _CustomMapState extends State <CustomMap > {
23
23
LatLng _position = LatLng (45.172044 , 5.734129 );
24
+ final double _zoom = 13.0 ;
24
25
final PopupController _popupLayerController = PopupController ();
26
+ final MapController _mapController = MapController ();
25
27
List <Place > _places = < Place > [];
26
28
27
29
Future <String > _downloadPlaces () async {
@@ -144,6 +146,7 @@ class _CustomMapState extends State<CustomMap> {
144
146
currentPos.latitude,
145
147
currentPos.longitude
146
148
);
149
+ _mapController.move (_position, _zoom);
147
150
} on TimeoutException {
148
151
// nothing
149
152
} on PermissionDeniedException {
@@ -178,9 +181,10 @@ class _CustomMapState extends State<CustomMap> {
178
181
],
179
182
),
180
183
body: FlutterMap (
184
+ mapController: _mapController,
181
185
options: MapOptions (
182
186
center: _position,
183
- zoom: 13.0 ,
187
+ zoom: _zoom ,
184
188
),
185
189
children: [
186
190
TileLayerWidget (
You can’t perform that action at this time.
0 commit comments