@openremote/or-map 1.0.2-alpha → 1.2.0-snapshot.20240512160426

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/@types/maplibre-gl-geocoder.d.ts +2 -0
  2. package/README.md +94 -27
  3. package/lib/index.d.ts +115 -0
  4. package/lib/index.js +41 -0
  5. package/lib/index.js.map +1 -0
  6. package/lib/mapwidget.d.ts +94 -0
  7. package/lib/mapwidget.js +1 -0
  8. package/lib/mapwidget.js.map +1 -0
  9. package/lib/markers/or-map-marker-asset.d.ts +78 -0
  10. package/lib/markers/or-map-marker-asset.js +1 -0
  11. package/lib/markers/or-map-marker-asset.js.map +1 -0
  12. package/{dist → lib}/markers/or-map-marker.d.ts +30 -19
  13. package/lib/markers/or-map-marker.js +70 -0
  14. package/lib/markers/or-map-marker.js.map +1 -0
  15. package/lib/or-map-asset-card.d.ts +70 -0
  16. package/lib/or-map-asset-card.js +18 -0
  17. package/lib/or-map-asset-card.js.map +1 -0
  18. package/lib/style.d.ts +4 -0
  19. package/lib/style.js +230 -0
  20. package/lib/style.js.map +1 -0
  21. package/lib/util.d.ts +19 -0
  22. package/lib/util.js +1 -0
  23. package/lib/util.js.map +1 -0
  24. package/package.json +28 -17
  25. package/@types/mapbox.js.d.ts +0 -139
  26. package/dist/index.d.ts +0 -41
  27. package/dist/index.js +0 -196
  28. package/dist/index.js.map +0 -1
  29. package/dist/mapwidget.d.ts +0 -31
  30. package/dist/mapwidget.js +0 -262
  31. package/dist/mapwidget.js.map +0 -1
  32. package/dist/markers/or-map-marker-asset.d.ts +0 -33
  33. package/dist/markers/or-map-marker-asset.js +0 -76
  34. package/dist/markers/or-map-marker-asset.js.map +0 -1
  35. package/dist/markers/or-map-marker.js +0 -247
  36. package/dist/markers/or-map-marker.js.map +0 -1
  37. package/dist/util.d.ts +0 -6
  38. package/dist/util.js +0 -53
  39. package/dist/util.js.map +0 -1
  40. package/src/index.d.ts +0 -27
  41. package/src/index.js +0 -121
  42. package/src/index.js.map +0 -1
  43. package/src/index.ts +0 -226
  44. package/src/mapwidget.d.ts +0 -21
  45. package/src/mapwidget.js +0 -164
  46. package/src/mapwidget.js.map +0 -1
  47. package/src/mapwidget.ts +0 -302
  48. package/src/markers/or-map-marker-asset.d.ts +0 -17
  49. package/src/markers/or-map-marker-asset.js +0 -87
  50. package/src/markers/or-map-marker-asset.js.map +0 -1
  51. package/src/markers/or-map-marker-asset.ts +0 -79
  52. package/src/markers/or-map-marker.d.ts +0 -23
  53. package/src/markers/or-map-marker.js +0 -125
  54. package/src/markers/or-map-marker.js.map +0 -1
  55. package/src/markers/or-map-marker.ts +0 -270
  56. package/src/util.ts +0 -64
  57. package/tsconfig.json +0 -15
  58. package/tsconfig.tsbuildinfo +0 -10143
