Frequently Asked Questions
Last updated
Last updated
© flutter_map Authors & Maintainers
We get quite a lot of similar questions, so please check if your question is here before you ask!
Unfortunately, this library cannot provide this functionality. It has no control over the tiles displayed in the TileLayer
. This is a limitation of the technology, not this library.
This is because raster tiles are just images generated by a 3rd party tile server (dictated by your URL template), and therefore cannot be changed by the library that displays the tiles. Filters can be applied to the entire tile, such as an emulated dark mode, but these effects do not look great.
However, tilesets can be styled. This is the most effective way of using custom styles. These methods may help you with this:
You may wish to use a commercial service like Mapbox Studio, which allows you to style multiple tilesets. See Using Mapbox.
Alternatively, you can experiment with vector tiles. These are not pre-rendered, and so allow any style you desire to be applied on the fly. See .
Your last option is to serve tiles yourself. See Other Options.
Polyline
only go in a straight line between two points?See .
Marker
where the user's location is?
How can I center the map on the user's location?This is beyond the scope of flutter_map. However, you can use the community maintained plugin 'flutter_map_location_marker' to do this.
Alternatively, use the 'location' and 'compass' packages to generate a stream of the user's location and heading, and feed that to a Marker
using a StreamBuilder
.
This is a limitation of the chosen tile server: it cannot provide tiles at any higher zoom level, so the map just disappears as the requests for tiles get 404 Not Found responses.
To resolve this, there's 3 options:
Find a tile server with a higher maximum zoom level 22 is the highest that most will provide, including Mapbox
Set the maxNativeZoom
property of the TileLayer
This will scale the last set of tiles instead of requesting new ones, which has the side effect of making them blurry as their pixels are enlarged
Set the maxZoom
property of the MapOptions
This will prevent the user from zooming any further in