-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(gallery-layer-type): add boilerplate
- Loading branch information
1 parent
1234893
commit 811cf12
Showing
12 changed files
with
82 additions
and
34 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,37 @@ | ||
import {GlobeLayerType} from '../../types/globe-layer-type'; | ||
import {LayerType} from '../../types/globe-layer-type'; | ||
|
||
// Returns the url template for offline usage | ||
export function getOfflineTilesUrl(type: GlobeLayerType): string { | ||
export function getOfflineTilesUrl(type: LayerType): string { | ||
if (!window.cfs) { | ||
console.error('Calling electron function from a non-electron environment'); | ||
return ''; | ||
} | ||
|
||
return type === GlobeLayerType.Tiles | ||
? window.cfs.getDownloadsPath( | ||
'downloads', | ||
'{id}', | ||
'tiles', | ||
'{timeIndex}', | ||
'{z}', | ||
'{x}', | ||
'{reverseY}.png' | ||
) | ||
: window.cfs.getDownloadsPath( | ||
'downloads', | ||
'{id}', | ||
'tiles', | ||
'{timeIndex}', | ||
'full.png' | ||
); | ||
return { | ||
[LayerType.Tiles]: window.cfs.getDownloadsPath( | ||
'downloads', | ||
'{id}', | ||
'tiles', | ||
'{timeIndex}', | ||
'{z}', | ||
'{x}', | ||
'{reverseY}.png' | ||
), | ||
|
||
[LayerType.Image]: window.cfs.getDownloadsPath( | ||
'downloads', | ||
'{id}', | ||
'tiles', | ||
'{timeIndex}', | ||
'full.png' | ||
), | ||
|
||
[LayerType.Gallery]: window.cfs.getDownloadsPath( | ||
'downloads', | ||
'{id}', | ||
'tiles', | ||
'{timeIndex}', | ||
'full.jpg' | ||
) | ||
}[type]; | ||
} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export enum GlobeLayerType { | ||
export enum LayerType { | ||
Tiles = 'tiles', | ||
Image = 'image' | ||
Image = 'image', | ||
Gallery = 'gallery' | ||
} |
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
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
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
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
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
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