MGLRasterStyleLayer
@interface MGLRasterStyleLayer : MGLForegroundStyleLayer
An MGLRasterStyleLayer
is a style layer that renders raster tiles on the map.
Use a raster style layer to configure the color parameters of raster tiles
loaded by an MGLRasterSource
object. For example, you could use a raster
style layer to render Mapbox
Satellite imagery, a raster tile
set uploaded to Mapbox Studio, or a raster map authored in TileMill, the classic
Mapbox Editor, or Mapbox Studio Classic.
You can access an existing raster style layer using the
-[MGLStyle layerWithIdentifier:]
method if you know its identifier;
otherwise, find it using the MGLStyle.layers
property. You can also create a
new raster style layer and add it to the style using a method such as
-[MGLStyle addLayer:]
.
Example
let layer = MGLRasterStyleLayer(identifier: clouds
, source: source)
layer.rasterOpacity = MGLStyleValue(rawValue: 0.5)
mapView.style?.addLayer(layer)
-
Increase or reduce the brightness of the image. The value is the maximum brightness.
The default value of this property is an
MGLStyleValue
object containing anNSNumber
object containing the float1
. Set this property tonil
to reset it to the default value.This attribute corresponds to the
raster-brightness-max
layout property in the Mapbox Style Specification.You can set this property to an instance of:
MGLStyleConstantValue
MGLCameraStyleFunction
with an interpolation mode of:MGLInterpolationModeExponential
MGLInterpolationModeInterval
Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *maximumRasterBrightness;
Swift
var maximumRasterBrightness: MGLStyleValue
-
Increase or reduce the brightness of the image. The value is the minimum brightness.
The default value of this property is an
MGLStyleValue
object containing anNSNumber
object containing the float0
. Set this property tonil
to reset it to the default value.This attribute corresponds to the
raster-brightness-min
layout property in the Mapbox Style Specification.You can set this property to an instance of:
MGLStyleConstantValue
MGLCameraStyleFunction
with an interpolation mode of:MGLInterpolationModeExponential
MGLInterpolationModeInterval
Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *minimumRasterBrightness;
Swift
var minimumRasterBrightness: MGLStyleValue
-
Increase or reduce the contrast of the image.
The default value of this property is an
MGLStyleValue
object containing anNSNumber
object containing the float0
. Set this property tonil
to reset it to the default value.You can set this property to an instance of:
MGLStyleConstantValue
MGLCameraStyleFunction
with an interpolation mode of:MGLInterpolationModeExponential
MGLInterpolationModeInterval
Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *rasterContrast;
Swift
var rasterContrast: MGLStyleValue
-
Fade duration when a new tile is added.
This property is measured in milliseconds.
The default value of this property is an
MGLStyleValue
object containing anNSNumber
object containing the float300
. Set this property tonil
to reset it to the default value.You can set this property to an instance of:
MGLStyleConstantValue
MGLCameraStyleFunction
with an interpolation mode of:MGLInterpolationModeExponential
MGLInterpolationModeInterval
Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *rasterFadeDuration;
Swift
var rasterFadeDuration: MGLStyleValue
-
Rotates hues around the color wheel.
This property is measured in degrees.
The default value of this property is an
MGLStyleValue
object containing anNSNumber
object containing the float0
. Set this property tonil
to reset it to the default value.This attribute corresponds to the
raster-hue-rotate
layout property in the Mapbox Style Specification.You can set this property to an instance of:
MGLStyleConstantValue
MGLCameraStyleFunction
with an interpolation mode of:MGLInterpolationModeExponential
MGLInterpolationModeInterval
Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *rasterHueRotation;
Swift
var rasterHueRotation: MGLStyleValue
-
The opacity at which the image will be drawn.
The default value of this property is an
MGLStyleValue
object containing anNSNumber
object containing the float1
. Set this property tonil
to reset it to the default value.You can set this property to an instance of:
MGLStyleConstantValue
MGLCameraStyleFunction
with an interpolation mode of:MGLInterpolationModeExponential
MGLInterpolationModeInterval
Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *rasterOpacity;
Swift
var rasterOpacity: MGLStyleValue
-
Increase or reduce the saturation of the image.
The default value of this property is an
MGLStyleValue
object containing anNSNumber
object containing the float0
. Set this property tonil
to reset it to the default value.You can set this property to an instance of:
MGLStyleConstantValue
MGLCameraStyleFunction
with an interpolation mode of:MGLInterpolationModeExponential
MGLInterpolationModeInterval
Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *rasterSaturation;
Swift
var rasterSaturation: MGLStyleValue