MSFCompositeVectorTileLayer
Objective-C
@interface MSFCompositeVectorTileLayer : MSFVectorTileLayer
Swift
class MSFCompositeVectorTileLayer : MSFVectorTileLayer
A VectorTileLayer weaving named external data sources (raster, hillshade, vector / contour) into the master style’s layer order, each at its name’s position in the style’s “layers” array and configured by a matching ‘#name { … }’ CartoCSS block (zoom- and parameter-dependent). Sources can be added and removed at runtime.
-
Constructs a CompositeVectorTileLayer from a master vector data source and decoder.
Declaration
Objective-C
- (id)initWithDataSource:(MSFTileDataSource *)dataSource decoder:(MSFVectorTileDecoder *)decoder;Swift
init!(dataSource: MSFTileDataSource!, decoder: MSFVectorTileDecoder!)Parameters
dataSourceThe master vector tile data source.
decoderThe tile decoder (must be an MBVectorTileDecoder for external source configuration and placement to work).
-
Adds a named external data source, drawn as its own child layer at the style slot named ‘name’.
Declaration
Objective-C
- (void)addExternalDataSource:(NSString *)name dataSource:(MSFTileDataSource *)dataSource type:(enum MSFCompositeSourceType)type elevationDecoder:(MSFElevationDecoder *)elevationDecoder;Swift
func addExternalDataSource(_ name: String!, dataSource: MSFTileDataSource!, type: MSFCompositeSourceType, elevationDecoder: MSFElevationDecoder!)Parameters
nameThe source name; must match a layer name in the style “layers” array.
dataSourceThe external data source.
typeThe source type.
elevationDecoderOptional elevation decoder for hillshade sources. If null, it is resolved from the data source ‘dem_encoding’ metadata (“terrarium”/“mapbox”).
-
Adds a named external data source, drawn as its own child layer at the style slot named ‘name’.
Declaration
Objective-C
- (void)addExternalDataSource:(NSString *)name dataSource:(MSFTileDataSource *)dataSource type:(enum MSFCompositeSourceType)type;Swift
func addExternalDataSource(_ name: String!, dataSource: MSFTileDataSource!, type: MSFCompositeSourceType)Parameters
nameThe source name; must match a layer name in the style “layers” array.
dataSourceThe external data source.
typeThe source type.
-
Adds a named MBVT/protobuf source (including ContourTileDataSource) styled by the master CartoCSS. Equivalent to addExternalDataSource with COMPOSITE_SOURCE_TYPE_VECTOR.
Declaration
Objective-C
- (void)addVectorDataSource:(NSString *)name dataSource:(MSFTileDataSource *)dataSource;Swift
func addVectorDataSource(_ name: String!, dataSource: MSFTileDataSource!)Parameters
nameThe source name; its layers must be declared in the master style.
dataSourceThe vector data source to merge.
-
Removes the named external data source (of any type). Returns true if removed.
Declaration
Objective-C
- (BOOL)removeExternalDataSource:(NSString *)name;Swift
func removeExternalDataSource(_ name: String!) -> BoolParameters
nameThe source name.
Return Value
True if a source was removed.
-
Returns the names of all registered external data sources.
Declaration
Objective-C
- (MSFStringVector *)getExternalDataSourceNames;Swift
func getExternalDataSourceNames() -> MSFStringVector!Return Value
The registered external source names.
-
Returns the child layer a slot is drawn by (RasterTileLayer, HillshadeRasterTileLayer or VectorTileLayer), to reach settings the config symbolizer does not carry, e.g. a NormalMapLightingShader, which the config pass never overwrites. The child is owned by this layer - do not add it to a map.
Declaration
Objective-C
- (MSFLayer *)getExternalChildLayer:(NSString *)name;Swift
func getExternalChildLayer(_ name: String!) -> MSFLayer!Parameters
nameThe source name.
Return Value
The child layer, or null if no source is registered under that name.
-
Sets the zoom level bias for this layer and for every child layer it owns (external raster/hillshade/vector sources and the internal style-group layers). Sources with a per-source bias set via setExternalDataSourceZoomLevelBias keep their own value.
Declaration
Objective-C
- (void)setZoomLevelBias:(float)bias;Swift
func setZoomLevelBias(_ bias: Float)Parameters
biasThe new bias value, both positive and negative fractional values are supported.
-
Sets the preloading state for this layer and for every child layer it owns.
Declaration
Objective-C
- (void)setPreloading:(BOOL)preloading;Swift
func setPreloading(_ preloading: Bool)Parameters
preloadingThe new preloading state of the layer.
-
Sets the opacity for this layer and for every internal layer it owns (style groups and depth-split vector slots). External children keep the opacity the app set on them.
Declaration
Objective-C
- (void)setOpacity:(float)opacity;Swift
func setOpacity(_ opacity: Float)Parameters
opacityThe opacity in range (0..1).
-
Sets the zoom level bias of a single external data source, overriding the layer-wide value (e.g. 1.0 on a high-resolution DEM gives the hillshade one zoom level more detail). A ‘zoom-level-bias’ value in the style for this source wins over it.
Declaration
Objective-C
- (void)setExternalDataSourceZoomLevelBias:(NSString *)name bias:(float)bias;Swift
func setExternalDataSourceZoomLevelBias(_ name: String!, bias: Float)Parameters
nameThe source name.
biasThe new bias value, both positive and negative fractional values are supported. @throws NSException If the source does not exist.
-
Returns the effective zoom level bias of the given external data source.
Declaration
Objective-C
- (float)getExternalDataSourceZoomLevelBias:(NSString *)name;Swift
func getExternalDataSourceZoomLevelBias(_ name: String!) -> FloatParameters
nameThe source name.
Return Value
The zoom level bias of the source. @throws NSException If the source does not exist.
-
Clears the per-source zoom level bias, so the source follows the layer-wide value again.
Declaration
Objective-C
- (void)clearExternalDataSourceZoomLevelBias:(NSString *)name;Swift
func clearExternalDataSourceZoomLevelBias(_ name: String!)Parameters
nameThe source name. @throws NSException If the source does not exist.
-
Sets the maximum overzoom level of a single external data source: how many levels a coarser parent tile may stand in when the source has no tile at the target zoom (e.g. a DEM above its own max zoom).
Declaration
Objective-C
- (void)setExternalDataSourceMaxOverzoomLevel:(NSString *)name level:(int)level;Swift
func setExternalDataSourceMaxOverzoomLevel(_ name: String!, level: Int32)Parameters
nameThe source name.
levelThe new maximum overzoom level. @throws NSException If the source does not exist.
-
Returns the maximum overzoom level of the given external data source.
Declaration
Objective-C
- (int)getExternalDataSourceMaxOverzoomLevel:(NSString *)name;Swift
func getExternalDataSourceMaxOverzoomLevel(_ name: String!) -> Int32Parameters
nameThe source name.
Return Value
The maximum overzoom level of the source. @throws NSException If the source does not exist.
-
Undocumented
Declaration
Objective-C
-(void)dealloc;Swift
func dealloc()