-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make cesium-widget-component generic
- Loading branch information
Showing
12 changed files
with
437 additions
and
137 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
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import {INGVCatalog} from '../interfaces/ingv-catalog.js'; | ||
|
||
export const catalog: INGVCatalog = { | ||
id: '@cesium', | ||
credits: '© Cesium', | ||
layers: { | ||
// to complete | ||
}, | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import {INGVCatalog} from '../interfaces/ingv-catalog.js'; | ||
|
||
export const catalog: INGVCatalog = { | ||
id: '@geoadmin', | ||
credits: '© Swisstopo', | ||
layers: { | ||
terrain: { | ||
type: 'terrain', | ||
url: 'https://3d.geo.admin.ch/ch.swisstopo.terrain.3d/v1/', | ||
}, | ||
buildings: { | ||
type: '3dtiles', | ||
url: 'https://vectortiles0.geo.admin.ch/3d-tiles/ch.swisstopo.swisstlm3d.3d/20201020/tileset.json', | ||
}, | ||
vegetation: { | ||
type: '3dtiles', | ||
url: 'https://vectortiles.geo.admin.ch/3d-tiles/ch.swisstopo.vegetation.3d/20190313/tileset.json', | ||
}, | ||
'pixel-karte-farbe': { | ||
type: 'wmts', | ||
options: { | ||
url: 'https://wmts.geo.admin.ch/1.0.0/{layer}/default/{timestamp}/3857/{z}/{x}/{y}.{format}', | ||
layer: 'ch.swisstopo.pixelkarte-farbe', | ||
dimensions: { | ||
timestamp: 'current', | ||
}, | ||
format: 'jpeg', | ||
style: 'what is this?', | ||
tileMatrixSetID: 'idem', | ||
maximumLevel: 18, | ||
}, | ||
}, | ||
swissimage: { | ||
type: 'urltemplate', | ||
options: { | ||
url: 'https://wmts.geo.admin.ch/1.0.0/{layer}/default/{timestamp}/3857/{z}/{x}/{y}.{format}', | ||
customTags: { | ||
layer: 'ch.swisstopo.swissimage', | ||
timestamp: 'current', | ||
format: 'jpeg', | ||
}, | ||
maximumLevel: 20, | ||
}, | ||
}, | ||
}, | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import {INGVCesiumAllTypes} from './ingv-layers.js'; | ||
|
||
export interface NGVLayerDescr<Type, LayerType> { | ||
type: Type; | ||
options: LayerType; | ||
} | ||
|
||
/** | ||
* A catalog is simply a flat set of layers | ||
*/ | ||
export interface INGVCatalog { | ||
id: string; | ||
credits: string; | ||
layers: Record<string, INGVCesiumAllTypes>; | ||
} |
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,16 +1,35 @@ | ||
import type {CesiumWidget} from '@cesium/engine'; | ||
import type {INGVCatalog} from './ingv-catalog.js'; | ||
|
||
export interface IngvCesiumContext { | ||
cesiumApiKey?: string; | ||
baseUrl?: string; | ||
catalogs: Record< | ||
string, | ||
INGVCatalog | (() => Promise<{catalog: INGVCatalog}>) | string | ||
>; | ||
layers: { | ||
terrain: string; | ||
buildings: string; | ||
vegetation: string; | ||
terrain?: string; | ||
tiles3d?: string[]; | ||
imageries: string[]; | ||
}; | ||
initialView: { | ||
destination: [number, number, number]; | ||
/** | ||
* These are lists of selected layers. | ||
*/ | ||
quickLists?: { | ||
// Can we switch terrain? | ||
terrains?: string[]; | ||
// imageries: string[]; | ||
baseLayers?: string[]; | ||
}; | ||
// FIXME: probably useful | ||
// layerOptions: Record<string, any>; | ||
camera: { | ||
position: [number, number, number]; | ||
orientation: { | ||
heading: number; | ||
pitch: number; | ||
}; | ||
}; | ||
widgetOptions?: ConstructorParameters<typeof CesiumWidget>[1]; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import type { | ||
Cesium3DTileset, | ||
UrlTemplateImageryProvider, | ||
WebMapServiceImageryProvider, | ||
WebMapTileServiceImageryProvider, | ||
} from '@cesium/engine'; | ||
|
||
import type {CesiumTerrainProvider} from '@cesium/engine'; | ||
|
||
export type INGVCesiumImageryTypes = | ||
| INGVCesiumWMSImagery | ||
| INGVCesiumWMTSImagery | ||
| INGVCesiumUrlTemplateImagery; | ||
|
||
export type INGVCesiumAllTypes = | ||
| INGVCesium3DTiles | ||
| INGVCesiumTerrain | ||
| INGVCesiumImageryTypes; | ||
|
||
export interface INGVCesium3DTiles { | ||
type: '3dtiles'; | ||
url: string | number; | ||
options?: ConstructorParameters<typeof Cesium3DTileset>[0]; | ||
} | ||
|
||
export interface INGVCesiumTerrain { | ||
type: 'terrain'; | ||
url: string | number; | ||
options?: ConstructorParameters<typeof CesiumTerrainProvider>[0]; | ||
} | ||
|
||
export interface INGVCesiumWMTSImagery { | ||
type: 'wmts'; | ||
options?: ConstructorParameters<typeof WebMapTileServiceImageryProvider>[0]; | ||
} | ||
|
||
export interface INGVCesiumWMSImagery { | ||
type: 'wms'; | ||
options?: ConstructorParameters<typeof WebMapServiceImageryProvider>[0]; | ||
} | ||
|
||
export interface INGVCesiumUrlTemplateImagery { | ||
type: 'urltemplate'; | ||
options?: ConstructorParameters<typeof UrlTemplateImageryProvider>[0]; | ||
} |
Oops, something went wrong.