-
-
Notifications
You must be signed in to change notification settings - Fork 860
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dark / Night Mode support #731
Comments
@mat8854 thanks for your response and for provided information 👍 . I'm using standard OSM tiles
which don't support different styles(at least I didn't find anything in docs) and unfortunately I can't use your commit as dependency, because I have other dependencies (map plugins) and it results in errors during build. The only solution, I guess, is to wait until it's merged to master. Thank you anyway. |
If you are using MapBox as tile source you can create a second style with dark coloured map and then in your flutter app you can easilly switch between the two styles using the urlTemplate property of TileLayerOptions(). I implemented mine using Provider. |
Two ways to implement dark mode / custom map styles are either using paid raster tile provider which perhaps offers style you like or set up your own tile server. About the former way you can read on switch2osm. Zoom 10 of high resolution tiles is about 2 GB, zoom 11 is about 20 GB of data (w/o png comperssion) so if your use case is okay with such zoom levels you can maybe live without a powerful dedicated server to serve your map on demand and simply generate raster tiles locally and load them as static assets to any hosting with sufficient disk space. Note to keep in mind is that OpenStreetMap.org doesn't allow you to distribute an app which use their resources heavily - OSM TOS. Although you can download their tiles up to zoom 12 using some batch download tools but you will lose custom styling and high resolution. You can also make the default OSM style dark by applying hue rotation to value about 180-200 degrees and inverting colors. Both easily achievable in flutter. Vector Maps are not a solution if you want to have high information density such OSM by default has. Transferring over the network and rendering on client's device this amount of raw data is an overkill. Read more about it here. |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
This issue was closed because it has been stalled for 5 days with no activity. |
|
Add option for dark/night colors for the map.
The text was updated successfully, but these errors were encountered: