MSFCompositeVectorTileLayer
Objective-C
@interface MSFCompositeVectorTileLayer : MSFVectorTileLayer
Swift
class MSFCompositeVectorTileLayer : MSFVectorTileLayer
A VectorTileLayer that can weave named external data sources (raster, hillshade, merged vector / contour) into the master CartoCSS style’s layer order.
Each external source is placed at the position of a matching layer name in the style project’s “layers” array, and configured by a matching ‘#name { … }’ block in the CartoCSS (e.g. raster-opacity, hillshade-exaggeration), including zoom- and style-parameter- parameter-dependent expressions. Raster and hillshade sources are rendered as their own draped child layers interleaved between the master style layers; merged vector sources are folded into the master source and styled normally.
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. For raster and hillshade types the source is drawn as its own child layer at the style slot named ‘name’. For the vector type the source is merged into the master source (see addVectorDataSource).
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 ‘encoding’ metadata (“terrarium”/“mapbox”).
-
Adds a named external data source. For raster and hillshade types the source is drawn as its own child layer at the style slot named ‘name’. For the vector type the source is merged into the master source (see addVectorDataSource).
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) merged into the master source and 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 - a RasterTileLayer, a HillshadeRasterTileLayer or a VectorTileLayer, depending on the source type. This is the way to reach a setting the config symbolizer does not carry: a HillshadeRasterTileLayer’s NormalMapLightingShader is generated GLSL rather than a style property, and applyConfig never writes it, so a shader set through this survives the per-frame config pass.
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.
-
Returns whether single-pass segmented rendering is enabled (Milestone 6, optional).
Declaration
Objective-C
- (BOOL)isSinglePassRenderingEnabled;Swift
func isSinglePassRenderingEnabled() -> BoolReturn Value
True if single-pass rendering is enabled. The default is false.
-
Sets whether to use the optional single-pass segmented renderer instead of the default one-vt-pass-per-segment path. Intended for A/B comparison; currently a no-op placeholder until the single-pass renderer lands.
Declaration
Objective-C
- (void)setSinglePassRenderingEnabled:(BOOL)enabled;Swift
func setSinglePassRenderingEnabled(_ enabled: Bool)Parameters
enabledTrue to enable single-pass rendering.
-
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 zoom level bias of a single external data source, overriding the layer-wide value. Use this to fetch a source at a different resolution from the base map - e.g. a bias of 1.0 on a high-resolution DEM source makes the hillshade use one zoom level more detail. Note that if the style defines a ‘zoom-level-bias’ value for this source, the style value wins - the same precedence the other per-source config values have.
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. Overzooming reuses a coarser parent tile when the source has no tile at the target zoom level, which is how a low-resolution DEM keeps covering the map 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()