• An MGLLight object represents the light source for extruded geometries in MGLStyle.

    Example

    let light = MGLLight()
    let position = MGLSphericalPosition(radial: 5, azimuthal: 180, polar: 80)
    light.position = NSExpression(forConstantValue: NSValue(mglSphericalPosition: position))
    light.anchor = NSExpression(forConstantValue: "map")
    mapView.style?.light = light
    

    See the Adjust light of 3D buildings to learn how to create and modify the light source for 3D geometries.

    See more

    Declaration

    Objective-C

    
    @interface MGLLight : NSObject

    Swift

    class MGLLight : NSObject