@geogirafe/lib-geoportal
Version:
GeoGirafe is a flexible application to build online geoportals.
51 lines (50 loc) • 1.96 kB
TypeScript
import GirafeHTMLElement from '../../base/GirafeHTMLElement.js';
import { Callback } from '../../tools/state/statemanager.js';
import type Globe from './tools/globe.js';
/**
* The 3D Map.
*
* The Component itself stays lightweight: Cesium and OLCesium are only imported when the 3D Map
* is displayed for the first time. Everything that needs those libraries lives in ./tools/globe.
* The synchronization with the 2D Map is done by OLCesium, through the OpenLayers map of the
* MapManager. There is therefore no direct dependency to the map-2d Component.
*/
export default class Map3dComponent extends GirafeHTMLElement {
protected templateUrl: string | null;
protected styleUrls: string[] | null;
template: () => import("uhtml").Hole;
globe: Globe | null;
map3dTarget: HTMLDivElement;
loading: boolean;
pixelTolerance: number;
/** Promise of the currently running globe creation, to prevent creating it twice. */
private globeCreation;
/** The OLCesium instance, once the globe has been created. */
get map3d(): any;
private get config();
constructor();
/**
*
* @param path Overridden to make those methods public for this component
* @param callback
*/
subscribe(path: string, callback: Callback): Callback;
subscribe(path: RegExp, callback: Callback): Callback;
/**
* The Map needs to be displayed in Fullscreen Mode.
*/
protected get isFullscreenComponent(): boolean;
protected connectedCallback(): void;
render(): void;
private registerEvents;
/**
* Lazily loads Cesium/OLCesium and creates the globe. Does nothing if no 3D configuration
* is available or if the globe has already been created.
*/
private createGlobe;
/**
* Shows or hides the 3D Map and sizes it depending on the current display mode.
* The 2D Map takes care of its own sizing.
*/
onGlobeToggled(): Promise<void>;
}