+ `}
${this.assets?.map((kml, index) => {
return html`
@@ -86,4 +95,4 @@ export class NgmProjectAssetsSection extends LitElementI18n {
return this;
}
-}
\ No newline at end of file
+}
diff --git a/ui/src/elements/ngm-auth.ts b/ui/src/elements/ngm-auth.ts
index d5726ac93..e8aef4bb6 100644
--- a/ui/src/elements/ngm-auth.ts
+++ b/ui/src/elements/ngm-auth.ts
@@ -1,13 +1,13 @@
-import {html} from 'lit';
+import {css, html} from 'lit';
import type {AuthUser} from '../authService';
import AuthService from '../authService';
import {LitElementI18n} from '../i18n.js';
import auth from '../store/auth';
-import {classMap} from 'lit/directives/class-map.js';
import {customElement, property, state} from 'lit/decorators.js';
import DashboardStore from '../store/dashboard';
import {consume} from '@lit/context';
import {authServiceContext} from '../context';
+import '../components/core';
/**
* Authentication component
@@ -61,16 +61,29 @@ export class NgmAuth extends LitElementI18n {
this.authService.logout();
}
- render() {
- return html`
-
`;
- }
+ readonly render = () => html`
+
+
+
+ `;
- createRenderRoot() {
- // no shadow dom
- return this;
- }
+ static readonly styles = css`
+ div {
+ color: var(--color-bg);
+ background-color: var(--color-main);
+ width: 36px;
+ height: 36px;
+ border-radius: 50%;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ cursor: pointer;
+ }
+
+ ngm-core-icon {
+ width: 20px;
+ height: 20px;
+ }
+ `;
}
diff --git a/ui/src/elements/ngm-cursor-information.ts b/ui/src/elements/ngm-cursor-information.ts
index ec909c66c..3419f6102 100644
--- a/ui/src/elements/ngm-cursor-information.ts
+++ b/ui/src/elements/ngm-cursor-information.ts
@@ -1,4 +1,4 @@
-import {html} from 'lit';
+import {css, html} from 'lit';
import i18next from 'i18next';
import {LitElementI18n} from '../i18n.js';
import type {Viewer} from 'cesium';
@@ -73,23 +73,62 @@ export class NgmCursorInformation extends LitElementI18n {
render() {
if (!this.coordinates || this.height === undefined) return '';
return html`
-
-
-
-
+
+
+
+
+
+
+
+ ${this.showTerrainHeight ? i18next.t('nav_terrain_height_label') : i18next.t('nav_object_height_label')}
-
-
- ${this.showTerrainHeight ? i18next.t('nav_terrain_height_label') : i18next.t('nav_object_height_label')}
-
-
- ${this.height !== undefined && this.integerFormat.format(this.height)} m
-
+
+ ${this.height !== undefined && this.integerFormat.format(this.height)} m
- `;
+
+ `;
}
- createRenderRoot() {
- return this;
- }
+
+ static readonly styles = css`
+ :host {
+ min-width: 0;
+ }
+
+ .ngm-nci-height,
+ .ngm-nci-position {
+ display: none;
+ }
+
+ @media (min-width: 1200px) {
+ :host .ngm-nci-value {
+ font-weight: 600;
+ min-width: 75px;
+ }
+
+ .ngm-nci-position {
+ display: unset;
+ width: 83px;
+ margin-right: 20px;
+ }
+
+ .ngm-nci-height {
+ display: flex;
+ flex-direction: column;
+ white-space: nowrap;
+ margin-right: 10px;
+ }
+
+ :host {
+ flex-wrap: wrap;
+ align-self: center;
+ color: #212529;
+ text-align: left;
+ font: normal normal normal 14px/20px Inter, sans-serif;
+ letter-spacing: 0;
+ min-width: 255px;
+ padding-right:48px
+ }
+ }
+ `;
}
diff --git a/ui/src/elements/ngm-map-configuration.ts b/ui/src/elements/ngm-map-configuration.ts
index 0bd72df6e..8afc1785a 100644
--- a/ui/src/elements/ngm-map-configuration.ts
+++ b/ui/src/elements/ngm-map-configuration.ts
@@ -4,16 +4,14 @@ import i18next from 'i18next';
import {LitElementI18n} from '../i18n.js';
import {classMap} from 'lit-html/directives/class-map.js';
import './ngm-map-chooser';
-import {getMapOpacityParam, setExaggeration, syncMapOpacityParam} from '../permalink';
+import {getMapOpacityParam, syncMapOpacityParam} from '../permalink';
import MainStore from '../store/main';
import {
- CustomDataSource, DataSource, DataSourceCollection,
+
Viewer
} from 'cesium';
import type MapChooser from '../MapChooser.js';
import {debounce} from '../utils';
-import {updateExaggerationForKmlDataSource} from '../cesiumutils';
-import NavToolsStore from '../store/navTools';
@customElement('ngm-map-configuration')
export class NgmMapConfiguration extends LitElementI18n {
@@ -24,29 +22,16 @@ export class NgmMapConfiguration extends LitElementI18n {
@state()
accessor opacity: number = getMapOpacityParam();
@state()
- accessor exaggeration: number = 1;
- @state()
- accessor hideExaggeration = false;
- @state()
accessor baseMapId = 'ch.swisstopo.pixelkarte-grau';
@query('ngm-map-chooser')
accessor mapChooserElement;
private readonly debouncedOpacityUpdate = debounce((evt: Event) => this.updateOpacity(Number((
evt.target).value)), 250);
- private prevExaggeration: number = 1;
constructor() {
super();
MainStore.viewer.subscribe(viewer => {
this.viewer = viewer;
- this.exaggeration = this.viewer?.scene.verticalExaggeration || 1;
- this.prevExaggeration = this.exaggeration;
- this.viewer?.dataSources.dataSourceAdded.addEventListener((_collection: DataSourceCollection, dataSource: DataSource | CustomDataSource) => {
- if (MainStore.uploadedKmlNames.includes(dataSource.name)) {
- const exaggeration = this.hideExaggeration ? 1 : this.exaggeration;
- updateExaggerationForKmlDataSource(dataSource, exaggeration, 1);
- }
- });
});
MainStore.mapChooser.subscribe(chooser => {
this.mapChooser = chooser;
@@ -97,29 +82,6 @@ export class NgmMapConfiguration extends LitElementI18n {
this.requestUpdate();
}
- updateExaggerationForKmls() {
- const exaggeration = this.hideExaggeration ? 1 : this.exaggeration;
- MainStore.uploadedKmlNames.forEach(name => {
- const dataSource = this.viewer?.dataSources.getByName(name)[0];
- updateExaggerationForKmlDataSource(dataSource, exaggeration, this.prevExaggeration);
- });
- this.prevExaggeration = exaggeration;
- this.viewer?.scene.requestRender();
- }
-
- updateExaggeration(evt: InputEvent) {
- if (this.viewer) {
- if (this.hideExaggeration) {
- this.hideExaggeration = false;
- }
- this.exaggeration = Number((evt.target).value);
- this.viewer.scene.verticalExaggeration = this.exaggeration;
- // workaround for billboards positioning
- setTimeout(() => this.viewer!.scene.requestRender(), 500);
- setExaggeration(this.exaggeration);
- NavToolsStore.exaggerationChanged.next(this.exaggeration);
- }
- }
render() {
return html`
@@ -153,36 +115,6 @@ export class NgmMapConfiguration extends LitElementI18n {
-
-
{
- if (!this.viewer) return;
- this.hideExaggeration = !this.hideExaggeration;
- const exaggeration = this.hideExaggeration ? 1 : this.exaggeration;
- this.viewer.scene.verticalExaggeration = exaggeration;
- this.updateExaggerationForKmls();
- NavToolsStore.exaggerationChanged.next(exaggeration);
- this.viewer.scene.requestRender();
- }}>
-
-
-
-
-
-
this.updateExaggeration(evt)}
- @pointerup=${debounce(() => this.updateExaggerationForKmls(), 300)}>
-
-
`;
}
diff --git a/ui/src/elements/ngm-side-bar.ts b/ui/src/elements/ngm-side-bar.ts
index 2358a7a63..77b0c3aa5 100644
--- a/ui/src/elements/ngm-side-bar.ts
+++ b/ui/src/elements/ngm-side-bar.ts
@@ -4,6 +4,8 @@ import '../toolbox/ngm-toolbox';
import '../layers/ngm-layers';
import '../layers/ngm-layers-sort';
import './dashboard/ngm-dashboard';
+import './sidebar/ngm-menu-item';
+import '../components/core';
import '../components/navigation/navigation-layer-panel';
import LayersActions from '../layers/LayersActions';
import {DEFAULT_LAYER_OPACITY, LayerType} from '../constants';
@@ -46,7 +48,7 @@ import type QueryManager from '../query/QueryManager';
import DashboardStore from '../store/dashboard';
import {getAssets} from '../api-ion';
-import {LayerEvent, LayersUpdateEvent} from '../components/layers/layers-display';
+import {LayerEvent, LayersUpdateEvent} from '../components/layer/layer-display';
export type SearchLayer =
| SearchLayerWithLayer
@@ -87,7 +89,7 @@ export class SideBar extends LitElementI18n {
// TODO change this back to `null`
@state()
- accessor activePanel: string | null = null;
+ accessor activePanel: string | null = 'data';
@state()
accessor showHeader = false;
@state()
@@ -181,10 +183,20 @@ export class SideBar extends LitElementI18n {
});
const sliceOptions = getSliceParam();
- if (sliceOptions && sliceOptions.type && sliceOptions.slicePoints)
+ if (sliceOptions?.type && sliceOptions.slicePoints)
this.activePanel = 'tools';
}
+ private readonly renderMenuItem = (icon: string, title: string, panel: string) => html`
+
this.togglePanel(panel)}
+ >
+ `;
+
render() {
if (!this.queryManager) {
return '';
@@ -193,16 +205,17 @@ export class SideBar extends LitElementI18n {
this.queryManager.activeLayers = this.activeLayers
.filter(config => config.visible && !config.noQuery);
- const shareBtn = html`
-
this.togglePanel('share')}>
-
-
`;
- const settingsBtn = html`
-
this.togglePanel('settings')}>
-
-
`;
+
+ const layerBtn = this.renderMenuItem('layer', 'menu_layers', 'data');
+ const toolsBtn = this.renderMenuItem('tools', 'menu_tools', 'tools');
+ const projectsBtn = this.renderMenuItem('projects', 'menu_projects', 'dashboard');
+ const shareBtn = this.renderMenuItem('share', 'menu_share', 'share');
+ const settingsBtn = this.renderMenuItem('config', 'menu_settings', 'settings');
+ const mobileExpandBtn = html`
+
this.mobileShowAll = !this.mobileShowAll}
+ >`;
return html`
-