Search code examples
swiftmapbox-ios

How to add a fog layer in Mapbox for iOS


I am trying to add a fog layer in my iOS app using Mapbox SDK, however so far without success. I would like to use this to achieve the effect of partially hiding distant map content to achieve a better 3D effect at camera pitch 90. Adding the sky layer was simple enough, but cannot see how to add a fog layer.

Thanks.


Solution

  • to achieve this you can take a look at Atmosphere

    var atmosphere = Atmosphere()
    // code to configure Atmosphere here
    try mapView.mapboxMap.style.setAtmosphere(atmosphere)
    

    3D Terrain with fog