Skip to content

Commit

Permalink
Improve tile_frames on unrolled layers.
Browse files Browse the repository at this point in the history
  • Loading branch information
manthey committed Oct 10, 2022
1 parent 6d88745 commit 4668b75
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 18 deletions.
37 changes: 28 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"eslint": "^6.7.2",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-vue": "^6.0.1",
"geojs": "^1.10.4",
"geojs": "^1.10.11",
"node-sass": "^7.0.1",
"prettier": "^1.19.1",
"pug": "^3.0.1",
Expand Down
16 changes: 8 additions & 8 deletions src/components/ImageViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,9 @@ export default class ImageViewer extends Vue {
}
private get mapLayerList() {
if (this.store.layerMode !== "unroll") {
return [this.layerStackImages];
} else {
const llist = [[]];
let llist = [this.layerStackImages];
if (this.store.layerMode === "unroll") {
llist = [[]];
let visible = 0;
this.layerStackImages.forEach(lsi => {
if (visible && lsi.layer.visible) {
Expand All @@ -214,8 +213,8 @@ export default class ImageViewer extends Vue {
visible += 1;
}
});
return llist;
}
return llist;
}
/**
Expand Down Expand Up @@ -298,7 +297,7 @@ export default class ImageViewer extends Vue {
map: map,
imageLayers: [],
params: params,
layerIndices: []
baseLayerIndex: mllidx ? undefined : 0
};
if (this.maps.length <= mllidx) {
this.maps.push(mapentry);
Expand Down Expand Up @@ -380,9 +379,10 @@ export default class ImageViewer extends Vue {
const mapentry = this.maps[mllidx];
const map = mapentry.map;
// adjust number of tile layers
while (mapentry.imageLayers.length > mll.length * 2) {
while (mapentry.imageLayers.length > mll.length * 2 || (mapentry.baseLayerIndex !== baseLayerIndex && mapentry.imageLayers.length)) {
map.deleteLayer(mapentry.imageLayers.pop());
}
mapentry.baseLayerIndex = baseLayerIndex;
while (mapentry.imageLayers.length < mll.length * 2) {
mapentry.params.layer.tilesAtZoom = (level: number) => {
const s = Math.pow(2, someImage.levels - 1 - level);
Expand All @@ -403,7 +403,7 @@ export default class ImageViewer extends Vue {
* but we run out of webgl contexts sooner than that. Maybe because they
* get switched on and off?
*/
if (currentImageLayers + this.maps.length >= 10) {
if (currentImageLayers + this.maps.length >= 13) {
mapentry.params.layer.renderer = "canvas";
} else {
delete mapentry.params.layer.renderer;
Expand Down

0 comments on commit 4668b75

Please sign in to comment.