Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function visibleTilesLoaded(viewer) {
var layer = viewer.scene().layer();
var geometry = layer.geometry();
var visibleTilesForLevel = function(level) {
return geometry.visibleTiles(viewer.view(), level);
};
var tileHasTexture = function(tile) {
var tile = layer.textureStore().query(tile);
return (!tile.visible || tile.hasTexture);
};
var reduceAnd = function(a, b) {
return a && b;
};
return [].concat.apply([], geometry.levelList
.map(visibleTilesForLevel))
.map(tileHasTexture)
.reduce(reduceAnd);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.