TTMapStyle
Objective-C
@interface TTMapStyle : NSObject
Swift
class TTMapStyle : NSObject
TTMapStyle class that represents map style.
-
Add a layer to the style. The layer is added above all existing layers.
Declaration
Objective-C
- (void)addLayer:(TTMapLayer *_Nonnull)layer withReference:(NSString *_Nonnull)reference;
Swift
func add(_ layer: TTMapLayer, withReference reference: String)
Parameters
layer
TTMapLayer.
reference
Reference ID of Layer.
-
Removes the layer with provided id from the style.
Declaration
Objective-C
- (TTMapLayer *_Nonnull)removeLayer:(NSString *_Nonnull)ID;
Swift
func removeLayer(_ ID: String) -> TTMapLayer
Parameters
ID
removed map layer.
Return Value
TTMapLayer
-
Moves the layer before provided id from the style.
Declaration
Objective-C
- (void)moveLayer:(NSString *_Nonnull)ID behindLayer:(NSString *_Nonnull)referenceID;
Swift
func moveLayer(_ ID: String, behindLayer referenceID: String)
Parameters
ID
id the id of the layer to be moved.
referenceId
the id of the layer this layer is to be moved behind.
-
Moves given layer to front.
Declaration
Objective-C
- (void)moveLayerToFrontWithId:(NSString *_Nonnull)ID;
Swift
func moveLayerToFront(withId ID: String)
Parameters
ID
id the id of the layer to be moved.
-
Moves given layer to front.
Declaration
Objective-C
- (void)moveLayerToFront:(TTMapLayer *_Nonnull)mapLayer;
Swift
func moveLayer(toFront mapLayer: TTMapLayer)
Parameters
mapLayer
TTMapLayer to be moved.
-
Returns the array of TTMapLayer.
Declaration
Objective-C
- (NSArray<TTMapLayer *> *_Nonnull)getLayers;
Swift
func getLayers() -> [TTMapLayer]
Return Value
NSArray
* -
Provides access to the layer with provided id if such layer is present in the style.
Declaration
Objective-C
- (TTMapLayer *_Nullable)getLayerByID:(NSString *_Nonnull)ID;
Swift
func getLayerByID(_ ID: String) -> TTMapLayer?
Parameters
ID
ID of Layer.
Return Value
TTMapLayer*
-
Provides access to the array of layer with provided regex if such layers are present in the style.
Declaration
Objective-C
- (NSArray<TTMapLayer *> *_Nonnull)getLayersByRegex:(NSString *_Nonnull)regex;
Swift
func getLayersByRegex(_ regex: String) -> [TTMapLayer]
Parameters
regex
regex.
Return Value
NSArray
*. -
Provides access to the array of layer with provided regex if such layers are present in the style.
Declaration
Objective-C
- (NSArray<TTMapLayer *> *_Nonnull)getLayersBySourceLayerRegex: (NSString *_Nonnull)regexs;
Swift
func getLayersBySourceLayerRegex(_ regexs: String) -> [TTMapLayer]
Parameters
regexs
regexs.
Return Value
NSArray
*. -
Provides access to the array of layer with provided regex if such layers are present in the style.
Declaration
Objective-C
- (NSArray<TTMapLayer *> *_Nonnull)getLayersByRegexs: (NSArray<NSString *> *_Nonnull)regexs;
Swift
func getLayersByRegexs(_ regexs: [String]) -> [TTMapLayer]
Parameters
regexs
regexs
Return Value
NSArray
*. -
Provides access to the array of layer with provided regex if such layers are present in the style.
Declaration
Objective-C
- (NSArray<TTMapLayer *> *_Nonnull)getLayersBySourceLayerRegexs: (NSArray<NSString *> *_Nonnull)regex;
Swift
func getLayersBySourceLayerRegexs(_ regex: [String]) -> [TTMapLayer]
Parameters
regex
regex description
Return Value
NSArray
*.
-
Adds a source to the style.
Declaration
Objective-C
- (void)addSource:(TTMapSource *_Nonnull)source;
Swift
func add(_ source: TTMapSource)
Parameters
source
TTMapSource.
-
Removes the source with provided id from the style.
Declaration
Objective-C
- (void)removeSource:(NSString *_Nonnull)ID withVisitor:(id<TTMapSourceVisitor> _Nullable)visitor;
Swift
func removeSource(_ ID: String, with visitor: TTMapSourceVisitor?)
Parameters
ID
ID of Source.
visitor
TTMapSourceVisitor protocol.
-
Gets the source with provided id from the style.
Declaration
Objective-C
- (void)getSource:(NSString *_Nonnull)ID withVisitor:(id<TTMapSourceVisitor> _Nonnull)visitor;
Swift
func getSource(_ ID: String, with visitor: TTMapSourceVisitor)
Parameters
ID
ID of Source.
visitor
TTMapSourceVisitor protocol.
-
Adds a image to the style.
Declaration
Objective-C
- (void)addImage:(id)image withID:(NSString *_Nonnull)ID;
Swift
func addImage(_ image: Any!, withID ID: String)
Parameters
image
UIImage.
ID
of image.
-
Removes the image with provided id from the style.
Declaration
Objective-C
- (void)removeImage:(NSString *_Nonnull)ID;
Swift
func removeImage(_ ID: String)
Parameters
ID
ID of Image.
-
Return to the image with provided id if such image is present in the style.
Declaration
Objective-C
- (id)getImage:(NSString *_Nonnull)ID;
Swift
func getImage(_ ID: String) -> Any!
Parameters
ID
ID of Image.
Return Value
UIImage.
-
Return true if layer exists.
Declaration
Objective-C
- (_Bool)layerExists:(TTMapLayer *_Nonnull)layer;
Swift
func layerExists(_ layer: TTMapLayer) -> Bool
Parameters
layer
TTMapLayer.
Return Value
true if layer exists.
-
Return true if source exists.
Declaration
Objective-C
- (_Bool)sourceExists:(TTMapSource *_Nonnull)source;
Swift
func sourceExists(_ source: TTMapSource) -> Bool
Parameters
source
TTMapSource.
Return Value
true if source exists.