Unbounded Horizontal Scrolling
Last updated
Was this helpful?
Last updated
Was this helpful?
Since v8 & v8.2.0, flutter_map supports unbounded horizontal (longitudinally) scrolling for the default map projection. This means users can keep scrolling left and right (when North is up) and never hit an edge! Feature layers, such as the PolygonLayer
, can also take advantage of this functionality.
Within the codebase, unbounded horizontal scrolling is referred to as replicatesWorldLongitude
, and is set on the CRS/projection level.
The default projection, Epsg3857
, enables the functionality by default.
It's now possible to remove the grey edges that appear at the top and bottom of the map when zoomed far out.
To do this, set the MapOptions.cameraConstraint
parameter:
Each square of map that is repeated longitudinally is referred to as a "world". By default, the feature layers (for example, PolygonLayer
, PolylineLayer
, CircleLayer
, and MarkerLayer
) will repeat their features across the layers, so that each world looks identical.
In the PolylineLayer
& PolygonLayer
, this can be disabled by setting the drawInSingleWorld
property.
drawInSingleWorld: false
(default)drawInSingleWorld: true