SCH kiman
SCH kiman

Reputation: 33

Flutter_map get geographical extent on screen

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?

Upvotes: 0

Views: 483

Answers (1)

Chris
Chris

Reputation: 4396

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: [], 
),

Upvotes: 0

Related Questions