@geogirafe/lib-geoportal
Version:
GeoGirafe is a flexible application to build online geoportals.
54 lines (53 loc) • 1.81 kB
TypeScript
import Map3dComponent from '../../components/map-3d/component.js';
import IGirafeContext from '../context/icontext.js';
export default class CesiumDrawing {
private readonly stateLocation;
private activeShapePoints;
private activeShapes;
private floatingPoint;
private readonly scene;
private readonly handler;
private readonly entities;
private fixedLineLength;
private drawingText;
private readonly context;
private get state();
private get drawingState();
private get config();
/**
* The 3D Map has to be loaded before creating a CesiumDrawing.
* This class is loaded on demand, so that Cesium stays out of the initial bundle.
*/
constructor(map: Map3dComponent, stateLocation: string, context: IGirafeContext);
setFixedLineLength(length: number): void;
setDrawingText(text: string): void;
/**
* A text shape displays the text entered in the tool parameters instead of its generated default name.
* If no text has been entered, the default name is kept so that the shape stays visible on the globe.
*/
private getTextOf;
private activateTool;
private deactivateTool;
private pickOnGlobe;
private removeLastPointAndTerminateShape;
private terminateShape;
private fixLastLength;
private updateShape;
private addPoint;
private leveledCenterToMouse;
private makeRectangle;
private makeRegularPolygon;
private getShapes;
registerInteractions(): void;
unregisterInteractions(): void;
private canExecute;
private getPosition;
private getLength;
private createLabel;
private createPoint;
private getPolygonCenter;
private getPolyLineLabels;
private getPolygonArea;
private getPolyline;
private getPolygonEntity;
}