diff --git a/ui/src/LimitCameraHeightToDepth.ts b/ui/src/LimitCameraHeightToDepth.ts index f5ecaeee1..9dd033e76 100644 --- a/ui/src/LimitCameraHeightToDepth.ts +++ b/ui/src/LimitCameraHeightToDepth.ts @@ -3,8 +3,8 @@ import type {Scene} from 'cesium'; export default class LimitCameraHeightToDepth { - private scene: Scene; - private depth: number; + private readonly scene: Scene; + private readonly depth: number; constructor(scene: Scene, depth: number) { this.scene = scene; diff --git a/ui/src/MapChooser.ts b/ui/src/MapChooser.ts index f314bb926..5c2406cb1 100644 --- a/ui/src/MapChooser.ts +++ b/ui/src/MapChooser.ts @@ -6,8 +6,8 @@ import type {BaseLayerConfig} from './viewer'; import MainStore from './store/main'; export default class MapChooser { - private viewer: Viewer; - private config: BaseLayerConfig[]; + private readonly viewer: Viewer; + private readonly config: BaseLayerConfig[]; public selectedMap: BaseLayerConfig; public elements: NgmMapChooser[] = []; diff --git a/ui/src/NavigableVolumeLimiter.ts b/ui/src/NavigableVolumeLimiter.ts index 3996d7a84..ba2368f59 100644 --- a/ui/src/NavigableVolumeLimiter.ts +++ b/ui/src/NavigableVolumeLimiter.ts @@ -7,8 +7,8 @@ import type {Scene, Rectangle} from 'cesium'; */ export default class NavigableVolumeLimiter { private blockLimiter = false; - private boundingSphere: BoundingSphere; - private ratioFunction: (height: number) => number; + private readonly boundingSphere: BoundingSphere; + private readonly ratioFunction: (height: number) => number; constructor(scene: Scene, rectangle: Rectangle, height: number, ratioFunction: (height: number) => number) { this.boundingSphere = BoundingSphere.fromRectangle3D(rectangle, Ellipsoid.WGS84, height); diff --git a/ui/src/draw/CesiumDraw.ts b/ui/src/draw/CesiumDraw.ts index 6e5411c9f..2c8aa9f4c 100644 --- a/ui/src/draw/CesiumDraw.ts +++ b/ui/src/draw/CesiumDraw.ts @@ -61,10 +61,10 @@ export type DrawEndDetails = { } export class CesiumDraw extends EventTarget { - private viewer_: Viewer; - private strokeColor_: Color; - private strokeWidth_: number; - private fillColor_: Color; + private readonly viewer_: Viewer; + private readonly strokeColor_: Color; + private readonly strokeWidth_: number; + private readonly fillColor_: Color; private eventHandler_: ScreenSpaceEventHandler | undefined; private activePoints_: Cartesian3[] = []; private activePoint_: Cartesian3 | undefined; diff --git a/ui/src/elements/dashboard/ngm-add-member-form.ts b/ui/src/elements/dashboard/ngm-add-member-form.ts index ada09a3e9..0e49d80b4 100644 --- a/ui/src/elements/dashboard/ngm-add-member-form.ts +++ b/ui/src/elements/dashboard/ngm-add-member-form.ts @@ -29,7 +29,7 @@ export class NgmAddMemberForm extends LitElementI18n { accessor email: string | undefined; @state() accessor roleNotSelected = false; - private roleDropdownItems: DropdownItem[] = [ + private readonly roleDropdownItems: DropdownItem[] = [ {title: i18next.t('dashboard_project_viewer'), value: 'viewer'}, {title: i18next.t('dashboard_project_editor'), value: 'editor'}, ]; @@ -105,4 +105,4 @@ export class NgmAddMemberForm extends LitElementI18n { return this; } -} \ No newline at end of file +} diff --git a/ui/src/elements/dashboard/ngm-dashboard.ts b/ui/src/elements/dashboard/ngm-dashboard.ts index 6f01a184b..c3ab86e00 100644 --- a/ui/src/elements/dashboard/ngm-dashboard.ts +++ b/ui/src/elements/dashboard/ngm-dashboard.ts @@ -127,7 +127,7 @@ export class NgmDashboard extends LitElementI18n { private geometries: NgmGeometry[] = []; private recentlyViewedIds: Array = []; private userEmail: string | undefined; - private tempKmlDataSource = new CustomDataSource('tempKmlDataSource'); + private readonly tempKmlDataSource = new CustomDataSource('tempKmlDataSource'); @consume({context: apiClientContext}) accessor apiClient!: ApiClient; diff --git a/ui/src/elements/hide-overflow.ts b/ui/src/elements/hide-overflow.ts index 7cfd3dfec..24db986d6 100644 --- a/ui/src/elements/hide-overflow.ts +++ b/ui/src/elements/hide-overflow.ts @@ -4,7 +4,7 @@ import {customElement} from 'lit/decorators.js'; @customElement('hide-overflow') export class HideOverflow extends LitElement { - private observer: IntersectionObserver; + private readonly observer: IntersectionObserver; constructor() { super(); diff --git a/ui/src/elements/ngm-coordinate-popup.ts b/ui/src/elements/ngm-coordinate-popup.ts index 1756c4b12..e2513a8a1 100644 --- a/ui/src/elements/ngm-coordinate-popup.ts +++ b/ui/src/elements/ngm-coordinate-popup.ts @@ -20,7 +20,7 @@ export class NgmCoordinatePopup extends LitElementI18n { @state() accessor terrainDistance = ''; private eventHandler: ScreenSpaceEventHandler | undefined; - private integerFormat = new Intl.NumberFormat('de-CH', { + private readonly integerFormat = new Intl.NumberFormat('de-CH', { maximumFractionDigits: 1 }); @@ -98,4 +98,4 @@ export class NgmCoordinatePopup extends LitElementI18n { createRenderRoot() { return this; } -} \ No newline at end of file +} diff --git a/ui/src/elements/ngm-cursor-information.ts b/ui/src/elements/ngm-cursor-information.ts index 6ac6f702b..ec909c66c 100644 --- a/ui/src/elements/ngm-cursor-information.ts +++ b/ui/src/elements/ngm-cursor-information.ts @@ -22,7 +22,7 @@ export class NgmCursorInformation extends LitElementI18n { private unlistenMoveStart: any; private unlistenMoveEnd: any; // always use the 'de-CH' locale to always have the simple tick as thousands separator - private integerFormat = new Intl.NumberFormat('de-CH', { + private readonly integerFormat = new Intl.NumberFormat('de-CH', { maximumFractionDigits: 1 }); diff --git a/ui/src/elements/ngm-map-configuration.ts b/ui/src/elements/ngm-map-configuration.ts index fc9d0d5c6..0bd72df6e 100644 --- a/ui/src/elements/ngm-map-configuration.ts +++ b/ui/src/elements/ngm-map-configuration.ts @@ -31,7 +31,7 @@ export class NgmMapConfiguration extends LitElementI18n { accessor baseMapId = 'ch.swisstopo.pixelkarte-grau'; @query('ngm-map-chooser') accessor mapChooserElement; - private debouncedOpacityUpdate = debounce((evt: Event) => this.updateOpacity(Number((evt.target).value)), 250); + private readonly debouncedOpacityUpdate = debounce((evt: Event) => this.updateOpacity(Number((evt.target).value)), 250); private prevExaggeration: number = 1; constructor() { diff --git a/ui/src/elements/ngm-nav-tools.ts b/ui/src/elements/ngm-nav-tools.ts index 462c7b4af..f2ba11549 100644 --- a/ui/src/elements/ngm-nav-tools.ts +++ b/ui/src/elements/ngm-nav-tools.ts @@ -58,7 +58,7 @@ export class NgmNavTools extends LitElementI18n { private zoomingOut = false; private unlistenFromPostRender: Event.RemoveCallback | null = null; private eventHandler: ScreenSpaceEventHandler | undefined; - private stopZoomFunction: () => void = () => this.stopZoom(); + private readonly stopZoomFunction: () => void = () => this.stopZoom(); private refIcon: Entity = new Entity({ position: Cartesian3.ZERO, show: false, @@ -70,14 +70,14 @@ export class NgmNavTools extends LitElementI18n { } }); private moveRef = false; - private julianDate = new JulianDate(); + private readonly julianDate = new JulianDate(); private axisDataSource: CustomDataSource | undefined; private axisCenter: Cartesian3 | undefined; - private oldPolylineUpdate: any = PolylineCollection.prototype.update; - private xyAxisCalculation = (axis, side) => [this.axisCenter, positionFromPxDistance(this.viewer!.scene, this.axisCenter!, AXIS_LENGTH, axis, side)]; - private xAxisCallback = new CallbackProperty(() => this.xyAxisCalculation('x', -1), false); - private yAxisCallback = new CallbackProperty(() => this.xyAxisCalculation('y', 1), false); - private zAxisCallback = new CallbackProperty(() => this.xyAxisCalculation('z', -1), false); + private readonly oldPolylineUpdate: any = PolylineCollection.prototype.update; + private readonly xyAxisCalculation = (axis, side) => [this.axisCenter, positionFromPxDistance(this.viewer!.scene, this.axisCenter!, AXIS_LENGTH, axis, side)]; + private readonly xAxisCallback = new CallbackProperty(() => this.xyAxisCalculation('x', -1), false); + private readonly yAxisCallback = new CallbackProperty(() => this.xyAxisCalculation('y', 1), false); + private readonly zAxisCallback = new CallbackProperty(() => this.xyAxisCalculation('z', -1), false); private exaggeration = 1; constructor() { diff --git a/ui/src/elements/ngm-side-bar.ts b/ui/src/elements/ngm-side-bar.ts index 2fc3952a9..01daac880 100644 --- a/ui/src/elements/ngm-side-bar.ts +++ b/ui/src/elements/ngm-side-bar.ts @@ -91,7 +91,7 @@ export class SideBar extends LitElementI18n { private zoomedToPosition = false; private accordionInited = false; private shareListenerAdded = false; - private shareDownListener = evt => { + private readonly shareDownListener = evt => { if (!evt.composedPath().includes(this)) this.activePanel = null; }; diff --git a/ui/src/layers/ngm-layers-item.ts b/ui/src/layers/ngm-layers-item.ts index e23fe9cbd..9bed758b3 100644 --- a/ui/src/layers/ngm-layers-item.ts +++ b/ui/src/layers/ngm-layers-item.ts @@ -38,8 +38,8 @@ export class NgmLayersItem extends LitElementI18n { accessor movable = false; @query('.menu') accessor actionMenu!: HTMLElement; - private toggleItemSelection = () => this.movable ? Sortable.utils.select(this) : Sortable.utils.deselect(this); - private debouncedOpacityChange = debounce(() => this.changeOpacity(), 250, true); + private readonly toggleItemSelection = () => this.movable ? Sortable.utils.select(this) : Sortable.utils.deselect(this); + private readonly debouncedOpacityChange = debounce(() => this.changeOpacity(), 250, true); firstUpdated() { $(this.querySelector('.ui.dropdown')!).dropdown(); @@ -166,9 +166,9 @@ export class NgmLayersItem extends LitElementI18n { ${i18next.t('dtd_legend')} ` : ''} ${this.config?.geocatId ? html` - Geocat.ch ` : ''} diff --git a/ui/src/measure/MeasureTool.ts b/ui/src/measure/MeasureTool.ts index 939aef444..e5dbd92b7 100644 --- a/ui/src/measure/MeasureTool.ts +++ b/ui/src/measure/MeasureTool.ts @@ -28,7 +28,7 @@ export default class MeasureTool { private readonly measureDataSource = new CustomDataSource('measure'); private readonly measureOptions: MeasureOptions; private measureToolActive = false; - private screenSpaceEventHandler: ScreenSpaceEventHandler | undefined; + private readonly screenSpaceEventHandler: ScreenSpaceEventHandler | undefined; private measurePositions: Cartesian3[] = []; private highlightEntity: Entity | undefined; private points: Entity[] = []; @@ -164,4 +164,4 @@ export default class MeasureTool { this.measureDataSource.entities.removeAll(); this.viewer?.scene.render(); } -} \ No newline at end of file +} diff --git a/ui/src/ngm-app-boot.ts b/ui/src/ngm-app-boot.ts index fa4618c9d..7c13451e5 100644 --- a/ui/src/ngm-app-boot.ts +++ b/ui/src/ngm-app-boot.ts @@ -10,7 +10,7 @@ import {ConfigService} from './api/config.service'; @customElement('ngm-app-boot') export class NgmAppBoot extends LitElement { - private viewerInitialization = new Task(this, { + private readonly viewerInitialization = new Task(this, { task: async () => { const clientConfig = await new ConfigService().getConfig() as ClientConfig; if (!clientConfig) { diff --git a/ui/src/query/ObjectSelector.ts b/ui/src/query/ObjectSelector.ts index 6febb133b..6a06ea921 100644 --- a/ui/src/query/ObjectSelector.ts +++ b/ui/src/query/ObjectSelector.ts @@ -27,8 +27,8 @@ function isTemplateResult(value) { } export default class ObjectSelector { - private viewer: Viewer; - private scene: Scene; + private readonly viewer: Viewer; + private readonly scene: Scene; selectedObj: any | null = null; // todo improve types savedColor: Color | null = null; diff --git a/ui/src/slicer/SlicerArrows.ts b/ui/src/slicer/SlicerArrows.ts index eb88680ed..5e419ee24 100644 --- a/ui/src/slicer/SlicerArrows.ts +++ b/ui/src/slicer/SlicerArrows.ts @@ -69,18 +69,18 @@ export default class SlicerArrows { private enableInputs = true; - private scratchBoundingSphere_ = new BoundingSphere(); - private scratchArrowPosition2d_ = new Cartesian2(); - private scratchOppositeArrowPosition2d_ = new Cartesian2(); - private scratchAxisVector2d_ = new Cartesian2(); - private scratchMouseMoveVector_ = new Cartesian2(); - private scratchObjectMoveVector2d_ = new Cartesian2(); - private scratchNewArrowPosition2d_ = new Cartesian2(); - private axisVector3d = new Cartesian3(); - private scratchLeft = new Cartesian3(); - private scratchRight = new Cartesian3(); - private scratchTop = new Cartesian3(); - private scratchBottom = new Cartesian3(); + private readonly scratchBoundingSphere_ = new BoundingSphere(); + private readonly scratchArrowPosition2d_ = new Cartesian2(); + private readonly scratchOppositeArrowPosition2d_ = new Cartesian2(); + private readonly scratchAxisVector2d_ = new Cartesian2(); + private readonly scratchMouseMoveVector_ = new Cartesian2(); + private readonly scratchObjectMoveVector2d_ = new Cartesian2(); + private readonly scratchNewArrowPosition2d_ = new Cartesian2(); + private readonly axisVector3d = new Cartesian3(); + private readonly scratchLeft = new Cartesian3(); + private readonly scratchRight = new Cartesian3(); + private readonly scratchTop = new Cartesian3(); + private readonly scratchBottom = new Cartesian3(); private eventHandler: (ScreenSpaceEventHandler | null) = null; highlightedArrow: Entity | undefined = undefined; diff --git a/ui/src/store/auth.ts b/ui/src/store/auth.ts index c1ba6a919..802aac782 100644 --- a/ui/src/store/auth.ts +++ b/ui/src/store/auth.ts @@ -2,7 +2,7 @@ import {BehaviorSubject} from 'rxjs'; import type {AuthUser} from '../authService'; export default class AuthStore { - private static userSubject = new BehaviorSubject(null); + private static readonly userSubject = new BehaviorSubject(null); static get user(): BehaviorSubject { return this.userSubject; diff --git a/ui/src/store/dashboard.ts b/ui/src/store/dashboard.ts index be2a97f32..5f5dcee7c 100644 --- a/ui/src/store/dashboard.ts +++ b/ui/src/store/dashboard.ts @@ -24,12 +24,12 @@ export type ProjectParamSubject = { export type ProjectMode = 'edit' | 'viewEdit' | 'viewOnly' | undefined export default class DashboardStore { - private static selectedTopicOrProjectSubject = new BehaviorSubject(undefined); - private static viewIndexSubject = new Subject(); - private static topicOrProjectParamSubject = new BehaviorSubject(undefined); - private static projectModeSubject = new BehaviorSubject(undefined); - private static geometriesSubject = new Subject(); - private static showSaveOrCancelWarningSubject = new Subject(); + private static readonly selectedTopicOrProjectSubject = new BehaviorSubject(undefined); + private static readonly viewIndexSubject = new Subject(); + private static readonly topicOrProjectParamSubject = new BehaviorSubject(undefined); + private static readonly projectModeSubject = new BehaviorSubject(undefined); + private static readonly geometriesSubject = new Subject(); + private static readonly showSaveOrCancelWarningSubject = new Subject(); static get selectedTopicOrProject(): BehaviorSubject { return this.selectedTopicOrProjectSubject; diff --git a/ui/src/store/draw.ts b/ui/src/store/draw.ts index 01a137b54..15facd146 100644 --- a/ui/src/store/draw.ts +++ b/ui/src/store/draw.ts @@ -2,8 +2,8 @@ import {BehaviorSubject} from 'rxjs'; import type {CesiumDraw} from '../draw/CesiumDraw'; export default class DrawStore { - private static drawSubject = new BehaviorSubject(undefined); - private static drawStateSubject = new BehaviorSubject(false); + private static readonly drawSubject = new BehaviorSubject(undefined); + private static readonly drawStateSubject = new BehaviorSubject(false); static measureState = new BehaviorSubject(false); static setDrawState(value: boolean): void { diff --git a/ui/src/store/main.ts b/ui/src/store/main.ts index 66ee92b85..d49fad30a 100644 --- a/ui/src/store/main.ts +++ b/ui/src/store/main.ts @@ -5,21 +5,21 @@ import {getIonToken, setIonToken} from '../permalink'; import {IonAsset} from '../api-ion'; export default class MainStore { - private static viewerSubject = new BehaviorSubject(null); - private static mapChooserSubject = new BehaviorSubject(null); - private static layersRemovedSubject = new Subject(); - private static syncMapSubject = new Subject(); - private static voxelLayerCountSubject = new BehaviorSubject([]); - private static ionTokenSubject = new BehaviorSubject(getIonToken()); - private static ionAssetSubject = new Subject(); - private static removeIonAssetsSubject = new Subject(); + private static readonly viewerSubject = new BehaviorSubject(null); + private static readonly mapChooserSubject = new BehaviorSubject(null); + private static readonly layersRemovedSubject = new Subject(); + private static readonly syncMapSubject = new Subject(); + private static readonly voxelLayerCountSubject = new BehaviorSubject([]); + private static readonly ionTokenSubject = new BehaviorSubject(getIonToken()); + private static readonly ionAssetSubject = new Subject(); + private static readonly removeIonAssetsSubject = new Subject(); static setUrlLayersSubject = new Subject(); static syncLayerParams = new Subject(); /** * List of uploaded KML dataSource names. Required to get list of uploaded layers and update properties in batch (e.g. exaggeration) * @private */ - private static uploadedKmlListSubject = new BehaviorSubject([]); + private static readonly uploadedKmlListSubject = new BehaviorSubject([]); static get viewer(): BehaviorSubject { return this.viewerSubject; diff --git a/ui/src/store/navTools.ts b/ui/src/store/navTools.ts index 482dab6ba..6b0affb5f 100644 --- a/ui/src/store/navTools.ts +++ b/ui/src/store/navTools.ts @@ -3,11 +3,11 @@ import type {LockType} from '../elements/ngm-cam-configuration'; import type {Cartesian3} from 'cesium'; export default class NavToolsStore { - private static syncTargetPointSubject = new Subject(); - private static cameraHeightSubject = new Subject(); - private static hideTargetPointSubject = new Subject(); - private static navLockTypeSubject = new BehaviorSubject(''); - private static targetPointPositionSubject = new BehaviorSubject(undefined); + private static readonly syncTargetPointSubject = new Subject(); + private static readonly cameraHeightSubject = new Subject(); + private static readonly hideTargetPointSubject = new Subject(); + private static readonly navLockTypeSubject = new BehaviorSubject(''); + private static readonly targetPointPositionSubject = new BehaviorSubject(undefined); static exaggerationChanged = new Subject(); static get syncTargetPoint() { diff --git a/ui/src/store/query.ts b/ui/src/store/query.ts index df294f6f4..1ee3eee15 100644 --- a/ui/src/store/query.ts +++ b/ui/src/store/query.ts @@ -2,7 +2,7 @@ import {Subject} from 'rxjs'; import type {QueryResult} from '../query/types'; export default class QueryStore { - private static objectInfoSubject = new Subject(); + private static readonly objectInfoSubject = new Subject(); static setObjectInfo(attributes: QueryResult | undefined): void { if (attributes && !Object.getOwnPropertyNames(attributes).length) diff --git a/ui/src/store/toolbox.ts b/ui/src/store/toolbox.ts index 25301a222..2c5e79d66 100644 --- a/ui/src/store/toolbox.ts +++ b/ui/src/store/toolbox.ts @@ -20,14 +20,14 @@ export interface GeometryAction { export type GeometryCreateOptions = {geometry: NgmGeometry, slice?: boolean}; export default class ToolboxStore { - private static slicerSubject = new BehaviorSubject(null); - private static rtcSubject = new Subject(); - private static geometriesSubject = new BehaviorSubject([]); - private static noEditGeometriesSubject = new BehaviorSubject([]); - private static openedGeometryOptionsSubject = new BehaviorSubject(null); - private static sliceGeometrySubject = new BehaviorSubject(null); - private static geomActionSubject = new Subject(); - private static syncSliceSubject = new Subject(); + private static readonly slicerSubject = new BehaviorSubject(null); + private static readonly rtcSubject = new Subject(); + private static readonly geometriesSubject = new BehaviorSubject([]); + private static readonly noEditGeometriesSubject = new BehaviorSubject([]); + private static readonly openedGeometryOptionsSubject = new BehaviorSubject(null); + private static readonly sliceGeometrySubject = new BehaviorSubject(null); + private static readonly geomActionSubject = new Subject(); + private static readonly syncSliceSubject = new Subject(); static get slicer(): BehaviorSubject { return this.slicerSubject; diff --git a/ui/src/toolbox/GeometryController.ts b/ui/src/toolbox/GeometryController.ts index 9508feb39..fcecadc13 100644 --- a/ui/src/toolbox/GeometryController.ts +++ b/ui/src/toolbox/GeometryController.ts @@ -47,11 +47,11 @@ import {saveAs} from 'file-saver'; export class GeometryController { private draw: CesiumDraw | undefined; - private toastPlaceholder: HTMLElement; + private readonly toastPlaceholder: HTMLElement; private viewer: Viewer | null = null; - private unlistenEditPostRender: Event.RemoveCallback | undefined; - private geometriesDataSource: CustomDataSource; - private julianDate = new JulianDate(); + private readonly unlistenEditPostRender: Event.RemoveCallback | undefined; + private readonly geometriesDataSource: CustomDataSource; + private readonly julianDate = new JulianDate(); private selectedArea: Entity | undefined; private screenSpaceEventHandler: ScreenSpaceEventHandler | undefined; private geometriesCounter: AreasCounter = { @@ -60,7 +60,7 @@ export class GeometryController { rectangle: 0, polygon: 0 }; - private noEdit: boolean; + private readonly noEdit: boolean; constructor(geometriesDataSource: CustomDataSource, toastPlaceholder: HTMLElement, noEdit = false) { this.geometriesDataSource = geometriesDataSource; diff --git a/ui/src/toolbox/ngm-draw-section.ts b/ui/src/toolbox/ngm-draw-section.ts index a47bd2a84..512961ff9 100644 --- a/ui/src/toolbox/ngm-draw-section.ts +++ b/ui/src/toolbox/ngm-draw-section.ts @@ -24,7 +24,7 @@ export class NgmDrawSection extends LitElementI18n { accessor hidden = true; @state() accessor lineInfo: DrawInfo | undefined; - private draw: CesiumDraw | undefined; + private readonly draw: CesiumDraw | undefined; private drawGeometries = [ {label: () => i18next.t('tbx_add_point_btn_label'), type: 'point', icon: 'ngm-point-draw-icon'}, {label: () => i18next.t('tbx_add_line_btn_label'), type: 'line', icon: 'ngm-line-draw-icon'}, diff --git a/ui/src/toolbox/ngm-geometry-edit.ts b/ui/src/toolbox/ngm-geometry-edit.ts index 6fd79bbd8..fd7db8610 100644 --- a/ui/src/toolbox/ngm-geometry-edit.ts +++ b/ui/src/toolbox/ngm-geometry-edit.ts @@ -42,11 +42,11 @@ export class NgmGeometryEdit extends LitElementI18n { accessor validLowerLimit = true; private editingEntity: Entity | undefined; private viewer: Viewer | null | undefined; - private minVolumeHeight = 1; - private maxVolumeHeight = 30000; - private minVolumeLowerLimit = -30000; - private maxVolumeLowerLimit = 30000; - private julianDate = new JulianDate(); + private readonly minVolumeHeight = 1; + private readonly maxVolumeHeight = 30000; + private readonly minVolumeLowerLimit = -30000; + private readonly maxVolumeLowerLimit = 30000; + private readonly julianDate = new JulianDate(); private draw: CesiumDraw | undefined; private unsubscribeFromChanges: Event.RemoveCallback | undefined; private geometriesDataSource: CustomDataSource | undefined; diff --git a/ui/src/toolbox/ngm-gst-interaction.ts b/ui/src/toolbox/ngm-gst-interaction.ts index 3e1a89bc0..7de8eff90 100644 --- a/ui/src/toolbox/ngm-gst-interaction.ts +++ b/ui/src/toolbox/ngm-gst-interaction.ts @@ -31,8 +31,8 @@ export class NgmGstInteraction extends LitElementI18n { @state() accessor selectedId: string | undefined; private viewer: Viewer | null = null; - private minDepth_ = -6000; - private maxDepth_ = 1000; + private readonly minDepth_ = -6000; + private readonly maxDepth_ = 1000; private outputFormat: OutputFormat = 'pdf'; private abortController = new AbortController(); private extentInited = false; diff --git a/ui/src/toolbox/ngm-measure.ts b/ui/src/toolbox/ngm-measure.ts index 7ccf0037c..1d6a796c2 100644 --- a/ui/src/toolbox/ngm-measure.ts +++ b/ui/src/toolbox/ngm-measure.ts @@ -17,7 +17,7 @@ export class NgmMeasure extends LitElementI18n { @state() accessor lineInfo: DrawInfo | undefined; private measure: MeasureTool | undefined; - private integerFormat = new Intl.NumberFormat('de-CH', { + private readonly integerFormat = new Intl.NumberFormat('de-CH', { maximumFractionDigits: 1 }); diff --git a/ui/src/toolbox/ngm-point-edit.ts b/ui/src/toolbox/ngm-point-edit.ts index c72c4a250..4e2de070b 100644 --- a/ui/src/toolbox/ngm-point-edit.ts +++ b/ui/src/toolbox/ngm-point-edit.ts @@ -29,7 +29,7 @@ export class NgmPointEdit extends LitElementI18n { maxHeight = 30000; minDepth = -30000; maxDepth = 30000; - private julianDate: JulianDate = new JulianDate(); + private readonly julianDate: JulianDate = new JulianDate(); private viewer: Viewer | null = null; @query('.dropdown') diff --git a/ui/src/toolbox/ngm-toolbox.ts b/ui/src/toolbox/ngm-toolbox.ts index de85b4837..dcc51845d 100644 --- a/ui/src/toolbox/ngm-toolbox.ts +++ b/ui/src/toolbox/ngm-toolbox.ts @@ -44,7 +44,7 @@ export class NgmToolbox extends LitElementI18n { geometriesDataSource: CustomDataSource = new CustomDataSource(GEOMETRY_DATASOURCE_NAME); noEditGeometriesDataSource: CustomDataSource = new CustomDataSource(NO_EDIT_GEOMETRY_DATASOURCE_NAME); private viewer: Viewer | null = null; - private julianDate = new JulianDate(); + private readonly julianDate = new JulianDate(); private draw: CesiumDraw | undefined; private geometryController: GeometryController | undefined; private geometryControllerNoEdit: GeometryController | undefined; diff --git a/ui/src/toolbox/ngm-topo-profile-modal.ts b/ui/src/toolbox/ngm-topo-profile-modal.ts index d1ea07751..16d9dbe14 100644 --- a/ui/src/toolbox/ngm-topo-profile-modal.ts +++ b/ui/src/toolbox/ngm-topo-profile-modal.ts @@ -48,15 +48,15 @@ export class NgmTopoProfileModal extends LitElementI18n { @query('.ngm-profile-tooltip') accessor profileTooltip; private viewer: Viewer | null | undefined; - private bisect = bisector((d) => d.domainDist).left; + private readonly bisect = bisector((d) => d.domainDist).left; private linestring: number[][] | undefined; private data: ProfileData[] = []; private name: string | undefined; private profileInfo: any | undefined; private domain: any; private distInKM = false; - private highlightPointPosition: Cartesian3 = new Cartesian3(); - private highlightPoint = new Entity({ + private readonly highlightPointPosition: Cartesian3 = new Cartesian3(); + private readonly highlightPoint = new Entity({ position: new CallbackProperty(() => this.highlightPointPosition, false), point: { show: new CallbackProperty(() => this.showTooltip, false),