Created
February 24, 2020 01:32
-
-
Save wangyung/edd65d5c97fff2c566adf2d588e7ea82 to your computer and use it in GitHub Desktop.
The example of how to animate tile overlay and decrease the flickers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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