MaplyUpdateDelegate

Objective-C

@protocol MaplyUpdateDelegate

Swift

protocol MaplyUpdateDelegate

The update delegate is called if the viewer moves, but not too often.

Use this delegate to generate features around the viewer when they move. You can control how far they have to move (in display coordinates) and how often you’ll receive updates.

  • Called when the MaplyUpdateLayer is initialized.

    This is called after things are set up. You’ll be on the layer thread here.

    Declaration

    Objective-C

    - (void)start:(MaplyUpdateLayer *_Nonnull)layer;

    Swift

    func start(_ layer: MaplyUpdateLayer)
  • Called when the viewer moves.

    You’ll be called on the layer thread when the viewer moves more than your moveDist, subject to calls no more frequent than the minTime.

    Declaration

    Objective-C

    - (void)viewerMovedTo:(MaplyViewerState *_Nonnull)viewState
                    layer:(MaplyUpdateLayer *_Nonnull)layer;

    Swift

    func viewerMoved(to viewState: MaplyViewerState, layer: MaplyUpdateLayer)
  • Called when the update layer is shutting down.

    Clean up your own data here.

    Declaration

    Objective-C

    - (void)teardown:(MaplyUpdateLayer *_Nonnull)layer;

    Swift

    func teardown(_ layer: MaplyUpdateLayer)