mapbox / mapbox-gl-native

Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL
https://mapbox.com/mobile
Other
4.37k stars 1.33k forks source link

allow for transparent background on iOS #3038

Closed incanus closed 8 years ago

incanus commented 8 years ago

GLKView can have transparency, so we should see how tricky it is for an MGLMapView to do this also, if parts of the style (e.g. water) have transparency.

incanus commented 8 years ago

Proof of concept basic project: https://github.com/incanus/ClearGLKit

bleege commented 8 years ago

:+1:

1ec5 commented 8 years ago

Can't wait for MGLMapView to be backed by a UIVisualEffectView!

1ec5 commented 8 years ago

Setting the GLKView’s layer.opaque = NO was all that was required to make this work. Here’s an MGLMapView inside a vibrant+blurry UIVisualEffectView atop an AVPlayerLayer playing an MP4 movie:

UIVisualEffectView

(In Studio, I started with the Empty template, set the background layer’s opacity to 0, then added a translucent blue water layer.)

gpbl commented 8 years ago

Woah great! This is a really nice addition. Thanks!