Skip to content

Instantly share code, notes, and snippets.

@wangyung
Created February 24, 2020 01:32
Show Gist options
  • Save wangyung/edd65d5c97fff2c566adf2d588e7ea82 to your computer and use it in GitHub Desktop.
Save wangyung/edd65d5c97fff2c566adf2d588e7ea82 to your computer and use it in GitHub Desktop.
The example of how to animate tile overlay and decrease the flickers
private fun swapTiles() {
if (overlay1 != null) {
overlay2 = map.addTileOverlay(
TileOverlayOptions()
.tileProvider(timedTileProvider)
.fadeIn(false)
.zIndex(zIndex)
)
removeOverlay(overlay1) {
overlay1 = null
}
} else {
overlay1 = map.addTileOverlay(
TileOverlayOptions()
.tileProvider(timedTileProvider)
.fadeIn(false)
.zIndex(zIndex)
)
removeOverlay(overlay2) {
overlay2 = null
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment