Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Add units to attribute, add showOnMap to markers

Robin Dekkers67eeb3a4ad99
diff --git a/deployment/manager/shared/locales/de/or.json b/deployment/manager/shared/locales/de/or.json
index 2b447d4f1..85279cf0f 100644
--- a/deployment/manager/shared/locales/de/or.json
+++ b/deployment/manager/shared/locales/de/or.json
@@ -105,5 +105,14 @@
"wait": "Warte",
"history": "Historie",
"attributes": "Attribute",
- "info": "Info"
+ "info": "Info",
+ "KILOGRAM": "KG",
+ "EUR":"€",
+ "KILOWATT": "KILOWATT",
+ "KWH": "KWH",
+ "KILOWATT_PER_HOUR": "KILOWATT_PER_HOUR",
+ "MILLIMETER_PER_SQUARE_METER": "MILLIMETER_PER_SQUARE_METER",
+ "METERS_PER_HOUR": "METERS_PER_HOUR",
+ "DEGREES": "DEGREES",
+ "CELSIUS": "CELSIUS"
}
diff --git a/deployment/manager/shared/locales/en/or.json b/deployment/manager/shared/locales/en/or.json
index 662d84470..0664e5e16 100644
--- a/deployment/manager/shared/locales/en/or.json
+++ b/deployment/manager/shared/locales/en/or.json
@@ -166,5 +166,14 @@
"oncePerDay": "Once per day",
"oncePerWeek": "Once per week",
"reset": "Reset",
- "noLongerMatches": "No longer matches"
+ "noLongerMatches": "No longer matches",
+ "KILOGRAM": "KG",
+ "EUR":"€",
+ "KILOWATT": "KILOWATT",
+ "KWH": "KWH",
+ "KILOWATT_PER_HOUR": "KILOWATT_PER_HOUR",
+ "MILLIMETER_PER_SQUARE_METER": "MILLIMETER_PER_SQUARE_METER",
+ "METERS_PER_HOUR": "METERS_PER_HOUR",
+ "DEGREES": "DEGREES",
+ "CELSIUS": "CELSIUS"
}
diff --git a/deployment/manager/shared/locales/es/or.json b/deployment/manager/shared/locales/es/or.json
index 03e1e0d0b..bbeb2d39d 100644
--- a/deployment/manager/shared/locales/es/or.json
+++ b/deployment/manager/shared/locales/es/or.json
@@ -105,5 +105,14 @@
"wait": "Espere",
"history": "Historia",
"attributes": "Atributos",
- "info": "Informacion"
+ "info": "Informacion",
+ "KILOGRAM": "KG",
+ "EUR":"€",
+ "KILOWATT": "KILOWATT",
+ "KWH": "KWH",
+ "KILOWATT_PER_HOUR": "KILOWATT_PER_HOUR",
+ "MILLIMETER_PER_SQUARE_METER": "MILLIMETER_PER_SQUARE_METER",
+ "METERS_PER_HOUR": "METERS_PER_HOUR",
+ "DEGREES": "DEGREES",
+ "CELSIUS": "CELSIUS"
}
diff --git a/deployment/manager/shared/locales/fr/or.json b/deployment/manager/shared/locales/fr/or.json
index 080f4c832..b188cdcf3 100644
--- a/deployment/manager/shared/locales/fr/or.json
+++ b/deployment/manager/shared/locales/fr/or.json
@@ -105,5 +105,14 @@
"wait": "Attendre",
"history": "Historique",
"attributes": "Attributs",
- "info": "Info"
+ "info": "Info",
+ "KILOGRAM": "KG",
+ "EUR":"€",
+ "KILOWATT": "KILOWATT",
+ "KWH": "KWH",
+ "KILOWATT_PER_HOUR": "KILOWATT_PER_HOUR",
+ "MILLIMETER_PER_SQUARE_METER": "MILLIMETER_PER_SQUARE_METER",
+ "METERS_PER_HOUR": "METERS_PER_HOUR",
+ "DEGREES": "DEGREES",
+ "CELSIUS": "CELSIUS"
}
diff --git a/deployment/manager/shared/locales/nl/or.json b/deployment/manager/shared/locales/nl/or.json
index 5d3747b6a..da8e8e8b6 100644
--- a/deployment/manager/shared/locales/nl/or.json
+++ b/deployment/manager/shared/locales/nl/or.json
@@ -166,5 +166,15 @@
"oncePerDay": "Max. 1x per dag",
"oncePerWeek": "Max. 1x per week",
"reset": "Reset",
- "noLongerMatches": "Niet meer geldig"
+ "noLongerMatches": "Niet meer geldig",
+ "KILOGRAM": "KG",
+ "EUR":"€",
+ "KILOWATT": "KILOWATT",
+ "KWH": "KWH",
+ "KILOWATT_PER_HOUR": "KILOWATT_PER_HOUR",
+ "MILLIMETER_PER_SQUARE_METER": "MILLIMETER_PER_SQUARE_METER",
+ "METERS_PER_HOUR": "METERS_PER_HOUR",
+ "DEGREES": "DEGREES",
+ "CELSIUS": "CELSIUS",
+ "KILOGRAM_CARBON_PER_KILOWATT_HOUR":"KILOGRAM_CARBON_PER_KILOWATT_HOUR"
}
diff --git a/manager/build/install/manager/.gitignore b/manager/build/install/manager/.gitignore
deleted file mode 100644
index 0dc113474..000000000
--- a/manager/build/install/manager/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-# Only here to prevent docker-compose commands failing
\ No newline at end of file
diff --git a/ui/app/main/src/components/or-asset-summary-card.ts b/ui/app/main/src/components/or-asset-summary-card.ts
index aca0c306d..59d552457 100644
--- a/ui/app/main/src/components/or-asset-summary-card.ts
+++ b/ui/app/main/src/components/or-asset-summary-card.ts
@@ -10,7 +10,7 @@ import {
TemplateResult,
unsafeCSS
} from "lit-element";
-import {Asset, AssetEvent, AssetEventCause, AttributeEvent, AttributeType, AttributeValueType} from "@openremote/model";
+import {Asset, AssetEvent, AssetEventCause, AttributeEvent, AttributeType, AttributeValueType, MetaItemType, AttributeDescriptor} from "@openremote/model";
import manager, {
AssetModelUtil,
DefaultColor1,
@@ -25,6 +25,7 @@ import "@openremote/or-icon";
import {router} from "../index";
import "./or-attribute-field/src";
import {orAttributeTemplateProvider} from "./or-attribute-field/src";
+import { i18next } from "@openremote/or-translate/src";
orAttributeTemplateProvider.setTemplate((attribute) => {
let template;
@@ -220,6 +221,9 @@ export class OrAssetSummaryCard extends subscribe(manager)(LitElement) {
const icon = this.getIcon();
const color = this.getColor();
const styleStr = color ? "--internal-or-asset-summary-card-header-color: #" + color + ";" : "";
+
+
+
return html`
<div id="card-container" style="${styleStr}">
<div id="header">
@@ -229,7 +233,13 @@ export class OrAssetSummaryCard extends subscribe(manager)(LitElement) {
<div id="attribute-list">
<ul>
${Util.getAssetAttributes(this.asset).filter((attr) => attr.name !== AttributeType.LOCATION.attributeName).map((attr) => {
- return html`<li><or-translate class="attribute-name" value="${attr.name}"></or-translate><span class="attribute-value"><or-attribute-field .attribute="${attr}"></or-attribute-field></span></li>`;
+ let attributeDescriptor: AttributeDescriptor | undefined = AssetModelUtil.getAttributeDescriptorFromAsset(attr.name!);
+ let label = Util.getAttributeLabel(attr, attributeDescriptor);
+ const unit = Util.getMetaValue(MetaItemType.UNIT_TYPE, attr, attributeDescriptor);
+
+ if(unit)
+ label = label + " ("+i18next.t(unit)+")";
+ return html`<li>${label}<span class="attribute-value"><or-attribute-field .attribute="${attr}"></or-attribute-field></span></li>`;
})}
</ul>
</div>
diff --git a/ui/component/or-asset-viewer/src/index.ts b/ui/component/or-asset-viewer/src/index.ts
index 31514a789..0810f09c3 100644
--- a/ui/component/or-asset-viewer/src/index.ts
+++ b/ui/component/or-asset-viewer/src/index.ts
@@ -21,7 +21,8 @@ import {
Attribute,
AttributeEvent,
AttributeType,
- MetaItemType
+ MetaItemType,
+ MetaItem
} from "@openremote/model";
import {style} from "./style";
import i18next from "i18next";
@@ -98,8 +99,9 @@ export class OrAssetViewer extends subscribe(manager)(translate(i18next)(LitElem
},
panels: {
"info": {
- type: "property",
+ type: "attribute",
hideOnMobile: true,
+ include: ["userNotes", "brand"],
panelStyles: {
},
fieldStyles: {
@@ -344,21 +346,23 @@ export class OrAssetViewer extends subscribe(manager)(translate(i18next)(LitElem
let content: TemplateResult | undefined;
- if (panelConfig && panelConfig.type === "property") {
- // Special handling for info panel which only shows properties
- let properties = OrAssetViewer.getInfoProperties(panelConfig);
- if (properties.length === 0) {
- return;
- }
+ // if (panelConfig && panelConfig.type === "property") {
+ // // Special handling for info panel which only shows properties
+ // let properties = OrAssetViewer.getInfoProperties(panelConfig);
- content = html`
- ${properties.map((prop) => {
- let style = styles ? styles[prop!] : undefined;
- return prop === "attributes" ? `` : OrAssetViewer.getField(prop, true, style, OrAssetViewer.getPropertyTemplate(prop, (asset as { [index: string]: any })[prop], viewerConfig, panelConfig, shadowRoot));
- })}
- `;
- } else if (panelConfig && panelConfig.type === "history") {
+ // if (properties.length === 0) {
+ // return;
+ // }
+
+ // content = html`
+ // ${properties.map((prop) => {
+ // let style = styles ? styles[prop!] : undefined;
+ // return prop === "attributes" ? `` : OrAssetViewer.getField(prop, true, style, OrAssetViewer.getPropertyTemplate(prop, (asset as { [index: string]: any })[prop], viewerConfig, panelConfig, shadowRoot));
+ // })}
+ // `;
+ // } else
+ if (panelConfig && panelConfig.type === "history") {
// Special handling for history panel which shows an attribute selector and a graph/data table of historical values
const historyAttrs = attrs.filter((attr) => Util.getFirstMetaItem(attr, MetaItemType.STORE_DATA_POINTS.urn!));
if (historyAttrs.length > 0) {
@@ -416,7 +420,7 @@ export class OrAssetViewer extends subscribe(manager)(translate(i18next)(LitElem
}
}
- @media screen and (max-width: 1700px) {
+ @media screen and (max-width: 1500px) {
#history-controls {
position: unset;
margin: 0 auto 10px auto;
@@ -463,6 +467,36 @@ export class OrAssetViewer extends subscribe(manager)(translate(i18next)(LitElem
const lngLat = MapUtil.getLngLat(attribute);
const center = lngLat ? lngLat.toArray() : undefined;
const showOnMapMeta = Util.getFirstMetaItem(attribute, MetaItemType.SHOW_ON_DASHBOARD.urn!);
+ const attributeMetaChanged = async (value: string) => {
+ if (shadowRoot) {
+
+ if (attribute) {
+
+ if(asset.id && asset.attributes && asset.attributes.location){
+
+ const showOnMapMeta = Util.getFirstMetaItem(attribute, MetaItemType.SHOW_ON_DASHBOARD.urn!);
+ if(showOnMapMeta) {
+ showOnMapMeta.value = value;
+ } else {
+ const meta:MetaItem = {
+ name: MetaItemType.SHOW_ON_DASHBOARD.urn,
+ value: value
+ }
+
+ attribute.meta?.push(meta);
+ }
+ asset.attributes.location = {...attribute};
+ const response = await manager.rest.api.AssetResource.update(asset.id, asset);
+
+ if (response.status !== 200) {
+ }
+ }
+
+
+ }
+ }
+ };
+
content = html`
<style>
@@ -478,7 +512,7 @@ export class OrAssetViewer extends subscribe(manager)(translate(i18next)(LitElem
<or-map-marker-asset active .asset="${asset}"></or-map-marker-asset>
</or-map>
${attribute.name === AttributeType.LOCATION.attributeName ? html`
- <or-input id="location-map-input" type="${InputType.SWITCH}" readonly dense .value="${showOnMapMeta ? showOnMapMeta.value : undefined}" label="${i18next.t("showOnMap")}"></or-input>
+ <or-input id="location-map-input" type="${InputType.SWITCH}" @or-input-changed="${(evt: OrInputChangedEvent) => attributeMetaChanged(evt.detail.value)}" dense .value="${showOnMapMeta ? showOnMapMeta.value : undefined}" label="${i18next.t("showOnMap")}"></or-input>
` : ``}
`;
}
@@ -494,51 +528,51 @@ export class OrAssetViewer extends subscribe(manager)(translate(i18next)(LitElem
return content;
}
- public static getPropertyTemplate(property: string, value: any, viewerConfig: AssetViewerConfig, panelConfig: PanelConfig, shadowRoot: ShadowRoot | null) {
- let type = InputType.TEXT;
- let minLength: number | undefined;
- let maxLength: number | undefined;
-
- if (viewerConfig.propertyViewProvider) {
- const result = viewerConfig.propertyViewProvider(property, value, viewerConfig, panelConfig);
- if (result) {
- return result;
- }
- }
-
- switch (property) {
- case "path":
- if (!value || !(Array.isArray(value))) {
- return;
- }
-
- // Populate value when we get the response
- OrAssetViewer.getAssetNames(value as string[]).then(
- (names) => {
- if (shadowRoot) {
- const pathField = shadowRoot.getElementById("property-path") as OrInput;
- if (pathField) {
- pathField.value = names.reverse().join(" > ");
- }
- }
- }
- );
- value = i18next.t("loading");
- break;
- case "createdOn":
- type = InputType.DATETIME;
- break;
- case "accessPublicRead":
- type = InputType.CHECKBOX;
- break;
- case "name":
- minLength = 1;
- maxLength = 1023;
- break;
- }
-
- return html`<or-input id="property-${property}" type="${type}" .minLength="${minLength}" .maxLength="${maxLength}" dense .value="${value}" readonly label="${i18next.t(property)}"></or-input>`;
- }
+ // public static getPropertyTemplate(property: string, value: any, viewerConfig: AssetViewerConfig, panelConfig: PanelConfig, shadowRoot: ShadowRoot | null) {
+ // let type = InputType.TEXT;
+ // let minLength: number | undefined;
+ // let maxLength: number | undefined;
+
+ // if (viewerConfig.propertyViewProvider) {
+ // const result = viewerConfig.propertyViewProvider(property, value, viewerConfig, panelConfig);
+ // if (result) {
+ // return result;
+ // }
+ // }
+
+ // switch (property) {
+ // case "path":
+ // if (!value || !(Array.isArray(value))) {
+ // return;
+ // }
+
+ // // Populate value when we get the response
+ // OrAssetViewer.getAssetNames(value as string[]).then(
+ // (names) => {
+ // if (shadowRoot) {
+ // const pathField = shadowRoot.getElementById("property-path") as OrInput;
+ // if (pathField) {
+ // pathField.value = names.reverse().join(" > ");
+ // }
+ // }
+ // }
+ // );
+ // value = i18next.t("loading");
+ // break;
+ // case "createdOn":
+ // type = InputType.DATETIME;
+ // break;
+ // case "accessPublicRead":
+ // type = InputType.CHECKBOX;
+ // break;
+ // case "name":
+ // minLength = 1;
+ // maxLength = 1023;
+ // break;
+ // }
+
+ // return html`<or-input id="property-${property}" type="${type}" .minLength="${minLength}" .maxLength="${maxLength}" dense .value="${value}" readonly label="${i18next.t(property)}"></or-input>`;
+ // }
public static getAttributeTemplate(asset: Asset, attribute: AssetAttribute, viewerConfig: AssetViewerConfig, panelConfig: PanelConfig) {
if (viewerConfig.attributeViewProvider) {
diff --git a/ui/component/or-attribute-history/src/index.ts b/ui/component/or-attribute-history/src/index.ts
index 50b712a2c..7e6ea0f57 100644
--- a/ui/component/or-attribute-history/src/index.ts
+++ b/ui/component/or-attribute-history/src/index.ts
@@ -140,6 +140,13 @@ const style = css`
flex-direction: column;
}
+ .button-icon {
+ align-self: center;
+ padding: 10px;
+ cursor: pointer;
+ }
+
+
#msg {
height: 100%;
width: 100%;
@@ -306,12 +313,12 @@ export class OrAttributeHistory extends translate(i18next)(LitElement) {
return html`
<div id="container">
<div id="controls">
- <or-input .type="${InputType.SELECT}" ?disabled="${disabled}" .label="${i18next.t("period")}" @or-input-changed="${(evt: OrInputChangedEvent) => this.interval = evt.detail.value}" .value="${this.interval}" .options="${this._getIntervalOptions()}"></or-input>
+ <or-input .type="${InputType.SELECT}" ?disabled="${disabled}" .label="${i18next.t("timeframe")}" @or-input-changed="${(evt: OrInputChangedEvent) => this.interval = evt.detail.value}" .value="${this.interval}" .options="${this._getIntervalOptions()}"></or-input>
<div id="ending-controls">
- <or-input class="button" .type="${InputType.BUTTON}" ?disabled="${disabled}" icon="chevron-left" @click="${() => this._updateTimestamp(this.timestamp!, false)}"></or-input>
<or-input id="ending-date" .type="${InputType.DATETIME}" ?disabled="${disabled}" label="${i18next.t("ending")}" .value="${this.timestamp}" @or-input-changed="${(evt: OrInputChangedEvent) => this._updateTimestamp(moment(evt.detail.value as string).toDate())}"></or-input>
- <or-input class="button" .type="${InputType.BUTTON}" ?disabled="${disabled}" icon="chevron-right" @click="${() => this._updateTimestamp(this.timestamp!, true)}"></or-input>
- <or-input class="button" .type="${InputType.BUTTON}" ?disabled="${disabled}" icon="chevron-double-right" @click="${() => this._updateTimestamp(new Date())}"></or-input>
+ <or-icon class="button button-icon" ?disabled="${disabled}" icon="chevron-left" @click="${() => this._updateTimestamp(this.timestamp!, false)}"></or-icon>
+ <or-icon class="button button-icon" ?disabled="${disabled}" icon="chevron-right" @click="${() => this._updateTimestamp(this.timestamp!, true)}"></or-icon>
+ <or-icon class="button button-icon" ?disabled="${disabled}" icon="chevron-double-right" @click="${() => this._updateTimestamp(new Date())}"></or-icon>
</div>
</div>
diff --git a/ui/component/or-attribute-input/src/index.ts b/ui/component/or-attribute-input/src/index.ts
index 29f7e4d92..32f300fe2 100644
--- a/ui/component/or-attribute-input/src/index.ts
+++ b/ui/component/or-attribute-input/src/index.ts
@@ -48,6 +48,7 @@ export function getAttributeValueTemplate(
let max: number | undefined;
let ro: boolean | undefined;
let label: string | undefined;
+ let unit: string | undefined;
let options: any | undefined;
if (valueDescriptor) {
@@ -119,8 +120,11 @@ export function getAttributeValueTemplate(
max = Util.getMetaValue(MetaItemType.RANGE_MAX, attribute, attributeDescriptor) as number;
label = labelOverride !== undefined ? labelOverride : Util.getAttributeLabel(attribute, attributeDescriptor);
ro = readonly === undefined ? Util.getMetaValue(MetaItemType.READ_ONLY, attribute, attributeDescriptor) : readonly;
+ unit = Util.getMetaValue(MetaItemType.UNIT_TYPE, attribute, attributeDescriptor);
options = Util.getMetaValue(MetaItemType.ALLOWED_VALUES, attribute, attributeDescriptor);
-
+ if(unit) {
+ label = label + " ("+i18next.t(unit)+")";
+ }
if (inputType === InputType.TEXT && options && Array.isArray(options) && options.length > 0) {
inputType = InputType.SELECT;
}
@@ -164,6 +168,7 @@ export class OrAttributeInput extends subscribe(manager)(translate(i18next)(LitE
or-input {
width: 100%;
}
+
`;
}
diff --git a/ui/component/or-chart/@types/chartjs-plugin-annotation.d.ts b/ui/component/or-chart/@types/chartjs-plugin-annotation.d.ts
new file mode 100644
index 000000000..e1d561163
--- /dev/null
+++ b/ui/component/or-chart/@types/chartjs-plugin-annotation.d.ts
@@ -0,0 +1,4 @@
+/* tslint:disable:class-name */
+declare module "chartjs-plugin-annotation" {
+
+}
diff --git a/ui/component/or-chart/package.json b/ui/component/or-chart/package.json
index 57e44affb..9eb617b39 100644
--- a/ui/component/or-chart/package.json
+++ b/ui/component/or-chart/package.json
@@ -21,6 +21,7 @@
"@openremote/or-translate": "^1.1.0",
"@openremote/or-mwc-components": "^1.1.0",
"chart.js": "^2.8.0",
+ "chartjs-plugin-annotation": "0.5.7",
"jsonpath-plus": "^1.1.0",
"lit-element": "^2.2.1",
"moment": "^2.24.0"
diff --git a/ui/component/or-chart/src/index.ts b/ui/component/or-chart/src/index.ts
index 992f4a7b1..bf5cb8237 100644
--- a/ui/component/or-chart/src/index.ts
+++ b/ui/component/or-chart/src/index.ts
@@ -25,13 +25,13 @@ import "@openremote/or-input";
import "@openremote/or-panel";
import {MDCDialog} from '@material/dialog';
import "@openremote/or-translate";
-import Chart, {ChartDataSets} from "chart.js";
+import Chart, {ChartDataSets, ChartOptions} from "chart.js";
import {InputType, OrInputChangedEvent} from "@openremote/or-input";
import moment, {unitOfTime} from "moment";
import {OrAssetTreeSelectionChangedEvent} from "@openremote/or-asset-tree";
import {getAssetDescriptorIconTemplate} from "@openremote/or-icon";
import {MenuItem, OrMwcMenu, OrMwcMenuChangedEvent} from "@openremote/or-mwc-components/dist/or-mwc-menu";
-
+import * as ChartAnnotation from "chartjs-plugin-annotation";
export class OrChartEvent extends CustomEvent<OrChartEventDetail> {
public static readonly NAME = "or-chart-event";
@@ -611,7 +611,29 @@ export class OrChart extends translate(i18next)(LitElement) {
data: {
datasets: this._data
},
+ plugins: [
+ ChartAnnotation
+ ],
options: {
+ annotation: {
+ annotations: [
+ {
+ type: 'line',
+ mode: 'vertical',
+ scaleID: 'x-axis-0',
+ value: moment(),
+ borderColor: getComputedStyle(document.documentElement).getPropertyValue('--or-app-color4'),
+ borderWidth: 2,
+ label: {
+ position: 'bottom',
+ yAdjust: 0,
+ backgroundColor: getComputedStyle(document.documentElement).getPropertyValue('--or-app-color4'),
+ content: moment().format("HH:mm"),
+ enabled: true
+ }
+ }
+ ]
+ },
showLines: true,
maintainAspectRatio: false,
// REMOVED AS DOESN'T SIZE CORRECTLY
@@ -656,7 +678,7 @@ export class OrChart extends translate(i18next)(LitElement) {
}
}]
}
- }
+ } as ChartOptions
});
} else {
if (changedProperties.has("_data")) {
diff --git a/ui/component/or-chart/tsconfig.json b/ui/component/or-chart/tsconfig.json
index f4bea8b43..1050b19f4 100644
--- a/ui/component/or-chart/tsconfig.json
+++ b/ui/component/or-chart/tsconfig.json
@@ -6,7 +6,8 @@
"rootDir": "src"
},
"include": [
- "./src"
+ "./src",
+ "./@types"
],
"references": [
{ "path": "../core" },
diff --git a/ui/component/or-input/src/index.ts b/ui/component/or-input/src/index.ts
index 587f9a7e6..3f5b4a603 100644
--- a/ui/component/or-input/src/index.ts
+++ b/ui/component/or-input/src/index.ts
@@ -137,6 +137,11 @@ const style = css`
/* MDC TEXT FIELD AND SELECT DON'T USE THEME VARS */
+ .mdc-select #menu-anchor,
+ .mdc-text-field {
+ background-color: #fbfbfb!important;
+ }
+
.mdc-text-field--focused:not(.mdc-text-field--disabled) .mdc-floating-label {
color: var(--mdc-theme-primary);
}
diff --git a/ui/component/or-map/src/markers/or-map-marker-asset.ts b/ui/component/or-map/src/markers/or-map-marker-asset.ts
index 3c2983725..2bcaec78b 100644
--- a/ui/component/or-map/src/markers/or-map-marker-asset.ts
+++ b/ui/component/or-map/src/markers/or-map-marker-asset.ts
@@ -1,6 +1,6 @@
import {customElement, property, PropertyValues} from "lit-element";
import {OrMapMarker} from "./or-map-marker";
-import {AttributeEvent, AttributeType, GeoJSONPoint, AssetType, AssetEvent, AssetEventCause, Asset} from "@openremote/model";
+import {AttributeEvent, AttributeType, GeoJSONPoint, AssetType, AssetEvent, AssetEventCause, Asset, MetaItemType} from "@openremote/model";
import {subscribe} from "@openremote/core";
import manager, {AssetModelUtil} from "@openremote/core";
import {Util} from "@openremote/core";
@@ -85,6 +85,9 @@ export class OrMapMarkerAsset extends subscribe(manager)(OrMapMarker) {
protected onAssetChanged(asset?: Asset) {
if (asset) {
const attr = Util.getAssetAttribute(asset, AttributeType.LOCATION.attributeName!);
+ const showOnMapMeta = Util.getFirstMetaItem(attr, MetaItemType.SHOW_ON_DASHBOARD.urn!);
+ if(!showOnMapMeta || !showOnMapMeta.value) return
+
this._updateLocation(attr ? attr.value as GeoJSONPoint : null);
this.type = asset.type;
} else {