Skip to content

Animations

Different animations can be used to focus on locations, i.e. level, building and site. Animation types are parameters of the show... APIs of map widget (i.e. PTRMapWidgetViewController for iOS and PTRMapWidgetFragment for Android).

There are three type of animations available:

  • PTRMapAnimationType.none: The map will open without any animation.
  • PTRMapAnimationType.standard: The map will open with a short slide in animation.
  • PTRMapAnimationType.flyOver: The map will open with a fly over animation. This animation zooms into the site, building or level until the boundaries of the given construct from a zoomed out birds-eye view, and tilts the map. The OnComplete callback of the show api will be triggered after the animation has finished.

Example to show a site using siteInternalIdentifier and no animation

mapWidget?.showSite(
    <siteInternalIdentifier>,
    PTRMapAnimationType.none
) { error ->
    error?.let { it1 ->
        Plog.e("Unable to show site: $it1")
        return@showSite
    }
}
mapWidget.showSite(
    siteInternalIdentifier: <siteInternalIdentifier>, 
    animationType: .none
) { error in
    if (error != nil) {
        print("Unable to show site: \(error?.errorCode ?? "")")
        return
    }
}

Example to show a building using buildingInternalIdentifier and flyOver animation

mapWidget?.showBuilding(
    <siteInternalIdentifier>,
    <buildingInternalIdentifier>,
    PTRMapAnimationType.flyOver
) { error ->
    error?.let { it1 ->
        Plog.e("Unable to show building: $it1")
        return@showBuilding
    }
}
mapWidget.showBuilding(
    siteInternalIdentifier: <siteInternalIdentifier>, 
    buildingInternalIdentifier: <buildingInternalIdentifier>,
    animationType: .flyOver
) { error in
    if (error != nil) {
        print("Unable to show building: \(error?.errorCode ?? "")")
        return
    }
}

At the end, animation for fly over should look like the following:


Last update: June 28, 2024
Back to top