MGLCircleStyleLayer
@interface MGLCircleStyleLayer : MGLVectorStyleLayer
An MGLCircleStyleLayer is a style layer that renders one or more filled
circles on the map.
Use a circle style layer to configure the visual appearance of point or point
collection features in vector tiles loaded by an MGLVectorSource object or
MGLPointAnnotation, MGLPointFeature, MGLPointCollection, or
MGLPointCollectionFeature instances in an MGLShapeSource object.
A circle style layer renders circles whose radii are measured in screen units.
To display circles on the map whose radii correspond to real-world distances,
use many-sided regular polygons and configure their appearance using an
MGLFillStyleLayer object.
You can access an existing circle 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 circle style layer and add it to the style using a method such as
-[MGLStyle addLayer:].
Example
let layer = MGLCircleStyleLayer(identifier: circles
, source: population)
layer.sourceLayerIdentifier = population
layer.circleColor = MGLStyleValue(rawValue: .green)
layer.circleRadius = MGLStyleValue(interpolationBase: 1.75, stops: [
12: MGLStyleValue(rawValue: 2),
22: MGLStyleValue(rawValue: 180)
])
layer.circleOpacity = MGLStyleValue(rawValue: 0.7)
layer.predicate = NSPredicate(format: %K == %@
, marital-status
, married
)
mapView.style?.addLayer(layer)
-
Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.
The default value of this property is an
MGLStyleValueobject containing anNSNumberobject containing the float0. Set this property tonilto reset it to the default value.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *circleBlur;Swift
var circleBlur: MGLStyleValue -
The fill color of the circle.
The default value of this property is an
MGLStyleValueobject containingNSColor.blackColor. Set this property tonilto reset it to the default value.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSColor *> *circleColor;Swift
var circleColor: MGLStyleValue -
The opacity at which the circle will be drawn.
The default value of this property is an
MGLStyleValueobject containing anNSNumberobject containing the float1. Set this property tonilto reset it to the default value.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *circleOpacity;Swift
var circleOpacity: MGLStyleValue -
Circle radius.
This property is measured in points.
The default value of this property is an
MGLStyleValueobject containing anNSNumberobject containing the float5. Set this property tonilto reset it to the default value.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSNumber *> *circleRadius;Swift
var circleRadius: MGLStyleValue -
Controls the scaling behavior of the circle when the map is pitched.
The default value of this property is an
MGLStyleValueobject containing anNSValueobject containingMGLCircleScaleAlignmentMap. Set this property tonilto reset it to the default value.This attribute corresponds to the
circle-pitch-scalelayout property in the Mapbox Style Specification.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSValue *> *circleScaleAlignment;Swift
var circleScaleAlignment: MGLStyleValue -
The geometry’s offset.
This property is measured in points.
The default value of this property is an
MGLStyleValueobject containing anNSValueobject containing aCGVectorstruct set to 0 points rightward and 0 points upward. Set this property tonilto reset it to the default value.This attribute corresponds to the
circle-translatelayout property in the Mapbox Style Specification.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSValue *> *circleTranslation;Swift
var circleTranslation: MGLStyleValue -
Controls the translation reference point.
The default value of this property is an
MGLStyleValueobject containing anNSValueobject containingMGLCircleTranslationAnchorMap. Set this property tonilto reset it to the default value.This property is only applied to the style if
circleTranslationis non-nil. Otherwise, it is ignored.This attribute corresponds to the
circle-translate-anchorlayout property in the Mapbox Style Specification.Declaration
Objective-C
@property (assign, readwrite, nonatomic, null_resettable) MGLStyleValue<NSValue *> *circleTranslationAnchor;Swift
var circleTranslationAnchor: MGLStyleValue
Install in Dash
MGLCircleStyleLayer Class Reference