@@ -0,0 +1 @@
1
+ var __decorate=this&&this.__decorate||function(t,e,r,s){var o,i=arguments.length,a=i<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,r):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,r,s);else for(var n=t.length-1;n>=0;n--)(o=t[n])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},__awaiter=this&&this.__awaiter||function(t,e,r,s){return new(r||(r=Promise))((function(o,i){function a(t){try{c(s.next(t))}catch(t){i(t)}}function n(t){try{c(s.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,n)}c((s=s.apply(t,e||[])).next())}))};import{customElement,property}from"lit/decorators.js";import{OrMapMarker}from"./or-map-marker";import{AssetModelUtil}from"@openremote/model";import manager,{subscribe,Util}from"@openremote/core";import{getMarkerIconAndColorFromAssetType}from"../util";export function getMarkerConfigForAssetType(t,e){if(t&&e&&t[e])return t[e]}export function getMarkerConfigAttributeName(t,e){const r=getMarkerConfigForAssetType(t,e);if(r)return r.attributeName}let OrMapMarkerAsset=class extends(subscribe(manager)(OrMapMarker)){constructor(){super(),this.assetTypeAsIcon=!0,this.visible=!1}set type(t){let e;const r=getMarkerConfigForAssetType(this.config,t);if(r&&r.attributeName&&this.asset&&this.asset.attributes&&this.asset.attributes[r.attributeName]&&r.colours){const t=this.asset.attributes[r.attributeName].value;e={markerConfig:r.colours,currentValue:t}}const s=getMarkerIconAndColorFromAssetType(t,e);s?(this.assetTypeAsIcon&&(this.icon=s.icon),this.markerColor=Array.isArray(s.color)?s.color[0].colour:s.color||void 0,this.updateColor(this.markerContainer),this.visible=!0):this.visible=!1}shouldUpdate(t){if(t.has("assetId")&&(this.lat=void 0,this.lng=void 0,this.type=void 0,this.direction=void 0,this.displayValue=void 0,this.assetIds=this.assetId&&this.assetId.length>0?[this.assetId]:void 0,1===Object.keys(t).length))return!1;if(t.has("asset"))try{this.onAssetChanged(this.asset)}catch(t){console.error(t)}return super.shouldUpdate(t)}_onEvent(t){if("attribute"===t.eventType){const e=t;return"location"===e.ref.name?void this._updateLocation(e.value):void(this.asset&&(this.asset=Util.updateAsset(this.asset,t),this.requestUpdate()))}if("asset"===t.eventType){const e=t;switch(e.cause){case"READ":case"CREATE":case"UPDATE":this.onAssetChanged(e.asset);break;case"DELETE":this.onAssetChanged(void 0)}}}onAssetChanged(t){return __awaiter(this,void 0,void 0,(function*(){if(t){this.direction=void 0,this.displayValue=void 0;const e=t.attributes?t.attributes.location:void 0;this._updateLocation(e?e.value:null);const r=getMarkerConfigForAssetType(this.config,t.type),s=!r||!r.hideDirection,o=r&&!0===r.showLabel&&!!r.attributeName,i=!(!r||!1===r.showUnits);if(o&&t.attributes&&t.attributes[null==r?void 0:r.attributeName]){const e=t.attributes[r.attributeName],s=AssetModelUtil.getAttributeAndValueDescriptors(t.type,e.name,e);this.displayValue=Util.getAttributeValueAsString(e,s[0],t.type,i,"-")}if(s&&t.attributes&&t.attributes.direction){const e=t.attributes.direction.value;null!=e&&(this.direction=e.toString())}this.type=t.type}else this.lat=void 0,this.lng=void 0}))}_updateLocation(t){this.lat=t&&t.coordinates?t.coordinates[1]:void 0,this.lng=t&&t.coordinates?t.coordinates[0]:void 0}getColor(){return this.markerColor&&!this.color?"#"+this.markerColor:super.getColor()}getActiveColor(){return this.markerColor&&!this.activeColor?"#"+this.markerColor:super.getActiveColor()}};__decorate([property({type:String,reflect:!0,attribute:!0})],OrMapMarkerAsset.prototype,"assetId",void 0),__decorate([property({type:Object,attribute:!0})],OrMapMarkerAsset.prototype,"asset",void 0),__decorate([property()],OrMapMarkerAsset.prototype,"config",void 0),OrMapMarkerAsset=__decorate([customElement("or-map-marker-asset")],OrMapMarkerAsset);export{OrMapMarkerAsset};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"or-map-marker-asset.js","sourceRoot":"","sources":["../../src/markers/or-map-marker-asset.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,OAAO,EAAC,aAAa,EAAE,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAIH,cAAc,EAKjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,OAAO,EAAE,EAAC,SAAS,EAAE,IAAI,EAAC,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAC,kCAAkC,EAAyB,MAAM,SAAS,CAAC;AA+BnF,MAAM,UAAU,2BAA2B,CAAC,MAAwC,EAAE,SAA6B;IAC/G,IAAI,CAAC,MAAM,IAAI,CAAC,SAAS,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC;QAC9C,OAAO;IACX,CAAC;IAED,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,4BAA4B,CAAC,MAAwC,EAAE,SAA6B;IAChH,MAAM,eAAe,GAAG,2BAA2B,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAEvE,IAAI,CAAC,eAAe,EAAE,CAAC;QACnB,OAA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"or-map-marker-changed"
5
- }
6
- declare global {
7
- interface HTMLElementEventMap {
8
- [OrMapMarkerEvent.CHANGED]: OrMapMarkerChangedEvent;
9
- [OrMapMarkerEvent.CLICKED]: OrMapMarkerClickedEvent;
10
- }
11
- }
12
- export declare class OrMapMarkerChangedEvent extends CustomEvent<MarkerChangedEventDetail> {
1
+ import { CSSResultGroup, LitElement, PropertyValues } from "lit";
2
+ export declare class OrMapMarkerChangedEvent extends CustomEvent<OrMapMarkerChangedEventDetail> {
3
+ static readonly NAME = "or-map-marker-changed";
13
4
  constructor(marker: OrMapMarker, prop: string);
14
5
  }
15
- export declare class OrMapMarkerClickedEvent extends CustomEvent<MarkerEventDetail> {
6
+ export declare class OrMapMarkerClickedEvent extends CustomEvent<OrMapMarkerEventDetail> {
7
+ static readonly NAME = "or-map-marker-clicked";
16
8
  constructor(marker: OrMapMarker);
17
9
  }
18
- export interface MarkerEventDetail {
10
+ export interface OrMapMarkerEventDetail {
19
11
  marker: OrMapMarker;
20
12
  }
21
- export interface MarkerChangedEventDetail extends MarkerEventDetail {
13
+ export interface OrMapMarkerChangedEventDetail extends OrMapMarkerEventDetail {
22
14
  property: string;
23
15
  }
24
- export declare const MarkerStyle: import("lit-element").CSSResult;
16
+ export interface TemplateOptions {
17
+ displayValue?: string;
18
+ direction?: string;
19
+ }
20
+ declare global {
21
+ export interface HTMLElementEventMap {
22
+ [OrMapMarkerChangedEvent.NAME]: OrMapMarkerChangedEvent;
23
+ [OrMapMarkerClickedEvent.NAME]: OrMapMarkerClickedEvent;
24
+ }
25
+ }
25
26
  /**
26
27
  * Base class for all map markers.
27
28
  *
28
29
  * This component doesn't directly render anything instead it generates DOM that can be added to the map component
29
30
  */
30
31
  export declare class OrMapMarker extends LitElement {
31
- protected static _defaultTemplate: (icon: string | undefined) => string;
32
+ static get styles(): CSSResultGroup;
33
+ protected static _defaultTemplate: (icon: string | undefined, options?: TemplateOptions) => string;
32
34
  lat?: number;
33
35
  lng?: number;
36
+ radius?: number;
37
+ displayValue?: string;
38
+ direction?: string;
34
39
  visible: boolean;
35
40
  icon?: string;
41
+ color?: string;
42
+ activeColor?: string;
36
43
  interactive: boolean;
37
44
  active: boolean;
38
45
  _actualMarkerElement?: HTMLDivElement;
39
46
  protected _slot?: HTMLSlotElement;
40
- readonly markerContainer: HTMLDivElement | undefined;
47
+ get markerContainer(): HTMLDivElement | undefined;
41
48
  _onClick(e: MouseEvent): void;
42
49
  _createMarkerElement(): HTMLDivElement;
43
50
  /**
@@ -47,12 +54,16 @@ export declare class OrMapMarker extends LitElement {
47
54
  createMarkerContent(): HTMLElement | undefined;
48
55
  protected shouldUpdate(_changedProperties: PropertyValues): boolean;
49
56
  protected updateVisibility(container?: HTMLDivElement): void;
57
+ protected getColor(): string | undefined;
58
+ protected getActiveColor(): string | undefined;
59
+ protected updateColor(container?: HTMLDivElement): void;
50
60
  protected updateActive(container?: HTMLDivElement): void;
51
61
  protected updateInteractive(container?: HTMLDivElement): void;
52
62
  protected refreshMarkerContent(): void;
53
- protected render(): import("lit-element").TemplateResult;
63
+ protected render(): import("lit-html").TemplateResult<1>;
54
64
  protected _raisePropertyChange(prop: string): void;
55
65
  protected addMarkerClassNames(markerElement: HTMLElement): void;
56
66
  protected addMarkerContainerClassNames(markerContainer: HTMLElement): void;
57
67
  protected createDefaultMarkerContent(): HTMLElement;
68
+ hasPosition(): boolean;
58
69
  }
@@ -0,0 +1,70 @@
1
+ var OrMapMarker_1,__decorate=this&&this.__decorate||function(e,t,r,a){var o,i=arguments.length,s=i<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,a);else for(var n=e.length-1;n>=0;n--)(o=e[n])&&(s=(i<3?o(s):i>3?o(t,r,s):o(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s};import{css,html,LitElement,unsafeCSS}from"lit";import{customElement,property,query}from"lit/decorators.js";import{markerActiveColorVar,markerColorVar}from"../style";import{DefaultBoxShadow}from"@openremote/core";export class OrMapMarkerChangedEvent extends CustomEvent{constructor(e,t){super(OrMapMarkerChangedEvent.NAME,{detail:{marker:e,property:t},bubbles:!0,composed:!0})}}OrMapMarkerChangedEvent.NAME="or-map-marker-changed";export class OrMapMarkerClickedEvent extends CustomEvent{constructor(e){super(OrMapMarkerClickedEvent.NAME,{detail:{marker:e},bubbles:!0,composed:!0})}}OrMapMarkerClickedEvent.NAME="or-map-marker-clicked";let OrMapMarker=OrMapMarker_1=class extends LitElement{constructor(){super(...arguments),this.visible=!0,this.interactive=!0,this.active=!1}static get styles(){return css`
2
+ .label {
3
+ background-color: white;
4
+ width: auto;
5
+ height: 20px;
6
+ position: absolute;
7
+ top: -14px;
8
+ left: 50%;
9
+ padding: 0 3px;
10
+ transform: translate(-50%, -50%);
11
+ text-align: center;
12
+ border-radius: 3px;
13
+ -webkit-box-shadow: ${unsafeCSS(DefaultBoxShadow)};
14
+ -moz-box-shadow: ${unsafeCSS(DefaultBoxShadow)};
15
+ box-shadow: ${unsafeCSS(DefaultBoxShadow)};
16
+ }
17
+ .label > span {
18
+ white-space: nowrap;
19
+ }
20
+
21
+ .direction-icon-wrapper {
22
+ position: absolute;
23
+ top: 11px;
24
+ left: 16px;
25
+ }
26
+ .direction-circle {
27
+ position: absolute;
28
+ margin-top: -15px;
29
+ margin-left: -15px;
30
+ width: 30px;
31
+ height: 30px;
32
+ }
33
+ .direction-circle circle {
34
+ cx: 15px;
35
+ cy: 15px;
36
+ r: 12px;
37
+ stroke: white;
38
+ stroke-width: 3px;
39
+ fill: transparent;
40
+ }
41
+ .direction-icon {
42
+ position: absolute;
43
+ top: -25px;
44
+ left: -16px;
45
+ transform: scale(0.75) rotate(-90deg);
46
+ }
47
+
48
+ .active .direction-icon-wrapper {
49
+ top: 17px;
50
+ left: 24px;
51
+ }
52
+ .active .direction-circle {
53
+ margin-top: -20px;
54
+ margin-left: -20px;
55
+ width: 40px;
56
+ height: 40px;
57
+ }
58
+ .active .direction-icon {
59
+ top: -36px;
60
+ left: -23px;
61
+ }
62
+ .active .direction-circle circle {
63
+ cx: 20px;
64
+ cy: 20px;
65
+ r: 18px;
66
+ stroke-width: 4px;
67
+ }
68
+ `}get markerContainer(){if(this._actualMarkerElement)return this._actualMarkerElement.firstElementChild}_onClick(e){this.dispatchEvent(new OrMapMarkerClickedEvent(this))}_createMarkerElement(){const e=document.createElement("div"),t=document.createElement("div");e.appendChild(t),this.addMarkerClassNames(e),this.addMarkerContainerClassNames(t);let r=this.createMarkerContent();return r||(e.classList.add("or-map-marker-default"),r=this.createDefaultMarkerContent()),t.appendChild(r),this.updateInteractive(e),this.updateVisibility(e),this.updateColor(t),this.updateActive(e),e}createMarkerContent(){let e=!1,t=document.createElement("div");if(this._slot&&this._slot.assignedNodes({flatten:!0}).forEach((r=>{r instanceof HTMLElement&&(t.appendChild(r.cloneNode(!0)),e=!0)})),e)return t}shouldUpdate(e){return(e.has("icon")||e.has("displayValue")||e.has("direction"))&&this.refreshMarkerContent(),(e.has("color")||e.has("activeColor"))&&this.updateColor(this.markerContainer),e.has("visible")&&this.updateVisibility(this._actualMarkerElement),e.has("interactive")&&this.updateInteractive(this._actualMarkerElement),e.has("active")&&(this.updateActive(this._actualMarkerElement),this.updateColor(this.markerContainer)),e.forEach(((e,t)=>this._raisePropertyChange(t))),!1}updateVisibility(e){e&&(this.visible?e.removeAttribute("hidden"):e.setAttribute("hidden","true"))}getColor(){return this.color&&"unset"!==this.color?this.color:void 0}getActiveColor(){return this.activeColor&&"unset"!==this.activeColor?this.activeColor:void 0}updateColor(e){if(e){e.style.removeProperty(markerColorVar),e.style.removeProperty(markerActiveColorVar);const t=this.getColor(),r=this.getActiveColor();t&&e.style.setProperty(markerColorVar,t),r&&e.style.setProperty(markerActiveColorVar,r)}}updateActive(e){e&&(this.active?e.classList.add("active"):e.classList.remove("active"))}updateInteractive(e){e&&(this.interactive?e.classList.add("interactive"):e.classList.remove("interactive"))}refreshMarkerContent(){if(this.markerContainer){let e=this.createMarkerContent();e?this._actualMarkerElement.classList.remove("or-map-marker-default"):(this._actualMarkerElement.classList.add("or-map-marker-default"),e=this.createDefaultMarkerContent()),this.markerContainer.children.length>0&&this.markerContainer.removeChild(this.markerContainer.children[0]),this.markerContainer.appendChild(e)}}render(){return html`
69
+ <slot></slot>
70
+ `}_raisePropertyChange(e){this.dispatchEvent(new OrMapMarkerChangedEvent(this,e))}addMarkerClassNames(e){e.classList.add("or-map-marker")}addMarkerContainerClassNames(e){e.classList.add("marker-container")}createDefaultMarkerContent(){const e=document.createElement("div");return e.innerHTML=OrMapMarker_1._defaultTemplate(this.icon,{displayValue:this.displayValue,direction:this.direction}),e}hasPosition(){return"number"==typeof this.lat&&"number"==typeof this.lng&&this.lat>=-90&&this.lat<90&&this.lng>=-180&&this.lng<180}};OrMapMarker._defaultTemplate=(e,t)=>`\n ${t&&void 0!==t.displayValue?`<div class="label"><span>${t.displayValue}</span></div>`:""}\n ${t&&t.direction?`<div class="direction-icon-wrapper" style="transform: rotate(${t.direction}deg);">\n <svg class="direction-circle">\n <circle/> \n </svg>\n <or-icon class="direction-icon" icon="play"></or-icon>\n </div>`:""}\n <or-icon icon="or:marker"></or-icon>\n <or-icon class="marker-icon" icon="${e||""}"></or-icon>\n `,__decorate([property({type:Number,reflect:!0,attribute:!0})],OrMapMarker.prototype,"lat",void 0),__decorate([property({type:Number,reflect:!0})],OrMapMarker.prototype,"lng",void 0),__decorate([property({type:Number,reflect:!0})],OrMapMarker.prototype,"radius",void 0),__decorate([property({reflect:!0})],OrMapMarker.prototype,"displayValue",void 0),__decorate([property({reflect:!0})],OrMapMarker.prototype,"direction",void 0),__decorate([property({type:Boolean})],OrMapMarker.prototype,"visible",void 0),__decorate([property({type:String})],OrMapMarker.prototype,"icon",void 0),__decorate([property({type:String})],OrMapMarker.prototype,"color",void 0),__decorate([property({type:String})],OrMapMarker.prototype,"activeColor",void 0),__decorate([property({type:Boolean})],OrMapMarker.prototype,"interactive",void 0),__decorate([property({type:Boolean})],OrMapMarker.prototype,"active",void 0),__decorate([query("slot")],OrMapMarker.prototype,"_slot",void 0),OrMapMarker=OrMapMarker_1=__decorate([customElement("or-map-marker")],OrMapMarker);export{OrMapMarker};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"or-map-marker.js","sourceRoot":"","sources":["../../src/markers/or-map-marker.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAC,GAAG,EAAkB,IAAI,EAAE,UAAU,EAAkB,SAAS,EAAC,MAAM,KAAK,CAAC;AACrF,OAAO,EAAC,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAC,oBAAoB,EAAE,cAAc,EAAC,MAAM,UAAU,CAAC;AAC9D,OAAO,EAAC,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAElD,MAAM,OAAO,uBAAwB,SAAQ,WAA0C;IAInF,YAAY,MAAmB,EAAE,IAAY;QACzC,KAAK,CAAC,uBAAuB,CAAC,IAAI,EAAE;YAChC,MAAM,EAAE;gBACJ,MAAM,EAAE,MAAM;gBACd,QAAQ,EAAE,IAAI;aACjB;YACD,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;SACjB,CAAC,CAAC;IACP,CAAC;;AAXsB,4BAAI,GAAG,uBAAuB,CAAC;AAc1D,MAAM,OAAO,uBAAwB,SAAQ,WAAmC;IAI5E,YAAY,MAAmB;QAC3B,KAAK,CAAC,uBAAuB,CAAC,IAAI,EAAE;YAChC,MAAM,EAAE;gBACJ,MAAM,EAAE,MAAM;aACjB;YACD,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;SACjB,CAAC,CAAC;IACP,CAAC;;AAVsB,4BAAI,GAAG,uBAAuB,CAAC;AAiC1D;;;;GAIG;AAEI,IAAM,WAAW,mBAAjB,MAAM,WAAY,SAAQ,UAAU;IAApC;;QA2GI,YAAO,GAAY,IAAI,CAAC;QAYxB,gBAAW,GAAY,IAAI,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AAE,MAAM,EAAC,CAAC;gDACG;AAGrB;IADN,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;gDACS;AAGnC;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;2CACF;AAMd;IADT,KAAK,CAAC,MAAM,CAAC;0CACoB;AAhIzB,WAAW;IADvB,aAAa,CAAC,eAAe,CAAC;GAClB,WAAW,CA0TvB"}
@@ -0,0 +1,70 @@
1
+ import { CSSResultGroup, LitElement, PropertyValues, TemplateResult } from "lit";
2
+ import { Asset, SharedEvent } from "@openremote/model";
3
+ import "@openremote/or-icon";
4
+ import { MapMarkerAssetConfig } from "./markers/or-map-marker-asset";
5
+ export interface MapAssetCardTypeConfig {
6
+ include?: string[];
7
+ exclude?: string[];
8
+ hideViewAsset?: boolean;
9
+ }
10
+ export interface MapAssetCardConfig {
11
+ default?: MapAssetCardTypeConfig;
12
+ assetTypes?: {
13
+ [assetType: string]: MapAssetCardTypeConfig;
14
+ };
15
+ }
16
+ export declare class OrMapAssetCardLoadAssetEvent extends CustomEvent<string> {
17
+ static readonly NAME = "or-map-asset-card-load-asset";
18
+ constructor(assetId: string);
19
+ }
20
+ declare global {
21
+ export interface HTMLElementEventMap {
22
+ [OrMapAssetCardLoadAssetEvent.NAME]: OrMapAssetCardLoadAssetEvent;
23
+ }
24
+ }
25
+ export declare const DefaultConfig: MapAssetCardConfig;
26
+ declare const OrMapAssetCard_base: (new (...args: any[]) => {
27
+ _connectRequested: boolean;
28
+ _subscriptionIds?: string[] | undefined;
29
+ _assetIds?: string[] | undefined;
30
+ _attributeRefs?: import("@openremote/model").AttributeRef[] | undefined;
31
+ _status: import("@openremote/core").EventProviderStatus;
32
+ _statusCallback: (status: import("@openremote/core").EventProviderStatus) => void;
33
+ connectedCallback(): void;
34
+ disconnectedCallback(): void;
35
+ connectEvents(): void;
36
+ disconnectEvents(): void;
37
+ _doConnect(): Promise<void>;
38
+ readonly eventsConnected: boolean;
39
+ _onEventProviderStatusChanged(status: import("@openremote/core").EventProviderStatus): void;
40
+ _onEventsConnect(): void;
41
+ _onEventsDisconnect(): void;
42
+ _addEventSubscriptions(): Promise<void>;
43
+ _removeEventSubscriptions(): void;
44
+ _refreshEventSubscriptions(): void;
45
+ assetIds: string[] | undefined;
46
+ attributeRefs: import("@openremote/model").AttributeRef[] | undefined;
47
+ _sendEvent(event: SharedEvent): void;
48
+ _sendEventWithReply<U extends SharedEvent, V extends SharedEvent>(event: import("@openremote/model").EventRequestResponseWrapper<U>): Promise<V>;
49
+ onEventsConnect(): void;
50
+ onEventsDisconnect(): void;
51
+ _onEvent(event: SharedEvent): void;
52
+ requestUpdate(name?: PropertyKey | undefined, oldValue?: unknown): void;
53
+ readonly isConnected: boolean;
54
+ }) & typeof LitElement;
55
+ export declare class OrMapAssetCard extends OrMapAssetCard_base {
56
+ assetId?: string;
57
+ asset?: Asset;
58
+ config?: MapAssetCardConfig;
59
+ markerconfig?: MapMarkerAssetConfig;
60
+ useAssetColor: boolean;
61
+ static get styles(): CSSResultGroup;
62
+ protected shouldUpdate(_changedProperties: PropertyValues): boolean;
63
+ _onEvent(event: SharedEvent): void;
64
+ protected getCardConfig(): MapAssetCardTypeConfig | undefined;
65
+ protected render(): TemplateResult | undefined;
66
+ protected _loadAsset(assetId: string): void;
67
+ protected getIcon(): string | undefined;
68
+ protected getColor(): string | undefined;
69
+ }
70
+ export {};
@@ -0,0 +1,18 @@
1
+ var __decorate=this&&this.__decorate||function(t,e,s,r){var a,o=arguments.length,i=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,s):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,s,r);else for(var n=t.length-1;n>=0;n--)(a=t[n])&&(i=(o<3?a(i):o>3?a(e,s,i):a(e,s))||i);return o>3&&i&&Object.defineProperty(e,s,i),i};import{html,LitElement}from"lit";import{customElement,property}from"lit/decorators.js";import{classMap}from"lit-html/directives/class-map.js";import{AssetModelUtil}from"@openremote/model";import manager,{subscribe,Util}from"@openremote/core";import"@openremote/or-icon";import{mapAssetCardStyle}from"./style";import{InputType}from"@openremote/or-mwc-components/or-mwc-input";import{getMarkerIconAndColorFromAssetType}from"./util";import{getMarkerConfigAttributeName}from"./markers/or-map-marker-asset";export class OrMapAssetCardLoadAssetEvent extends CustomEvent{constructor(t){super(OrMapAssetCardLoadAssetEvent.NAME,{bubbles:!0,composed:!0,detail:t})}}OrMapAssetCardLoadAssetEvent.NAME="or-map-asset-card-load-asset";export const DefaultConfig={default:{exclude:["notes"]},assetTypes:{}};let OrMapAssetCard=class extends(subscribe(manager)(LitElement)){constructor(){super(...arguments),this.useAssetColor=!0}static get styles(){return mapAssetCardStyle}shouldUpdate(t){return(!t.has("assetId")||(this.title="",this.assetIds=this.assetId&&this.assetId.length>0?[this.assetId]:void 0,1!==t.size))&&super.shouldUpdate(t)}_onEvent(t){if("asset"===t.eventType){const e=t;switch(e.cause){case"READ":case"CREATE":case"UPDATE":this.asset=e.asset;break;case"DELETE":this.asset=void 0}}"attribute"===t.eventType&&this.asset&&(this.asset=Util.updateAsset(this.asset,t),this.requestUpdate())}getCardConfig(){let t=this.config||DefaultConfig;return this.asset&&t.assetTypes&&t.assetTypes.hasOwnProperty(this.asset.type)?t.assetTypes[this.asset.type]:t.default}render(){if(!this.asset)return html``;const t=this.getIcon(),e=this.getColor(),s=e?"--internal-or-map-asset-card-header-color: #"+e+";":"",r=this.getCardConfig(),a=Object.values(this.asset.attributes).filter((t=>"location"!==t.name)),o=r&&r.include?r.include:void 0,i=r&&r.exclude?r.exclude:[],n=a.filter((t=>!(o&&!(o.indexOf(t.name)>=0)||i&&!(i.indexOf(t.name)<0)||t.meta&&t.meta.hasOwnProperty("showOnDashboard")&&!Util.getMetaValue("showOnDashboard",t)))).sort(Util.sortByString((t=>t.name))),p=getMarkerConfigAttributeName(this.markerconfig,this.asset.type);return html`
2
+ <div id="card-container" style="${s}">
3
+ <div id="header">
4
+ ${t?html`<or-icon icon="${t}"></or-icon>`:""}
5
+ <span id="title">${this.asset.name}</span>
6
+ </div>
7
+ <div id="attribute-list">
8
+ <ul>
9
+ ${n.map((t=>{if(!this.asset||!this.asset.type)return;const e=AssetModelUtil.getAttributeAndValueDescriptors(this.asset.type,t.name,t);if(e&&e.length){const s=Util.getAttributeLabel(t,e[0],this.asset.type,!0),r=Util.getAttributeValueAsString(t,e[0],this.asset.type,!1,"-"),a={highlighted:p===t.name};return html`<li class="${classMap(a)}"><span class="attribute-name">${s}</span><span class="attribute-value">${r}</span></li>`}}))}
10
+ </ul>
11
+ </div>
12
+ ${r&&r.hideViewAsset?html``:html`
13
+ <div id="footer">
14
+ <or-mwc-input .type="${InputType.BUTTON}" label="viewAsset" @or-mwc-input-changed="${t=>{t.preventDefault(),this._loadAsset(this.asset.id)}}"></or-mwc-input>
15
+ </div>
16
+ `}
17
+ </div>
18
+ `}_loadAsset(t){this.dispatchEvent(new OrMapAssetCardLoadAssetEvent(t))}getIcon(){var t;if(this.asset){const e=AssetModelUtil.getAssetDescriptor(this.asset.type);return(null===(t=getMarkerIconAndColorFromAssetType(e))||void 0===t?void 0:t.icon)||void 0}}getColor(){var t;if(this.asset){const e=AssetModelUtil.getAssetDescriptor(this.asset.type),s=null===(t=getMarkerIconAndColorFromAssetType(e))||void 0===t?void 0:t.color;if(s)return"string"==typeof s?s:s[0].colour}}};__decorate([property({type:String,reflect:!0,attribute:!0})],OrMapAssetCard.prototype,"assetId",void 0),__decorate([property({type:Object,attribute:!0})],OrMapAssetCard.prototype,"asset",void 0),__decorate([property({type:Object})],OrMapAssetCard.prototype,"config",void 0),__decorate([property({type:Object})],OrMapAssetCard.prototype,"markerconfig",void 0),__decorate([property({type:Boolean,attribute:!0})],OrMapAssetCard.prototype,"useAssetColor",void 0),OrMapAssetCard=__decorate([customElement("or-map-asset-card")],OrMapAssetCard);export{OrMapAssetCard};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"or-map-asset-card.js","sourceRoot":"","sources":["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BACR,iBAAiB;gBACjB,OAAO,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;YAClE,CAAC;QACL,CAAC;IACL,CAAC;CACJ,CAAA;AA3IU;IADN,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAC,CAAC;+CACjC;AAGjB;IADN,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAC,CAAC;6CACrB;AAGd;IADN,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;8CACU;AAG5B;IADN,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;oDACkB;AAGpC;IADN,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAC,CAAC;qDACN;AAf5B,cAAc;IAD1B,aAAa,CAAC,mBAAmB,CAAC;GACtB,cAAc,CA8I1B"}
package/lib/style.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ export declare const markerColorVar = "--internal-or-map-marker-color";
2
+ export declare const markerActiveColorVar = "--internal-or-map-marker-active-color";
3
+ export declare const style: import("lit").CSSResult;
4
+ export declare const mapAssetCardStyle: import("lit").CSSResult;
package/lib/style.js ADDED
@@ -0,0 +1,230 @@
1
+ import{css,unsafeCSS}from"lit";import{DefaultColor1,DefaultColor2,DefaultColor3,DefaultColor4,DefaultColor5,DefaultHeaderHeight}from"@openremote/core";export const markerColorVar="--internal-or-map-marker-color";export const markerActiveColorVar="--internal-or-map-marker-active-color";export const style=css`
2
+ :host {
3
+ --internal-or-map-width: var(--or-map-width, 100%);
4
+ --internal-or-map-min-height: var(--or-map-min-height, 300px);
5
+ --internal-or-map-marker-transform: var(--or-map-marker-transform, translate(-16px, -29px));
6
+ --internal-or-map-marker-width: var(--or-map-marker-width, 32px);
7
+ --internal-or-map-marker-height: var(--or-map-marker-height, 32px);
8
+ --internal-or-map-marker-color: var(--or-map-marker-color, var(--or-app-color4, ${unsafeCSS(DefaultColor4)}));
9
+ --internal-or-map-marker-stroke: var(--or-map-marker-stroke, none);
10
+ --internal-or-map-marker-icon-color: var(--or-map-marker-icon-color, var(--or-app-color1, ${unsafeCSS(DefaultColor1)}));
11
+ --internal-or-map-marker-icon-stroke: var(--or-map-marker-icon-stroke, none);
12
+ --internal-or-map-marker-icon-width: var(--or-map-marker-icon-width, 16px);
13
+ --internal-or-map-marker-icon-height: var(--or-map-marker-icon-height, 16px);
14
+ --internal-or-map-marker-icon-transform: var(--or-map-marker-icon-transform, translate(-50%, -14px));
15
+ --internal-or-map-marker-active-transform: var(--or-map-marker-active-transform, translate(-24px, -44px));
16
+ --internal-or-map-marker-active-width: var(--or-map-marker-active-width, 48px);
17
+ --internal-or-map-marker-active-height: var(--or-map-marker-active-height, 48px);
18
+ --internal-or-map-marker-active-color: var(--or-map-marker-active-color, var(--or-app-color4, ${unsafeCSS(DefaultColor4)}));
19
+ --internal-or-map-marker-active-stroke: var(--or-map-marker-active-stroke, 2px);
20
+ --internal-or-map-marker-icon-active-color: var(--or-map-marker-icon-active-color, var(--or-app-color1, ${unsafeCSS(DefaultColor1)}));
21
+ --internal-or-map-marker-icon-active-stroke: var(--or-map-marker-icon-active-stroke, none);
22
+ --internal-or-map-marker-icon-active-width: var(--or-map-marker-icon-active-width, 24px);
23
+ --internal-or-map-marker-icon-active-height: var(--or-map-marker-icon-active-height, 24px);
24
+ --internal-or-map-marker-icon-active-transform: var(--or-map-marker-icon-active-transform, translate(-50%, -20px));
25
+ display: block;
26
+ overflow: hidden;
27
+
28
+ min-height: var(--internal-or-map-min-height);
29
+ width: var(--internal-or-map-width);
30
+ }
31
+
32
+ canvas {
33
+ outline: none !important;
34
+ }
35
+
36
+ :host([hidden]) {
37
+ display: none;
38
+ }
39
+
40
+ slot {
41
+ display: none;
42
+ }
43
+
44
+ #container {
45
+ position: relative;
46
+ width: 100%;
47
+ height: 100%;
48
+ }
49
+
50
+ #map {
51
+ position: absolute;
52
+ left: 0;
53
+ right: 0;
54
+ top: 0;
55
+ bottom: 0;
56
+ }
57
+ .mapboxgl-ctrl-geocoder,
58
+ .maplibregl-ctrl-geocoder--input {
59
+ width: calc(100% - 20px)
60
+ }
61
+ .leaflet-marker-icon, .maplibregl-marker, .mapboxgl-marker {
62
+ pointer-events: none !important;
63
+ }
64
+
65
+ .or-map-marker {
66
+ position: absolute; /* This makes mapboxJS behave like mapboxGL */
67
+ }
68
+
69
+ .or-map-marker.active {
70
+ z-index: 1;
71
+ }
72
+
73
+ .marker-container {
74
+ position: relative;
75
+ cursor: pointer;
76
+ transform: var(--internal-or-map-marker-transform);
77
+ --or-icon-fill: var(--internal-or-map-marker-color);
78
+ --or-icon-width: var(--internal-or-map-marker-width);
79
+ --or-icon-height: var(--internal-or-map-marker-height);
80
+ --or-icon-stroke: var(--internal-or-map-marker-stroke);
81
+ }
82
+
83
+ .or-map-marker.active .marker-container {
84
+ transform: var(--internal-or-map-marker-active-transform);
85
+ --or-icon-fill: var(--internal-or-map-marker-active-color);
86
+ --or-icon-width: var(--internal-or-map-marker-active-width);
87
+ --or-icon-height: var(--internal-or-map-marker-active-height);
88
+ --or-icon-stroke: var(--internal-or-map-marker-active-stroke);
89
+ }
90
+
91
+ .or-map-marker.interactive .marker-container {
92
+ pointer-events: all;
93
+ }
94
+
95
+ .or-map-marker-default.interactive .marker-container {
96
+ pointer-events: none;
97
+ --or-icon-pointer-events: visible;
98
+ }
99
+
100
+ .or-map-marker .marker-icon {
101
+ position: absolute;
102
+ left: 50%;
103
+ top: 50%;
104
+ z-index: 1000;
105
+ --or-icon-fill: var(--internal-or-map-marker-icon-color);
106
+ --or-icon-stroke: var(--internal-or-map-marker-icon-stroke);
107
+ --or-icon-width: var(--internal-or-map-marker-icon-width);
108
+ --or-icon-height: var(--internal-or-map-marker-icon-height);
109
+ transform: var(--internal-or-map-marker-icon-transform);
110
+ }
111
+
112
+ .or-map-marker.active .marker-icon {
113
+ transform: var(--internal-or-map-marker-icon-active-transform);
114
+ --or-icon-fill: var(--internal-or-map-marker-icon-active-color);
115
+ --or-icon-stroke: var(--internal-or-map-marker-icon-active-stroke);
116
+ --or-icon-width: var(--internal-or-map-marker-icon-active-width);
117
+ --or-icon-height: var(--internal-or-map-marker-icon-active-height);
118
+ }
119
+
120
+ #openremote {
121
+ position: absolute;
122
+ bottom: 25px;
123
+ right: 5px;
124
+ height: 20px;
125
+ width: 20px;
126
+ cursor: pointer;
127
+ }
128
+
129
+ #openremote img {
130
+ height: 20px;
131
+ width: 20px;
132
+ }
133
+
134
+ @media only screen and (max-width: 640px) {
135
+ #openremote {
136
+ bottom: 40px;
137
+ right: 12px;
138
+ }
139
+ }
140
+ `;export const mapAssetCardStyle=css`
141
+ :host {
142
+ --internal-or-map-asset-card-header-color: var(--or-map-asset-card-header-color, var(--or-app-color4, ${unsafeCSS(DefaultColor4)}));
143
+ --internal-or-map-asset-card-header-text-color: var(--or-map-asset-card-header-text-color, var(--or-app-color1, ${unsafeCSS(DefaultColor1)}));
144
+ --internal-or-map-asset-card-header-height: var(--or-map-asset-card-header-height, calc(${unsafeCSS(DefaultHeaderHeight)} - 10px));
145
+ --internal-or-map-asset-card-background-color: var(--or-map-asset-card-background-color, var(--or-app-color1, ${unsafeCSS(DefaultColor1)}));
146
+ --internal-or-map-asset-card-background-text-color: var(--or-map-asset-card-background-text-color, var(--or-app-color3, ${unsafeCSS(DefaultColor3)}));
147
+ --internal-or-map-asset-card-separator-color: var(--or-map-asset-card-separator-color, var(--or-app-color2, ${unsafeCSS(DefaultColor2)}));
148
+
149
+ display: block;
150
+ }
151
+
152
+ #card-container {
153
+ display: flex;
154
+ flex-direction: column;
155
+ height: 100%;
156
+ background-color: var(--internal-or-map-asset-card-background-color);
157
+ -webkit-box-shadow: 1px 1px 2px 0px rgba(0,0,0,0.28);
158
+ -moz-box-shadow: 1px 1px 2px 0px rgba(0,0,0,0.28);
159
+ box-shadow: 1px 1px 2px 0px rgba(0,0,0,0.28);
160
+ }
161
+
162
+ #header {
163
+ height: var(--internal-or-map-asset-card-header-height);
164
+ background-color: var(--internal-or-map-asset-card-header-color);
165
+ line-height: var(--internal-or-map-asset-card-header-height);
166
+ border-bottom: 1px solid ${unsafeCSS(DefaultColor5)};
167
+ text-align: center;
168
+ color: var(--internal-or-map-asset-card-header-text-color);
169
+ --or-icon-fill: var(--internal-or-map-asset-card-header-text-color);
170
+ --or-icon-width: 20px;
171
+ --or-icon-height: 20px;
172
+ z-index: 99999;
173
+ }
174
+
175
+ #header > or-icon {
176
+ margin-right: 5px;
177
+ }
178
+
179
+ #title {
180
+ font-weight: 500;
181
+ }
182
+
183
+ #attribute-list {
184
+ flex: 1;
185
+ color: var(--internal-or-map-asset-card-background-text-color);
186
+ padding: 10px 20px;
187
+ overflow: auto;
188
+ font-size: 14px;
189
+ }
190
+
191
+ ul {
192
+ list-style-type: none;
193
+ margin: 0;
194
+ padding: 0;
195
+ }
196
+
197
+ li {
198
+ display: flex;
199
+ line-height: 30px;
200
+ }
201
+ li.highlighted {
202
+ font-weight: bold;
203
+ }
204
+
205
+ .attribute-name {
206
+ flex: 1;
207
+ }
208
+
209
+ .attribute-value {
210
+ overflow: hidden;
211
+ padding-left: 20px;
212
+ text-align: right;
213
+ }
214
+
215
+ #footer {
216
+ height: var(--internal-or-map-asset-card-header-height);
217
+ border-top: 1px solid var(--internal-or-map-asset-card-separator-color);
218
+ text-align: right;
219
+ padding: 5px 12px;
220
+ }
221
+
222
+ @media only screen and (min-width: 415px){
223
+ #card-container {
224
+ height: 400px; /* fallback for IE */
225
+ height: max-content;
226
+ max-height: calc(100vh - 150px);
227
+ min-height: 134px;
228
+ }
229
+ }
230
+ `;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.js","sourceRoot":"","sources":["../src/style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAE,SAAS,EAAC,MAAM,KAAK,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,mBAAmB,EAAmB,MAAM,kBAAkB,CAAC;AAEnJ,MAAM,CAAC,MAAM,cAAc,GAAG,gCAAgC,CAAC;AAC/D,MAAM,CAAC,MAAM,oBAAoB,GAAG,uCAAuC,CAAC;AAE5E,eAAe;AACf,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,CAAA;;;;;;;0FAOkE,SAAS,CAAC,aAAa,CAAC;;oGAEd,SAAS,CAAC,aAAa,CAAC;;;;;;;;wGAQpB,SAAS,CAAC,aAAa,CAAC;;kHAEd,SAAS,CAAC,aAAa,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwHzI,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAA;;wHAEoF,SAAS,CAAC,aAAa,CAAC;kIACd,SAAS,CAAC,aAAa,CAAC;0GAChD,SAAS,CAAC,mBAAmB,CAAC;gIACR,SAAS,CAAC,aAAa,CAAC;0IACd,SAAS,CAAC,aAAa,CAAC;8HACpC,SAAS,CAAC,aAAa,CAAC;;;;;;;;;;;;;;;;;;;2CAmB3G,SAAS,CAAC,aAAa,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgElE,CAAA"}
package/lib/util.d.ts ADDED
@@ -0,0 +1,19 @@
1
+ /// <reference types="leaflet" />
2
+ import { LngLatBounds, LngLatBoundsLike, LngLatLike } from "maplibre-gl";
3
+ import { Asset, AssetDescriptor, GeoJSONPoint, ValueHolder } from "@openremote/model";
4
+ import { AttributeMarkerColoursRange, MapMarkerColours } from "./markers/or-map-marker-asset";
5
+ export declare function getLngLat(lngLatLike?: LngLatLike | Asset | ValueHolder<any> | GeoJSONPoint): {
6
+ lng: number;
7
+ lat: number;
8
+ } | undefined;
9
+ export declare function getGeoJSONPoint(lngLat: LngLatLike | undefined): GeoJSONPoint | undefined;
10
+ export declare function getLngLatBounds(lngLatBoundsLike?: LngLatBoundsLike): LngLatBounds | undefined;
11
+ export declare function getLatLngBounds(lngLatBoundsLike?: LngLatBoundsLike): L.LatLngBounds | undefined;
12
+ export interface OverrideConfigSettings {
13
+ markerConfig: MapMarkerColours;
14
+ currentValue: any;
15
+ }
16
+ export declare function getMarkerIconAndColorFromAssetType(type: AssetDescriptor | string | undefined, configOverrideSettings?: OverrideConfigSettings): {
17
+ icon: string;
18
+ color: string | undefined | AttributeMarkerColoursRange[];
19
+ } | undefined;
package/lib/util.js ADDED
@@ -0,0 +1 @@
1
+ import{LngLat,LngLatBounds}from"maplibre-gl";import{AssetModelUtil}from"@openremote/model";export function getLngLat(t){if(t){if(t instanceof LngLat)return t;if(t.lat)return t.lon?{lng:t.lon,lat:t.lat}:{lng:t.lng,lat:t.lat};if(Array.isArray(t))return{lng:t[0],lat:t[1]};if(t.coordinates&&Array.isArray(t.coordinates)&&t.coordinates.length>=2)return getLngLat(t.coordinates);if(t.attributes){const n=t.attributes.location;if(!n)return;return n.value?getLngLat(n.value):void 0}return t.value?getLngLat(t.value):void 0}}export function getGeoJSONPoint(t){if(t)return Array.isArray(t)?{type:"Point",coordinates:t}:{type:"Point",coordinates:[t.hasOwnProperty("lng")?t.lng:t.lon,t.lat]}}export function getLngLatBounds(t){if(t){if(t instanceof LngLatBounds)return t;const n=t;if(2===n.length){const t=getLngLat(n[0]),e=getLngLat(n[1]);if(t&&e)return new LngLatBounds(t,e)}if(4===n.length)return new LngLatBounds([n[0],n[1],n[2],n[3]])}}export function getLatLngBounds(t){const n=getLngLatBounds(t);if(n)return L.latLngBounds(n.getNorthEast(),n.getSouthWest())}export function getMarkerIconAndColorFromAssetType(t,n){if(!t)return;const e="string"==typeof t?AssetModelUtil.getAssetDescriptor(t):t,o=e&&e.icon?e.icon:"help-circle";let r=e&&e.colour?e.colour:void 0;if(n&&n.markerConfig){const t=n.markerConfig,e=n.currentValue;if("range"===t.type&&t.ranges&&"number"==typeof e){const n=t.ranges;r=(n.sort(((t,n)=>n.min-t.min)).find((t=>e>=t.min))||n.reduce(((t,n)=>n.min>t.min?t:n))).colour||void 0}else"boolean"===t.type?r=t[!!e+""]:"string"===t.type&&(r=t[e+""])}return{color:r,icon:o}}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAE,YAAY,EAA+B,MAAM,aAAa,CAAC;AAC/E,OAAO,EAGH,cAAc,EAKjB,MAAM,mBAAmB,CAAC;AAG3B,MAAM,UAAU,SAAS,CAAC,UAAiE;IACvF,IAAI,CAAC,UAAU,EAAE,CAAC;QACd,OAAO;IACX,CAAC;IAED,IAAI,UAAU,YAAY,MAAM,EAAE,CAAC;QAC/B,OAAO,UAAoB,CAAC;IAChC,CAAC;IAED,IAAK,UAAqB,CAAC,GAAG,EAAE,CAAC;QAC7B,IAAK,UAAkB,CAAC,GAAG,EAAE,CAAC;YAC1B,OAAO,EAAC,GAAG,EAAG,UAAkB,CAAC,GAAG,EAAE,GAAG,EAAG,UAAqB,CAAC,GAAG,EAAC,CAAC;QAC3E,CAAC;QACD,OAAO,EAAC,GAAG,EAAG,UAAqB,CAAC,GAAG,EAAE,GAAG,EAAG,UAAqB,CAAC,GAAG,EAAC,CAAC;IAC9E,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;QAC5B,OAAO,EAAC,GAAG,EAAG,UAAuB,CAAC,CAAC,CAAC,EAAE,GAAG,EAAG,UAAuB,CAAC,CAAC,CAAC,EAAC,CAAC;IAChF,CAAC;IAED,IAAK,UAA2B,CAAC,WAAW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