Welcome to the Flutter feedback portal. We’re happy you’re here! If you have feedback on how to improve the Flutter, we’d love to hear it!

  • Check out the features or bugs others have reported and vote on your favorites. Feedback will be prioritized based on popularity.
  • If you have feedback that’s not listed yet, submit your own.

Thanks for joining our community and helping improve Syncfusion products!

1
Vote

When I add a map like this:

child: SfMaps(layers: [MapTileLayer(urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png')])

it is possible to pan or zoom the map to such position that one of its corners is in the middle of the screen, 

or to get a small map with background around it initially –
 see screenshots 1 and 2 (

First thing, I do not want the background to appear like this on the screen at all, I think that map should always cover all visible area of the parent widget – this is the expected behavior in most cases.

Furthermore, why limit visible longitude by min=-180 and max=+180 only? There must be an option of "cycle" the map and display it continuously by longitude, e.g. like flutter_map does (see

What is important in the "continuous" mode – display sublayers "cyclicly" as well, i.e. if there is a polygon over Africa, it must be displayed over all "copies" of Africas on the screen.

Regarding the first problem (map not covering all the viewport initially as well as on zoom/pan) – I tried to use onWillPan and onWillZoom callbacks like this:

bool _canPanZoom(MapLatLngBounds? previousVisibleBounds,
      MapLatLngBounds? newVisibleBounds) =>
  (newVisibleBounds?.northeast.longitude ?? 0) !=
      (previousVisibleBounds?.northeast.longitude ?? 0) &&
  (newVisibleBounds?.northeast.longitude ?? 0) < 179 &&
  (newVisibleBounds?.southwest.longitude ?? 0) !=
      (previousVisibleBounds?.southwest.longitude ?? 0) &&
  (newVisibleBounds?.southwest.longitude ?? 0) > -179 &&
  (newVisibleBounds?.northeast.latitude ?? 0) !=
      (previousVisibleBounds?.northeast.latitude ?? 0) &&
  (newVisibleBounds?.northeast.latitude ?? 0) < 84 &&
  (newVisibleBounds?.southwest.latitude ?? 0) !=
      (previousVisibleBounds?.southwest.latitude ?? 0) &&
  (newVisibleBounds?.southwest.latitude ?? 0) > -84;
...
  onWillPan: (details) => _canPanZoom(
      details.previousVisibleBounds, details.newVisibleBounds),
  onWillZoom: (details) => _canPanZoom(
      details.previousVisibleBounds, details.newVisibleBounds),
...

But this causes a kind of glitchy/twitching behavior. Additionally with these handlers it becomes impossible, e.g. to zoom out when one if the edges of the map is at ±84 / ±179 – the zoom is blocked by onWillZoom callback. The wanted behavior in this case is to let the zoom happen, but with simultaneous panning, i.e. the respective edge of the map should stay at its "edge" value (±84 / ±179) while zoom is increasing or decreasing. I found no way to implement this logic using existing callbacks!

So I think all the logic described above should be implemented in SfMaps / MapTileLayer / MapZoomPanBehavior components as standard options. Namely:

  1. Option to constrain the map to always fill all the visible area, no background in the visible area.

  2. Let the map be displayed "cyclicly" by longitude (see flutter_map screenshot above), and panning left-and-right without any limitations.

In short, this is how Google Maps work – I think it is a good example of proper world map behavior. Just implement the options to let the developers mimic Google Maps behavior, and syncfusion_flutter_maps will become the best map solution for Flutter! (it is good already, but flutter_map is still better in some use cases.)


P.S. I created 

https://github.com/syncfusion/flutter-widgets/issues/1494 on Nov 1, but since there was no response, I decided to create this feedback.