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

    dataSource

    The master vector tile data source.

    decoder

    The 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

    name

    The source name; must match a layer name in the style “layers” array.

    dataSource

    The external data source.

    type

    The source type.

    elevationDecoder

    Optional 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

    name

    The source name; must match a layer name in the style “layers” array.

    dataSource

    The external data source.

    type

    The 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

    name

    The source name; its layers must be declared in the master style.

    dataSource

    The 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!) -> Bool

    Parameters

    name

    The 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

    name

    The 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

    bias

    The 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

    preloading

    The 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

    opacity

    The 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

    name

    The source name.

    bias

    The 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!) -> Float

    Parameters

    name

    The 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

    name

    The 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

    name

    The source name.

    level

    The 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!) -> Int32

    Parameters

    name

    The 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()