Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Animating with MapScenes

kircher1 edited this page Apr 6, 2021 · 6 revisions

The MapRenderer's SetMapScene API automatically handles animation of the map view. The MapScene instance will specify a target zoom level and location which the MapRenderer will animate to.

Map Animations

The SetMapScene API returns a yieldable object that can be used within a co-routine to wait until the animation has completed.

private IEnumerator AnimateThroughScenes()
{
    foreach (var scene in MapScenes)
    {
        yield return _map.SetMapScene(scene);
    }
}

A similar approach is used in the CityTour scene of the sample project.

Note, it is not required to call the animation from a co-routine. If the yield-ing to wait for the animation to complete is not useful, the object returned from SetMapScene can be ignored.

If during an animation the center or zoom level properties change for other reasons, e.g. the map is being manipulated via other input sources, then the animation will automatically cancel.

MapScene types

Name Description
MapSceneOfLocationAndZoomLevel Map is focused to the specified location and zoom level
MapSceneOfLabelAndZoomLevel Map is focused to the specified label's location and the specified zoom level
More to be added...

Clone this wiki locally