-
Notifications
You must be signed in to change notification settings - Fork 1k
Support dark mode #1804
Comments
There is a way to invert the tile colors, probably the best we can do.
…On Tue, May 17, 2022, 7:56 AM Igor Bubelov ***@***.***> wrote:
Not sure if it's even technically possible but it would be nice to have a
built-in dark mode support
—
Reply to this email directly, view it on GitHub
<#1804>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAPCIGOIHUJR5NLK36SWFPTVKOCOJANCNFSM5WEVJN2Q>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
@spyhunter99 I'm not deeply familiar with the internals, but is it possible to do it via a special "dark" tile provider? Not sure if it exists though |
Might be related: openstreetmap/openstreetmap-website#2332 Looks like OSM website maintainers can't agree on how to implement it and they are also blocked by Bootstrap (for non-map components styling) |
I'm using this in Android application, when system is in dark mode:
For light mode in system:
|
@henrichg I ended up doing the same thing, based on the sample app: val nightMode =
resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK
if (nightMode == Configuration.UI_MODE_NIGHT_YES) {
overlayManager.tilesOverlay.apply {
setColorFilter(TilesOverlay.INVERT_COLORS)
loadingBackgroundColor = android.R.color.black
loadingLineColor = Color.argb(255, 0, 255, 0)
}
} It works pretty well and it seem to be the recommended pattern so I'm wondering maybe it makes sense for osmdroid to do it automatically when it detects dark mode? It would be consistent with other widgets which tend to work out of the box. The ocean looks a bit odd though: And here is how Google Maps shows it: |
@bubelov yes, this also my own solution. |
google solves this problem, along with other tools like mapsforge, mapbox, etc by changing the way the map tiles are rendered. osmdroid only displays prerendered map tiles, we don't render the tiles on device. Beyond inverting the colors, the only other thing i can suggest is try finding a different tile source that has a night mode. Nothing else we can do, unless someone wants to add support for geotile json format and render on device. |
Not sure if it's even technically possible but it would be nice to have a built-in dark mode support
The text was updated successfully, but these errors were encountered: