MSFVectorTileLayer

Objective-C


@interface MSFVectorTileLayer : MSFTileLayer

Swift

class MSFVectorTileLayer : MSFTileLayer

A tile layer where each tile is a vector tile, decoded and styled by a VectorTileDecoder.

  • Constructs a VectorTileLayer object from a data source and tile decoder.

    Declaration

    Objective-C

    - (id)initWithDataSource:(MSFTileDataSource *)dataSource
                     decoder:(MSFVectorTileDecoder *)decoder;

    Swift

    init!(dataSource: MSFTileDataSource!, decoder: MSFVectorTileDecoder!)

    Parameters

    dataSource

    The data source from which this layer loads data.

    decoder

    The tile decoder that decoder loaded tiles and applies styles.

  • Returns the tile decoder assigned to this layer.

    Declaration

    Objective-C

    - (MSFVectorTileDecoder *)getTileDecoder;

    Swift

    func getTileDecoder() -> MSFVectorTileDecoder!

    Return Value

    The tile decoder assigned to this layer.

  • Returns the tile cache capacity.

    Declaration

    Objective-C

    - (unsigned long)getTileCacheCapacity;

    Swift

    func getTileCacheCapacity() -> UInt

    Return Value

    The tile cache capacity in bytes.

  • Sets the vector tile cache capacity (uncompressed vertex buffers); too small a cache causes disappearing tiles. By default the cache follows the screen: five screens of tiles at the size of the ones in view, as maplibre keeps, and never under 10MB. Setting a capacity fixes it at that value instead.

    Declaration

    Objective-C

    - (void)setTileCacheCapacity:(unsigned long)capacityInBytes;

    Swift

    func setTileCacheCapacity(_ capacityInBytes: UInt)

    Parameters

    capacityInBytes

    The new tile bitmap cache capacity in bytes.

  • Returns the current display order of the labels.

    Declaration

    Objective-C

    - (enum MSFVectorTileRenderOrder)getLabelRenderOrder;

    Swift

    func getLabelRenderOrder() -> MSFVectorTileRenderOrder

    Return Value

    The display order of the labels. Default is VECTOR_TILE_RENDER_ORDER_LAYER.

  • Sets the current display order of the labels.

    Declaration

    Objective-C

    - (void)setLabelRenderOrder:(enum MSFVectorTileRenderOrder)renderOrder;

    Swift

    func setLabel(_ renderOrder: MSFVectorTileRenderOrder)

    Parameters

    renderOrder

    The new display order of the labels.

  • Returns the current display order of the buildings. LAST draws over flat labels too: a label that must clear a building is a billboard one, whose pass runs after the buildings.

    Declaration

    Objective-C

    - (enum MSFVectorTileRenderOrder)getBuildingRenderOrder;

    Swift

    func getBuildingRenderOrder() -> MSFVectorTileRenderOrder

    Return Value

    The display order of the buildings. Default is VECTOR_TILE_RENDER_ORDER_LAST.

  • Sets the current display order of the buildings.

    Declaration

    Objective-C

    - (void)setBuildingRenderOrder:(enum MSFVectorTileRenderOrder)renderOrder;

    Swift

    func setBuilding(_ renderOrder: MSFVectorTileRenderOrder)

    Parameters

    renderOrder

    The new display order of the buildings.

  • Returns the click radius of vector tile features. Units are screen density independent pixels (DP or DIP).

    Declaration

    Objective-C

    - (float)getClickRadius;

    Swift

    func getClickRadius() -> Float

    Return Value

    The click radius of vector tile features.

  • Sets the click radius of vector tile features. The click radius is applied as an extra buffer to the vector tile features to make clicking on small features less sensitive. Units are screen density independent pixels (DP or DIP).

    Declaration

    Objective-C

    - (void)setClickRadius:(float)radius;

    Swift

    func setClickRadius(_ radius: Float)

    Parameters

    radius

    The new click radius of vector tile features. The default value is 4.

  • Returns the current relative layer blending speed.

    Declaration

    Objective-C

    - (float)getLayerBlendingSpeed;

    Swift

    func getBlendingSpeed() -> Float

    Return Value

    The current relative layer blending speed. Default is 0.0 (no blending).

  • Sets the relative layer blending speed. The default is 0 (no fade), as in maplibre and mapbox-gl: a fading cased road reads as an empty outline. Set 1 for the fade this SDK used to do.

    Declaration

    Objective-C

    - (void)setLayerBlendingSpeed:(float)speed;

    Swift

    func setLayerBlendingSpeed(_ speed: Float)

    Parameters

    speed

    The new relative speed value. Use zero or negative values to disable blending.

  • Draws one 3D model instance (a CartoCSS model rule) in a highlight colour, for a selection. Takes what a click on it reported: VectorTileClickInfo’s feature id and feature position index. Feature ids must tell the features of the layer apart for this to pick out one instance.

    Declaration

    Objective-C

    - (void)setModelHighlight:(long long)featureId
              featurePosIndex:(int)featurePosIndex
                        color:(MSFColor *)color;

    Swift

    func setModelHighlight(_ featureId: Int64, featurePosIndex: Int32, color: MSFColor!)

    Parameters

    featureId

    The id of the feature the model was placed for.

    featurePosIndex

    The index of the point in the feature, 0 for a single point.

    color

    The highlight colour; its alpha is how much of the model’s own colour it replaces.

  • Removes the highlight set by setModelHighlight.

    Declaration

    Objective-C

    - (void)clearModelHighlight;

    Swift

    func clearModelHighlight()
  • Returns the label blending speed, in full fades per second.

    Declaration

    Objective-C

    - (float)getLabelBlendingSpeed;

    Swift

    func getLabelBlendingSpeed() -> Float

    Return Value

    The label blending speed. Default is 1/0.3, a 300 ms fade.

  • Sets the label blending speed, in full fades per second: a label fades in or out in 1/speed seconds.

    Declaration

    Objective-C

    - (void)setLabelBlendingSpeed:(float)speed;

    Swift

    func setLabelBlendingSpeed(_ speed: Float)

    Parameters

    speed

    The new speed. Default is 1/0.3, a 300 ms fade. Use zero or negative values to disable blending.

  • Returns how much of the perspective divide a label keeps as it recedes from the camera.

    Declaration

    Objective-C

    - (float)getLabelPerspectiveScaling;

    Swift

    func getLabelPerspectiveScaling() -> Float

    Return Value

    The label perspective scaling, 0 to 1. Default is 0.5.

  • Sets how much of the perspective divide a label keeps as it recedes from the camera: 0 holds a constant on-screen size, 0.5 (mapbox’s and maplibre’s value) shrinks at half the projection’s rate, 1 shrinks with the map. Callout labels always hold their size.

    Declaration

    Objective-C

    - (void)setLabelPerspectiveScaling:(float)scaling;

    Swift

    func setLabelPerspectiveScaling(_ scaling: Float)

    Parameters

    scaling

    The new scaling, clamped to 0 to 1. Default is 0.5.

  • Returns the renderer layer filter. The filter is given as ECMA regular expression that is applied to qualified layer names.

    Declaration

    Objective-C

    - (NSString *)getRendererLayerFilter;

    Swift

    func getRendererLayerFilter() -> String!

    Return Value

    The renderer layer filter. Default is empty string, which means no filter is used.

  • Sets the renderer layer filter. The filter is given as ECMA regular expression that is applied to qualified layer names. If non-empty, then only layers that pass the filter are decoded and rendered.

    Declaration

    Objective-C

    - (void)setRendererLayerFilter:(NSString *)filter;

    Swift

    func setRendererLayerFilter(_ filter: String!)

    Parameters

    filter

    The new renderer layer filter. @throws NSException If the filter expression is not valid.

  • Returns the click handler layer filter. The filter is given as ECMA regular expression that is applied to qualified layer names.

    Declaration

    Objective-C

    - (NSString *)getClickHandlerLayerFilter;

    Swift

    func getClickHandlerLayerFilter() -> String!

    Return Value

    The click handler layer filter. Default is empty string, which means no filter is used.

  • Sets the click handler layer filter. The filter is given as ECMA regular expression that is applied to qualified layer names. If non-empty, then only layers that pass the filter are tested when handling clicks.

    Declaration

    Objective-C

    - (void)setClickHandlerLayerFilter:(NSString *)filter;

    Swift

    func setClickHandlerLayerFilter(_ filter: String!)

    Parameters

    filter

    The new click handler layer filter. @throws NSException If the filter expression is not valid.

  • Returns the vector tile event listener.

    Declaration

    Objective-C

    - (MSFVectorTileEventListener *)getVectorTileEventListener;

    Swift

    func getVectorTileEventListener() -> MSFVectorTileEventListener!

    Return Value

    The vector tile event listener.

  • Sets the vector tile event listener.

    Declaration

    Objective-C

    - (void)setVectorTileEventListener:(MSFVectorTileEventListener *)eventListener;

    Swift

    func setVectorTileEventListener(_ eventListener: MSFVectorTileEventListener!)

    Parameters

    eventListener

    The vector tile event listener.

  • Undocumented

    Declaration

    Objective-C

    -(void)dealloc;

    Swift

    func dealloc()