Using OpenStreetMap (direct)
This does not apply to users using OpenStreetMap data through other tile servers, only to users using the public OpenStreetMap tile servers directly.
On non-web platforms, the inadequately identified requests to the public OpenStreetMap tile servers are blocked
Due to excessive usage, requests where the 'User-Agent' header is inadequately set have been blocked by the OpenStreetMap Foundation (who operate the tile servers).
The UA can be set through the TileLayer.userAgentPackageName argument (or manually). If this is either:
not specified, or
set to a generic string (such as the example seen throughout our documentation),
then requests will return a blocked tile.
This does not apply to the web, where the UA cannot be set differently to what is provided by the browser.
To restore access, follow What should I do?.
flutter_map wants to help keep map data available for everyone. One of the largest sources of this data is OpenStreetMap. OpenStreetMap data powers the majority of non-proprietary maps - from actual map tiles/images to navigation data - in existence today. The data itself is free for everyone under the ODbL.
The OpenStreetMap Foundation run OpenStreetMap as a not-for-profit. They also provide a public tile server at https://tile.openstreetmap.org, which is run on donations and volunteering time. This server is used throughout this documentation for code examples, and in our demo app, and is available at the following template URL:
https://tile.openstreetmap.org/{z}/{x}/{y}.pngThe OpenStreetMap public tile server is NOT free to use by everyone
flutter_map can be setup to conform to these requirements - but it may not conform by default.
It is your own responsibility to comply with any appropriate restrictions and requirements set by your chosen tile server/provider. Always read their Terms of Service. Failure to do so may lead to any punishment, at the tile server's discretion.
The OpenStreetMap public tile server is without cost (for users), but, "without cost" β "without restriction" β "open".
Why has unidentified traffic been blocked?
Data collected by OSM on 2025/06/09 shows flutter_map as the largest single user-agent in terms of the average number of tile requests made per second over the day. Whilst it is true that there are multiple user agents smaller who make up an overall much larger portion of total usage - for example, leaflet.js's usage is split across the browsers' user-agents, as is flutter_map usage on the web - the usage of flutter_map cannot be ignored.
The top 7 user-agents are shown below, in order (with traffic rounded to the nearest whole tile). ('Missed' tiles are those which required fresh rendering, and are more expensive than most other requests.)
flutter_map (*) This represents the majority of FM users on non-web platforms.
1610
53
Mozilla/5.0 QGIS/*
1155
358
Mozilla/5.0 ...
476
33
com.facebook.katana
263
3
Dart/* (dart:io) This represents FM users on older versions (not on web) & other Flutter mapping libraries not using FM (not on web).
182
17
Mozilla/5.0 ...
175
6
Mozilla/5.0 ...
171
14
And looking in more detail at the User-Agent's making up the primary 'flutter_map (*)' agent, on 2025/05/28:
flutter_map (unknown)
This represents users failing to use TileLayer.userAgentPackageName.
99,258,371
flutter_map (com.example.app) This is likely a combination of users copy-pasting from the docs & personal projects.
7,808,777
flutter_map (dev.fleaflet.flutter_map.example) This is likely a combination of users using the Demo app (primarily), and users copy-pasting from the example app.
6,402,576
Next largest User-Agent is an adequately identified app
3,953,312
We are extremely proud to see flutter_map being used so much! At the same time, we are aware that there are many users placing a potential strain on OpenStreetMap, which needs to be minimised.
What should I do?
Consider switching tile servers
Our docs list multiple alternatives, many of which have free tiers suitable for hobbyists, affordable pricing for commercial usage, and one which is extremely flexible.
Most of these are built off the same OpenStreetMap data, so the actual information contained within the map won't change (although a change in style may not show some data).
If you're a commercial user and want the best balance of flexibility and affordability, consider setting up your own private tile server, based on the OpenStreetMap data! In any case, the OpenStreetMap tile server doesn't offer uptime guarantees, which may be important to your business.
If you're sticking with OpenStreetMap's server, consider preparing a backup.
Read the OpenStreetMap Tile Usage Policy
If you still want to use OpenStreetMap, you must read the policy and comply with its restrictions and requirements. It also contains some background info as to why this is important.
To note two important general terms:
Should any users or patterns of usage nevertheless cause problems to the service, access may still be blocked without prior notice.
This policy may change at any time subject to the needs and constraints of the project. Commercial services, or those that seek donations, should be especially aware that access may be withdrawn at any point: you may no longer be able to serve your paying customers if access is withdrawn.
Also note all the other requirements, which may require you to make adjustments to your project...
Make all necessary adjustments
Check the OSM policy for all the adjustments you might need to make. Here's some common ones:
Enable conforming caching
v8.2.0 introduces automatically enabled Caching! This is designed to meet the caching requirements of the usage policy. Upgrade to v8.2.0 to enable this functionality.
There's also other options to implement caching or offline mapping to meet the requirements, and go beyond the capabilities of the built-in caching.
Add sufficient attribution
The
RichAttributionWidgetorSimpleAttributionWidgetcan both be used to setup attribution which looks great, is unintrusive, and is conforming - provided you add the necessary sources. See Attribution Layer for more info and a simple code snippet you can add to meet the attribution requirement.You can also add attribution in any other way that meets the requirements.
Set a more specific user-agent to identify your client
You should set
TileLayer.userAgentPackageName: see the Recommended Setup for theTileLayer. This is not necessary when running solely on the web, where it is not possible to set a User-Agent manually.
Last updated
Was this helpful?
