Flutter_map get geographical extent on screen

453 views Asked by At

I use flutter_map to import openstreetmap tiles, I would like to know if it is possible to retrieve the geographical extent of what is displayed on the screen?

1

There are 1 answers

0
Chris On

You could maybe use the bounds of the mapController in onPositionChanged:

FlutterMap(
    mapController: _mapController,
    options: MapOptions(
        center: _currentLocation,
        zoom: 10,
        onPositionChanged: (position, e) {
            var extent = _mapController.bounds; // <= this line here
        }),
        layers: [], 
),