Frequently Asked Questions

We get quite a lot of similar questions, so please check if your question is here before you ask!

pageHow Does It Work?
How can I use a custom map style? How can I prevent POI/labels rotating when the map rotates? How can I remove certain POI/labels from the map?

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.

  • Your last option is to serve tiles yourself. See Other Options.

How can I route a user between two locations? Why does the Polyline only go in a straight line between two points?
How can I add a 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.

Why does the map disappear/go grey when I zoom in far?

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

Last updated

© flutter_map Authors & Maintainers