MSFLayer

Objective-C


@interface MSFLayer : NSObject {
  void *swigCPtr;
  BOOL swigCMemOwn;
}

Swift

class MSFLayer : NSObject

An abstract base class for all layers.

  • Checks if this object is equal to the specified object.

    Declaration

    Objective-C

    - (BOOL)isEqual:(id)object;

    Swift

    func isEqual(_ object: Any!) -> Bool

    Parameters

    object

    The reference object.

    Return Value

    True when objects are equal, false otherwise.

  • Returns the hash value of this object.

    Declaration

    Objective-C

    - (NSUInteger)hash;

    Swift

    func hash() -> UInt

    Return Value

    The hash value of this object.

  • Returns a copy of the layer meta data map. The changes you make to this map are NOT reflected in the actual meta data of the layer.

    Declaration

    Objective-C

    - (MSFStringVariantMap *)getMetaData;

    Swift

    func getMetaData() -> MSFStringVariantMap!

    Return Value

    A copy of the layer meta data map.

  • Sets a new meta data map for the layer. Old meta data values will be lost.

    Declaration

    Objective-C

    - (void)setMetaData:(MSFStringVariantMap *)metaData;

    Swift

    func setMetaData(_ metaData: MSFStringVariantMap!)

    Parameters

    metaData

    The new meta data map for this layer.

  • Returns true if the specified key exists in the layer meta data map.

    Declaration

    Objective-C

    - (BOOL)containsMetaDataKey:(NSString *)key;

    Swift

    func containsMetaDataKey(_ key: String!) -> Bool

    Parameters

    key

    The key to check.

    Return Value

    True if the meta data element exists.

  • Returns a layer meta data element corresponding to the key. If no value is found null variant is returned.

    Declaration

    Objective-C

    - (MSFVariant *)getMetaDataElement:(NSString *)key;

    Swift

    func getMetaDataElement(_ key: String!) -> MSFVariant!

    Parameters

    key

    The key to use.

    Return Value

    The value corresponding to the key from the meta data map. If the key does not exist, empty variant is returned.

  • Adds a new key-value pair to the layer meta data map. If the key already exists in the map, it’s value will be replaced by the new value.

    Declaration

    Objective-C

    - (void)setMetaDataElement:(NSString *)key element:(MSFVariant *)element;

    Swift

    func setMetaDataElement(_ key: String!, element: MSFVariant!)

    Parameters

    key

    The new key.

    element

    The new value.

  • Returns the layer task priority of this layer.

    Declaration

    Objective-C

    - (int)getUpdatePriority;

    Swift

    func getUpdatePriority() -> Int32

    Return Value

    The priority level for the tasks of this layer.

  • Sets the layer task priority. Higher priority layers get to load data before lower priority layers. Normal layers and tile layers have seperate task queues and thus don’t compete with each other for task queue access. The default is 0.

    Declaration

    Objective-C

    - (void)setUpdatePriority:(int)priority;

    Swift

    func setUpdatePriority(_ priority: Int32)

    Parameters

    priority

    The new task priority for this layer, higher values get better access.

  • Sets the layer culling delay. The culling delay is used to delay layer content rendering in case of user interaction, higher delay improves performance and battery life at the expense of interactivity. Default is 200ms-400ms, depending on layer type.

    Declaration

    Objective-C

    - (void)setCullDelay:(int)delay;

    Swift

    func setCullDelay(_ delay: Int32)

    Parameters

    delay

    The new culling delay in milliseconds.

  • Returns the opacity of this layer.

    Declaration

    Objective-C

    - (float)getOpacity;

    Swift

    func getOpacity() -> Float

    Return Value

    The opacity of this layer.

  • Set the opacity of the layer.

    Declaration

    Objective-C

    - (void)setOpacity:(float)opacity;

    Swift

    func setOpacity(_ opacity: Float)

    Parameters

    opacity

    The opacity of the layer in range (0..1). 1.0 is the default value.

  • Returns the visibility of this layer.

    Declaration

    Objective-C

    - (BOOL)isVisible;

    Swift

    func isVisible() -> Bool

    Return Value

    True if the layer is visible.

  • Sets the visibility of this layer.

    Declaration

    Objective-C

    - (void)setVisible:(BOOL)visible;

    Swift

    func setVisible(_ visible: Bool)

    Parameters

    visible

    The new visibility state of the layer.

  • Returns whether this layer goes through the post-process effect.

    Declaration

    Objective-C

    - (BOOL)isPostProcessed;

    Swift

    func isPostProcessed() -> Bool

    Return Value

    True if the layer is post-processed. The default is true.

  • Sets whether this layer goes through the post-process effect set with MapRenderer::setPostProcessEffect. A layer that opts out is drawn AFTER the effect has resolved - so it keeps its own appearance over a stylized map - but still into the same depth buffer, so it is occluded by the terrain as usual. Such a layer takes no part in the terrain depth/draping arrangement, so this is meant for overlays (annotations, sky-anchored objects), not for the tile layers that paint the ground. Has no effect while no post-process effect is set.

    Declaration

    Objective-C

    - (void)setPostProcessed:(BOOL)postProcessed;

    Swift

    func setPostProcessed(_ postProcessed: Bool)

    Parameters

    postProcessed

    The new post-processing state of the layer.

  • Returns the visible zoom range of this layer.

    Declaration

    Objective-C

    - (MSFMapRange *)getVisibleZoomRange;

    Swift

    func getVisibleZoomRange() -> MSFMapRange!

    Return Value

    The visible zoom range of this layer.

  • Sets the visible zoom range for this layer. Current zoom level must be within this range for the layer to be visible. This range is half-open, thus layer is visible if range.min <= ZOOMLEVEL < range.max.

    Declaration

    Objective-C

    - (void)setVisibleZoomRange:(MSFMapRange *)range;

    Swift

    func setVisibleZoom(_ range: MSFMapRange!)

    Parameters

    range

    new visible zoom range

  • Tests whether this layer is being currently updated.

    Declaration

    Objective-C

    - (BOOL)isUpdateInProgress;

    Swift

    func isUpdateInProgress() -> Bool

    Return Value

    True when the layer is being updated or false when the layer is in steady state.

  • Updates the layer using new visibility information. This method is periodically called when the map view moves. The visibilty info is saved, so the data can be refreshed later.

    Declaration

    Objective-C

    - (void)update:(MSFCullState *)cullState;

    Swift

    func update(_ cullState: MSFCullState!)

    Parameters

    cullState

    The new visibilty information.

  • Refreshes the layer using old stored visibility information. This method might be called if some of the layer data changes.

    Declaration

    Objective-C

    - (void)refresh;

    Swift

    func refresh()
  • Simulate click on this layer. This may trigger any event listeners attached to the layer.

    Declaration

    Objective-C

    - (void)simulateClick:(enum MSFClickType)clickType
                screenPos:(MSFScreenPos *)screenPos
                viewState:(MSFViewState *)viewState;

    Swift

    func simulateClick(_ clickType: MSFClickType, screenPos: MSFScreenPos!, viewState: MSFViewState!)

    Parameters

    clickType

    The type of the click.

    screenPos

    The screen position for the simulated click.

    viewState

    The view state to use.

  • Undocumented

    Declaration

    Objective-C

    -(void)dealloc;

    Swift

    func dealloc()