-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Sky and ground need distinct background colors #2190
Comments
Do you see this happening at the platform level @1ec5? Like, could this just be a subview of the |
The GLKView draws inside its entire bounds, doesn’t it? |
Yes, but we might be able to make part of it transparent? Not sure. |
Shouldn't this be styleable, e.g. night vs daytime maps |
A common workaround seen in navigation applications is to fake the presence of a sky by overlaying a view with a linear gradient from opaque blue at the top to clear at the bottom. However, the effect is artificial at best, because it violates the user’s sense of horizon. Another workaround, more common in games, is to simulate poor visibility with a fog effect. It’s basically the same as the previous workaround, except using opaque gray and a steeper gradient. Neither of these workarounds will work once we have 3D extrusion (#6745), because the extruded geometries will be truncated at the simulated horizon. As @incanus indicated in #2190 (comment), it may be possible to make MGLMapView’s layer non-opaque, taking advantage of #3096, then place a view with the desired background color behind the MGLMapView. However, this would have to happen on a per-application basis, because styles themselves can have transparent backgrounds for other reasons. |
|
No, that won’t work, because – as I originally described above – the sky and ground are rendered using the same background style layer. If you make the background style layer transparent and slide a blue view beneath the map view, the ground becomes blue too. |
Any update on this? |
@mdakram nope, we haven't fixed the things blocking us from allowing the map to be pitched far enough to have the sky show (level-of-detail loading, antialiasing issues, etc). |
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions. |
Dependent on mapbox/mapbox-gl-js#8975. |
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions. |
Is this still an issue? I tried adding a sky layer, which seems like the general type of thing for this, but I get the following error:
but it returns the error
I can set a background color just fine before my raster map tiles, but this does not affect the area of the screen "off the map". Using with Qt 5.15. I just want to set the color of the background past the map when you pitch up/see past the horizon. |
The perspective view being added in #2116 and #2159 will constrain the pitch to 90° (at least at the mbgl level). MGLMapView currently constrains it further to 60° to avoid showing the horizon, but we’d like to use a limit that varies by zoom level (altitude) for consistency with MapKit. At the lowest altitude, about 7 stories up, MapKit shows an idyllic blue sky:
By contrast, Mapbox GL uses the background color, which for most maps will be similar to the ground color. It should be possible to style a second background color that represents the “room in which the map is floating”, so to speak.
/ref #119, #1210
/cc @ansis @incanus
The text was updated successfully, but these errors were encountered: