MLNStyle class

The proxy object for the current map style.

MLNStyle provides a set of convenience methods for changing default styles included with MapLibre.

It is also possible to directly manipulate the current map style via MLNMapView/style by updating the style's data sources or layers.

Note: Wait until the map style has finished loading before modifying a map's style via any of the MLNStyle instance methods below. You can use the MLNMapViewDelegate/mapView:didFinishLoadingStyle: or MLNMapViewDelegate/mapViewDidFinishLoadingMap: methods as indicators that it's safe to modify the map's style.

Constructors

MLNStyle()
Returns a new instance of MLNStyle constructed with the default new method.
factory
MLNStyle.castFrom(ObjCObjectBase other)
Constructs a MLNStyle that points to the same underlying object as other.
MLNStyle.castFromPointer(Pointer<ObjCObject> other, {bool retain = false, bool release = false})
Constructs a MLNStyle that wraps the given raw object pointer.

Properties

debugDescription$1 → NSString
debugDescription
no setterinherited
description$1 → NSString
description
no setterinherited
hash$1 int
hash
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
isProxy bool
isProxy
no setterinherited
layers ↔ NSArray
The layers included in the style, arranged according to their back-to-front ordering on the screen.
getter/setter pair
light MLNLight
Provides global light source for the style.
getter/setter pair
name → NSString?
The name of the style.
no setter
performsPlacementTransitions bool
A boolean value indicating whether label placement transitions are enabled.
getter/setter pair
ref → ObjCObjectRef
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sources ↔ NSSet
A set containing the style’s sources.
getter/setter pair
styleJSON ↔ NSString
The style JSON representation of the map.
getter/setter pair
superclass$1 → ObjCObjectBase
superclass
no setterinherited
transition MLNTransition
Values describing animated transitions to changes on a style's individual paint properties.
getter/setter pair

Methods

addLayer(MLNStyleLayer layer) → void
Adds a new layer on top of existing layers.
addSource(MLNSource source) → void
Adds a new source to the current style.
autorelease() MLNStyle
autorelease
class$1() → ObjCObjectBase
class
inherited
conformsToProtocol$1(Protocol aProtocol) bool
conformsToProtocol:
inherited
copy() → ObjCObjectBase
copy
inherited
dealloc() → void
dealloc
inherited
doesNotRecognizeSelector(Pointer<ObjCSelector> aSelector) → void
doesNotRecognizeSelector:
inherited
forwardingTargetForSelector(Pointer<ObjCSelector> aSelector) → ObjCObjectBase
forwardingTargetForSelector:
inherited
forwardInvocation(NSInvocation anInvocation) → void
forwardInvocation:
inherited
imageForName(NSString name$1) UIImage?
Returns the image associated with the given name in the style.
init() MLNStyle
init
insertLayer(MLNStyleLayer layer, {required int atIndex}) → void
Inserts a new layer into the style at the given index.
insertLayer$1(MLNStyleLayer layer, {required MLNStyleLayer belowLayer}) → void
Inserts a new layer below another layer.
insertLayer$2(MLNStyleLayer layer, {required MLNStyleLayer aboveLayer}) → void
Inserts a new layer above another layer.
isEqual(ObjCObjectBase object) bool
isEqual:
inherited
isKindOfClass(ObjCObjectBase aClass) bool
isKindOfClass:
inherited
isMemberOfClass(ObjCObjectBase aClass) bool
isMemberOfClass:
inherited
layerWithIdentifier(NSString identifier) MLNStyleLayer?
Returns a style layer with the given identifier in the current style.
localizeLabelsIntoLocale(NSLocale? locale) → void
Attempts to localize labels in the style into the given locale.
methodForSelector(Pointer<ObjCSelector> aSelector) Pointer<NativeFunction<Void Function()>>
methodForSelector:
inherited
methodSignatureForSelector(Pointer<ObjCSelector> aSelector) → NSMethodSignature
methodSignatureForSelector:
inherited
mutableCopy() → ObjCObjectBase
mutableCopy
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
performSelector(Pointer<ObjCSelector> aSelector) → ObjCObjectBase
performSelector:
inherited
performSelector$1(Pointer<ObjCSelector> aSelector, {required ObjCObjectBase withObject}) → ObjCObjectBase
performSelector:withObject:
inherited
performSelector$2(Pointer<ObjCSelector> aSelector, {required ObjCObjectBase withObject, required ObjCObjectBase withObject$1}) → ObjCObjectBase
performSelector:withObject:withObject:
inherited
release() → void
release
inherited
removeImageForName(NSString name$1) → void
Removes a name and its associated image from the style.
removeLayer(MLNStyleLayer layer) → void
Removes a layer from the map view.
removeSource(MLNSource source) → void
Removes a source from the current style.
removeSource$1(MLNSource source, {required Pointer<Pointer<ObjCObject>> error}) bool
Removes a source from the current style.
respondsToSelector(Pointer<ObjCSelector> aSelector) bool
respondsToSelector:
inherited
retain() MLNStyle
retain
retainCount() int
retainCount
inherited
self$1() MLNStyle
self
setImage(UIImage image, {required NSString forName}) → void
Adds or overrides an image used by the style’s layers.
sourceWithIdentifier(NSString identifier) MLNSource?
Returns a source with the given identifier in the current style.
toString() String
A string representation of this object.
inherited
zone() Pointer<NSZone>
zone
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

alloc() MLNStyle
alloc
allocWithZone(Pointer<NSZone> zone) MLNStyle
allocWithZone:
defaultStyle() MLNDefaultStyle
Returns default style
defaultStyleURL() → NSURL?
Returns default style as NSURL
isInstance(ObjCObjectBase obj) bool
Returns whether obj is an instance of MLNStyle.
new$() MLNStyle
new
predefinedStyle(NSString withStyleName) MLNDefaultStyle?
Get predefined style by name
predefinedStyles() → NSArray
Returns list of predefined styles