TGSceneUpdate
@interface TGSceneUpdate : NSObject
Represents a data structure to specify a YAML path and the corresponding value for a Tangram scene update.
Example to update an API key for a source defined like this in your stylesheet:
sources:
osm:
type: MVT
url: https://tile.mapzen.com/mapzen/vector/v1/all/{z}/{x}/{y}.mvt
max_zoom: 16
url_params:
api_key: vector-tiles-tyHL4AY
view.queueSceneUpdates(sceneUpdates: [ TGSceneUpdate(path: "sources.osm.url_params", value: "{ api_key: \(YOUR_API_KEY) }") ])
view.applySceneUpdates()
-
Init a scene update for a specific YAML path in the stylesheet and a new value:
Declaration
Objective-C
- (nonnull instancetype)initWithPath:(nonnull NSString *)path value:(nonnull NSString *)value;
Swift
init(path: String, value: String)
Parameters
path
the YAML path within the stylesheet
value
the new YAML value for the node selected by path
Return Value
an initialized scene update
-
The YAML path for which the update will occur in the stylesheet used in the map view
Declaration
Objective-C
@property (readwrite, copy, nonatomic) NSString *_Nonnull path;
Swift
var path: String { get set }
-
The YAML value to set in the update
Declaration
Objective-C
@property (readwrite, copy, nonatomic) NSString *_Nonnull value;
Swift
var value: String { get set }