@openremote/or-map 1.8.0-snapshot.20250723203453 → 1.8.0-snapshot.20250725070921

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.
package/lib/index.d.ts CHANGED
@@ -103,7 +103,7 @@ export declare class OrMap extends LitElement {
103
103
  get markers(): OrMapMarker[];
104
104
  connectedCallback(): void;
105
105
  disconnectedCallback(): void;
106
- protected render(): import("lit-html").TemplateResult<1>;
106
+ protected render(): import("lit").TemplateResult<1>;
107
107
  protected updated(changedProperties: PropertyValues): void;
108
108
  refresh(): void;
109
109
  loadMap(): void;
package/lib/index.js CHANGED
@@ -1,9 +1,20 @@
1
- var __decorate=this&&this.__decorate||function(e,t,o,r){var a,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var i=e.length-1;i>=0;i--)(a=e[i])&&(s=(n<3?a(s):n>3?a(t,o,s):a(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s};import manager from"@openremote/core";import{FlattenedNodesObserver}from"@polymer/polymer/lib/utils/flattened-nodes-observer.js";import{html,LitElement}from"lit";import{customElement,property,query}from"lit/decorators.js";import{LngLat,GeolocateControl}from"maplibre-gl";import{MapWidget}from"./mapwidget";import{style}from"./style";import"./markers/or-map-marker";import"./markers/or-map-marker-asset";import{OrMapMarker,OrMapMarkerChangedEvent}from"./markers/or-map-marker";import*as Util from"./util";import{InputType,OrMwcInput}from"@openremote/or-mwc-components/or-mwc-input";import{OrMwcDialog,showDialog}from"@openremote/or-mwc-components/or-mwc-dialog";import{getMarkerIconAndColorFromAssetType}from"./util";import{i18next}from"@openremote/or-translate";import{debounce}from"lodash";export{Util};export*from"./markers/or-map-marker";export*from"./markers/or-map-marker-asset";export*from"./or-map-asset-card";export class OrMapLoadedEvent extends CustomEvent{constructor(){super(OrMapLoadedEvent.NAME,{bubbles:!0,composed:!0})}}OrMapLoadedEvent.NAME="or-map-loaded";export class OrMapClickedEvent extends CustomEvent{constructor(e,t=!1){super(OrMapClickedEvent.NAME,{detail:{doubleClick:t,lngLat:e},bubbles:!0,composed:!0})}}OrMapClickedEvent.NAME="or-map-clicked";export class OrMapLongPressEvent extends CustomEvent{constructor(e){super(OrMapLongPressEvent.NAME,{detail:{doubleClick:!1,lngLat:e},bubbles:!0,composed:!0})}}OrMapLongPressEvent.NAME="or-map-long-press";export class OrMapGeocoderChangeEvent extends CustomEvent{constructor(e){super(OrMapGeocoderChangeEvent.NAME,{detail:{geocode:e},bubbles:!0,composed:!0})}}OrMapGeocoderChangeEvent.NAME="or-map-geocoder-change";export class CenterControl{onAdd(e){this.map=e;const t=document.createElement("div");t.classList.add("maplibregl-ctrl"),t.classList.add("maplibregl-ctrl-group");const o=document.createElement("button");o.className="maplibregl-ctrl-compass",o.addEventListener("click",(t=>e.flyTo({center:this.pos,zoom:e.getZoom()})));const r=document.createElement("span");return r.className="maplibregl-ctrl-icon",o.appendChild(r),t.appendChild(o),this.elem=t,t}onRemove(e){this.map=void 0,this.elem=void 0}}const CoordinatesRegexPattern="^[ ]*(?:Lat: )?(-?\\d+\\.?\\d*)[, ]+(?:Lng: )?(-?\\d+\\.?\\d*)[ ]*$";function getCoordinatesInputKeyHandler(e){return t=>{if("Enter"===t.code||"NumpadEnter"===t.code){const o=t.target.value;let r=o?{}:void 0;if(o){const e=o.split(/[ ,]/).filter((e=>!!e));2===e.length&&(r=new LngLat(Number.parseFloat(e[0]),Number.parseFloat(e[1])))}e(r)}}}export class CoordinatesControl{constructor(e=!1,t){this._readonly=!1,this._readonly=e,this._valueChangedHandler=t}onAdd(e){this.map=e;const t=document.createElement("div");t.classList.add("maplibregl-ctrl"),t.classList.add("maplibregl-ctrl-group");const o=new OrMwcInput;return o.type=InputType.TEXT,o.outlined=!0,o.compact=!0,o.readonly=this._readonly,o.icon="crosshairs-gps",o.value=this._value,o.pattern=CoordinatesRegexPattern,o.onkeyup=getCoordinatesInputKeyHandler(this._valueChangedHandler),t.appendChild(o),this.elem=t,this.input=o,t}onRemove(e){this.map=void 0,this.elem=void 0}set readonly(e){this._readonly=e,this.input&&(this.input.readonly=e)}set value(e){this._value=e,this.input&&(this.input.value=e)}}export const geoJsonPointInputTemplateProvider=(e,t,o,r,a,n)=>{const s=!(!n||!n.disabled),i=!(!n||!n.readonly),p=!(!n||!n.compact),l=!(!n||!n.comfortable),d=new CenterControl,c=e=>{a&&a(void 0!==e?{value:e?Util.getGeoJSONPoint(e):null}:void 0)},m=new CoordinatesControl(s,c);let h;return{templateFunction:(t,o,r,a,n,u)=>{let g;t&&(h=Util.getLngLat(t),g=h?Object.values(h):void 0);const v=g?g.join(", "):void 0;d.pos=h||void 0,m.readonly=s||i||a||r,m.value=v;const y=getMarkerIconAndColorFromAssetType(e);let C;const M=e=>{if(!i&&!s)if(h=e?Util.getLngLat(e):null,C){const e=C.shadowRoot.getElementById("geo-json-point-marker");e.lng=h?h.lng:void 0,e.lat=h?h.lat:void 0,g=h?Object.values(h):void 0;const t=g?g.join(", "):void 0;m.value=t}else c(h)},f=[[d,"bottom-left"],[m,"top-right"]];if(!i){const e=new GeolocateControl({positionOptions:{enableHighAccuracy:!0},showAccuracyCircle:!1,showUserLocation:!1});e.on("geolocate",(e=>{M(new LngLat(e.coords.longitude,e.coords.latitude))})),e.on("outofmaxbounds",(e=>{M(new LngLat(e.coords.longitude,e.coords.latitude))})),f.push([e,"bottom-left"])}let _=html`
2
- <or-map id="geo-json-point-map" class="or-map" @or-map-long-press="${e=>{M(e.detail.lngLat)}}" .center="${g}" .controls="${f}" .showGeoCodingControl=${!i}>
3
- <or-map-marker id="geo-json-point-marker" active .lng="${h?h.lng:void 0}" .lat="${h?h.lat:void 0}" .icon="${y?y.icon:void 0}" .activeColor="${y?"#"+y.color:void 0}" .colour="${y?"#"+y.color:void 0}"></or-map-marker>
1
+ var __decorate=this&&this.__decorate||function(e,t,o,r){var a,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var i=e.length-1;i>=0;i--)(a=e[i])&&(s=(n<3?a(s):n>3?a(t,o,s):a(t,o))||s);return n>3&&s&&Object.defineProperty(t,o,s),s};import e from"@openremote/core";import{FlattenedNodesObserver as t}from"@polymer/polymer/lib/utils/flattened-nodes-observer.js";import{html as o,LitElement as r}from"lit";import{customElement as a,property as n,query as s}from"lit/decorators.js";import{LngLat as i,GeolocateControl as l}from"maplibre-gl";import{MapWidget as p}from"./mapwidget";import{style as d}from"./style";import"./markers/or-map-marker";import"./markers/or-map-marker-asset";import{OrMapMarker as m,OrMapMarkerChangedEvent as c}from"./markers/or-map-marker";import*as h from"./util";import{InputType as u,OrMwcInput as v}from"@openremote/or-mwc-components/or-mwc-input";import{OrMwcDialog as g,showDialog as y}from"@openremote/or-mwc-components/or-mwc-dialog";import{getMarkerIconAndColorFromAssetType as f}from"./util";import{i18next as C}from"@openremote/or-translate";import{debounce as _}from"lodash";export*from"./markers/or-map-marker";export*from"./markers/or-map-marker-asset";export*from"./or-map-asset-card";export class OrMapLoadedEvent extends CustomEvent{constructor(){super(OrMapLoadedEvent.NAME,{bubbles:!0,composed:!0})}}OrMapLoadedEvent.NAME="or-map-loaded";export class OrMapClickedEvent extends CustomEvent{constructor(e,t=!1){super(OrMapClickedEvent.NAME,{detail:{doubleClick:t,lngLat:e},bubbles:!0,composed:!0})}}OrMapClickedEvent.NAME="or-map-clicked";export class OrMapLongPressEvent extends CustomEvent{constructor(e){super(OrMapLongPressEvent.NAME,{detail:{doubleClick:!1,lngLat:e},bubbles:!0,composed:!0})}}OrMapLongPressEvent.NAME="or-map-long-press";export class OrMapGeocoderChangeEvent extends CustomEvent{constructor(e){super(OrMapGeocoderChangeEvent.NAME,{detail:{geocode:e},bubbles:!0,composed:!0})}}OrMapGeocoderChangeEvent.NAME="or-map-geocoder-change";export class CenterControl{onAdd(e){this.map=e;let t=document.createElement("div");t.classList.add("maplibregl-ctrl"),t.classList.add("maplibregl-ctrl-group");let o=document.createElement("button");o.className="maplibregl-ctrl-compass",o.addEventListener("click",t=>e.flyTo({center:this.pos,zoom:e.getZoom()}));let r=document.createElement("span");return r.className="maplibregl-ctrl-icon",o.appendChild(r),t.appendChild(o),this.elem=t,t}onRemove(e){this.map=void 0,this.elem=void 0}}let CoordinatesRegexPattern="^[ ]*(?:Lat: )?(-?\\d+\\.?\\d*)[, ]+(?:Lng: )?(-?\\d+\\.?\\d*)[ ]*$";function getCoordinatesInputKeyHandler(e){return t=>{if("Enter"===t.code||"NumpadEnter"===t.code){let o=t.target.value,r=o?{}:void 0;if(o){let e=o.split(/[ ,]/).filter(e=>!!e);2===e.length&&(r=new i(Number.parseFloat(e[0]),Number.parseFloat(e[1])))}e(r)}}}export class CoordinatesControl{constructor(e=!1,t){this._readonly=!1,this._readonly=e,this._valueChangedHandler=t}onAdd(e){this.map=e;let t=document.createElement("div");t.classList.add("maplibregl-ctrl"),t.classList.add("maplibregl-ctrl-group");let o=new v;return o.type=u.TEXT,o.outlined=!0,o.compact=!0,o.readonly=this._readonly,o.icon="crosshairs-gps",o.value=this._value,o.pattern=CoordinatesRegexPattern,o.onkeyup=getCoordinatesInputKeyHandler(this._valueChangedHandler),t.appendChild(o),this.elem=t,this.input=o,t}onRemove(e){this.map=void 0,this.elem=void 0}set readonly(e){this._readonly=e,this.input&&(this.input.readonly=e)}set value(e){this._value=e,this.input&&(this.input.value=e)}}export const geoJsonPointInputTemplateProvider=(e,t,r,a,n,s)=>{let p,d=!!(s&&s.disabled),m=!!(s&&s.readonly),c=!!(s&&s.compact),v=!!(s&&s.comfortable),_=new CenterControl,b=e=>{n&&(void 0!==e?n({value:e?h.getGeoJSONPoint(e):null}):n(void 0))},A=new CoordinatesControl(d,b);return{templateFunction:(t,r,a,n,s,M)=>{let k,w;t&&(k=(p=h.getLngLat(t))?Object.values(p):void 0);let E=k?k.join(", "):void 0;_.pos=p||void 0,A.readonly=d||m||n||a,A.value=E;let O=f(e),x=e=>{if(!m&&!d)if(p=e?h.getLngLat(e):null,w){let e=w.shadowRoot.getElementById("geo-json-point-marker");e.lng=p?p.lng:void 0,e.lat=p?p.lat:void 0,A.value=(k=p?Object.values(p):void 0)?k.join(", "):void 0}else b(p)},z=[[_,"bottom-left"],[A,"top-right"]];if(!m){let e=new l({positionOptions:{enableHighAccuracy:!0},showAccuracyCircle:!1,showUserLocation:!1});e.on("geolocate",e=>{x(new i(e.coords.longitude,e.coords.latitude))}),e.on("outofmaxbounds",e=>{x(new i(e.coords.longitude,e.coords.latitude))}),z.push([e,"bottom-left"])}let N=o`
2
+ <or-map id="geo-json-point-map" class="or-map" @or-map-long-press="${e=>{x(e.detail.lngLat)}}" .center="${k}" .controls="${z}" .showGeoCodingControl=${!m}>
3
+ <or-map-marker id="geo-json-point-marker" active .lng="${p?p.lng:void 0}" .lat="${p?p.lat:void 0}" .icon="${O?O.icon:void 0}" .activeColor="${O?"#"+O.color:void 0}" .colour="${O?"#"+O.color:void 0}"></or-map-marker>
4
4
  </or-map>
5
- <span class="long-press-msg">${i18next.t("longPressSetLoc")}</span>
6
- `;if(p){const e=_,t=()=>{C=showDialog((new OrMwcDialog).setContent(e).setStyles(html`
5
+ <span class="long-press-msg">${C.t("longPressSetLoc")}</span>
6
+ `;if(c){let e=N;N=o`
7
+ <style>
8
+ #geo-json-point-input-compact-wrapper {
9
+ display: table-cell;
10
+ }
11
+ #geo-json-point-input-compact-wrapper > * {
12
+ vertical-align: middle;
13
+ }
14
+ </style>
15
+ <div id="geo-json-point-input-compact-wrapper">
16
+ <or-mwc-input style="width: auto;" .comfortable="${v}" .type="${u.TEXT}" .value="${E}" .pattern="${CoordinatesRegexPattern}" @keyup="${e=>getCoordinatesInputKeyHandler(b)(e)}"></or-mwc-input>
17
+ <or-mwc-input style="width: auto;" .type="${u.BUTTON}" compact icon="crosshairs-gps" @or-mwc-input-changed="${()=>{w=y(new g().setContent(e).setStyles(o`
7
18
  <style>
8
19
  .dialog-container {
9
20
  flex-direction: column !important;
@@ -17,20 +28,9 @@ var __decorate=this&&this.__decorate||function(e,t,o,r){var a,n=arguments.length
17
28
  min-height: 600px !important;
18
29
  }
19
30
  </style>
20
- `).setActions([{actionName:"none",content:"none",action:()=>{M(null),c(h)}},{actionName:"ok",content:"ok",action:()=>{c(h)}},{default:!0,actionName:"cancel",content:"cancel"}]))};_=html`
21
- <style>
22
- #geo-json-point-input-compact-wrapper {
23
- display: table-cell;
24
- }
25
- #geo-json-point-input-compact-wrapper > * {
26
- vertical-align: middle;
27
- }
28
- </style>
29
- <div id="geo-json-point-input-compact-wrapper">
30
- <or-mwc-input style="width: auto;" .comfortable="${l}" .type="${InputType.TEXT}" .value="${v}" .pattern="${CoordinatesRegexPattern}" @keyup="${e=>getCoordinatesInputKeyHandler(c)(e)}"></or-mwc-input>
31
- <or-mwc-input style="width: auto;" .type="${InputType.BUTTON}" compact icon="crosshairs-gps" @or-mwc-input-changed="${t}"></or-mwc-input>
31
+ `).setActions([{actionName:"none",content:"none",action:()=>{x(null),b(p)}},{actionName:"ok",content:"ok",action:()=>{b(p)}},{default:!0,actionName:"cancel",content:"cancel"}]))}}"></or-mwc-input>
32
32
  </div>
33
- `}return _},supportsHelperText:!1,supportsLabel:!1,supportsSendButton:!1,validator:()=>!h||void 0!==h.lat&&null!==h.lat&&void 0!==h.lng&&null!==h.lng}};let OrMap=class extends LitElement{constructor(){super(),this.type=manager.mapType,this._markerStyles=[],this.showGeoCodingControl=!1,this.showBoundaryBoxControl=!1,this.useZoomControl=!0,this.showGeoJson=!0,this.boundary=[],this._loaded=!1,this._markers=[],this.addEventListener(OrMapMarkerChangedEvent.NAME,this._onMarkerChangedEvent)}firstUpdated(e){super.firstUpdated(e),manager.ready&&this.loadMap()}get markers(){return this._markers}connectedCallback(){super.connectedCallback()}disconnectedCallback(){var e;super.disconnectedCallback(),this._observer&&this._observer.disconnect(),this._resizeObserver&&this._resizeObserver.disconnect(),null===(e=this._map)||void 0===e||e.unload()}render(){return html`
33
+ `}return N},supportsHelperText:!1,supportsLabel:!1,supportsSendButton:!1,validator:()=>!p||void 0!==p.lat&&null!==p.lat&&void 0!==p.lng&&null!==p.lng}};let OrMap=class extends r{constructor(){super(),this.type=e.mapType,this._markerStyles=[],this.showGeoCodingControl=!1,this.showBoundaryBoxControl=!1,this.useZoomControl=!0,this.showGeoJson=!0,this.boundary=[],this._loaded=!1,this._markers=[],this.addEventListener(c.NAME,this._onMarkerChangedEvent)}firstUpdated(t){super.firstUpdated(t),e.ready&&this.loadMap()}get markers(){return this._markers}connectedCallback(){super.connectedCallback()}disconnectedCallback(){var e;super.disconnectedCallback(),this._observer&&this._observer.disconnect(),this._resizeObserver&&this._resizeObserver.disconnect(),null==(e=this._map)||e.unload()}render(){return o`
34
34
  <div id="container">
35
35
  <div id="map"></div>
36
36
  <slot></slot>
@@ -38,4 +38,4 @@ var __decorate=this&&this.__decorate||function(e,t,o,r){var a,n=arguments.length
38
38
  <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAQAAADZc7J/AAAABGdBTUEAAYagMeiWXwAAAAJiS0dEAP+Hj8y/AAAESUlEQVRIx5XVbWzdZRnH8c//f07POe36sK7SrYXZjYGzbBokOqd4QtKATdnMDFFSkoFzmWGRQOAFSoYnsBSzxBdmGsN4Y7LEFwZkUdHpDoja/AnJjBvp1sm2upW5PtAV+zBS+7Tz//tiLe0emPF+d9/39fvmunJf9+8K3HBF1drFzurVn5+5XkTwPwBNOt1s0pCjDnnT+Xzy/wOa5jaXnLLfLwzlF0WENwaYckyvUTHS1tnjl+6JFqk+JoMOqqy2JqjPVpXP1k7U1+Ty8paBPk97NX/pYwEdgZUetNkdlirDrHGnyv6y5r3lm4M2WVzwpJfz8XUBHTntnrJO6qqLWE9u/125zBNq0WebN/PXAjqq/cBOVWDasCEsd5MsmEzt/3xP+S6fwNsezPdfBejI6fCEDM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wMTktMDgtMjBUMTU6MTc6NTUrMDA6MDCwJSdSAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE5LTA4LTIwVDE1OjE3OjU1KzAwOjAwwXif7gAAAABJRU5ErkJggg==" />
39
39
  </a>
40
40
  </div>
41
- `}updated(e){var t;super.updated(e),(e.has("center")||e.has("zoom"))&&this.flyTo(this.center,this.zoom),e.has("boundary")&&this.showBoundaryBoxControl&&(null===(t=this._map)||void 0===t||t.createBoundaryBox(this.boundary))}refresh(){this._map&&this._map.loadViewSettings().then((()=>{this._map&&(this._map.setCenter(),this._map.flyTo())}))}loadMap(){this._loaded||(this._mapContainer&&this._slotElement&&(this._map=new MapWidget(this.type,this.shadowRoot,this._mapContainer,this.showGeoCodingControl,this.showBoundaryBoxControl,this.useZoomControl,this.showGeoJson).setCenter(this.center).setZoom(this.zoom).setControls(this.controls).setGeoJson(this.geoJson),this._map.load().then((()=>{var e,t;this._observer=new FlattenedNodesObserver(this._slotElement,(e=>{this._processNewMarkers(e.addedNodes),this._processRemovedMarkers(e.removedNodes)})),null===(e=this._resizeObserver)||void 0===e||e.disconnect(),this._resizeObserver=new ResizeObserver(debounce((()=>{this.resize()}),200));var o=null===(t=this._mapContainer)||void 0===t?void 0:t.parentElement;o&&this._resizeObserver.observe(o)}))),this._loaded=!0)}resize(){this._map&&this._map.resize()}flyTo(e,t){this._map&&this._map.flyTo(e,t)}_onMarkerChangedEvent(e){this._map&&this._map.onMarkerChanged(e.detail.marker,e.detail.property)}_processNewMarkers(e){e.forEach((e=>{if(this._map&&e instanceof OrMapMarker){this._markers.push(e);const t=e.constructor.name;if(this._markerStyles.indexOf(t)<0){const o=e.constructor.styles;let r=[];o&&(Array.isArray(o)?r=o:r.push(o),r.forEach((e=>{const t=document.createElement("style");t.textContent=String(e.toString()),this._mapContainer.children.length>0?this._mapContainer.insertBefore(t,this._mapContainer.children[0]):this._mapContainer.appendChild(t)}))),this._markerStyles.push(t)}this._map.addMarker(e)}}))}_processRemovedMarkers(e){e.forEach((e=>{if(this._map&&e instanceof OrMapMarker){const t=this._markers.indexOf(e);t>=0&&this._markers.splice(t,1),this._map.removeMarker(e)}}))}};OrMap.styles=style,__decorate([property({type:String})],OrMap.prototype,"type",void 0),__decorate([property({type:String,converter:{fromAttribute(e,t){if(!e)return;const o=e.split(",");if(2!==o.length)return;const r=Number(o[0]),a=Number(o[1]);return new LngLat(r,a)},toAttribute(e,t){const o=Util.getLngLat(e);return o?o.lng+","+o.lat:""}}})],OrMap.prototype,"center",void 0),__decorate([property({type:Number})],OrMap.prototype,"zoom",void 0),__decorate([property({type:Boolean})],OrMap.prototype,"showGeoCodingControl",void 0),__decorate([property({type:Boolean})],OrMap.prototype,"showBoundaryBoxControl",void 0),__decorate([property({type:Boolean})],OrMap.prototype,"useZoomControl",void 0),__decorate([property({type:Object})],OrMap.prototype,"geoJson",void 0),__decorate([property({type:Boolean})],OrMap.prototype,"showGeoJson",void 0),__decorate([property({type:Array})],OrMap.prototype,"boundary",void 0),__decorate([query("#map")],OrMap.prototype,"_mapContainer",void 0),__decorate([query("slot")],OrMap.prototype,"_slotElement",void 0),OrMap=__decorate([customElement("or-map")],OrMap);export{OrMap};
41
+ `}updated(e){var t;super.updated(e),(e.has("center")||e.has("zoom"))&&this.flyTo(this.center,this.zoom),e.has("boundary")&&this.showBoundaryBoxControl&&(null==(t=this._map)||t.createBoundaryBox(this.boundary))}refresh(){this._map&&this._map.loadViewSettings().then(()=>{this._map&&(this._map.setCenter(),this._map.flyTo())})}loadMap(){this._loaded||(this._mapContainer&&this._slotElement&&(this._map=new p(this.type,this.shadowRoot,this._mapContainer,this.showGeoCodingControl,this.showBoundaryBoxControl,this.useZoomControl,this.showGeoJson).setCenter(this.center).setZoom(this.zoom).setControls(this.controls).setGeoJson(this.geoJson),this._map.load().then(()=>{this._observer=new t(this._slotElement,e=>{this._processNewMarkers(e.addedNodes),this._processRemovedMarkers(e.removedNodes)}),null==(e=this._resizeObserver)||e.disconnect(),this._resizeObserver=new ResizeObserver(_(()=>{this.resize()},200));var e,o,r=null==(o=this._mapContainer)?void 0:o.parentElement;r&&this._resizeObserver.observe(r)})),this._loaded=!0)}resize(){this._map&&this._map.resize()}flyTo(e,t){this._map&&this._map.flyTo(e,t)}_onMarkerChangedEvent(e){this._map&&this._map.onMarkerChanged(e.detail.marker,e.detail.property)}_processNewMarkers(e){e.forEach(e=>{if(this._map&&e instanceof m){this._markers.push(e);let t=e.constructor.name;if(0>this._markerStyles.indexOf(t)){let o=e.constructor.styles,r=[];o&&(Array.isArray(o)?r=o:r.push(o),r.forEach(e=>{let t=document.createElement("style");t.textContent=String(e.toString()),this._mapContainer.children.length>0?this._mapContainer.insertBefore(t,this._mapContainer.children[0]):this._mapContainer.appendChild(t)})),this._markerStyles.push(t)}this._map.addMarker(e)}})}_processRemovedMarkers(e){e.forEach(e=>{if(this._map&&e instanceof m){let t=this._markers.indexOf(e);t>=0&&this._markers.splice(t,1),this._map.removeMarker(e)}})}};OrMap.styles=d,__decorate([n({type:String})],OrMap.prototype,"type",void 0),__decorate([n({type:String,converter:{fromAttribute(e,t){if(!e)return;let o=e.split(",");if(2===o.length)return new i(Number(o[0]),Number(o[1]))},toAttribute(e,t){let o=h.getLngLat(e);return o?""+o.lng+","+o.lat:""}}})],OrMap.prototype,"center",void 0),__decorate([n({type:Number})],OrMap.prototype,"zoom",void 0),__decorate([n({type:Boolean})],OrMap.prototype,"showGeoCodingControl",void 0),__decorate([n({type:Boolean})],OrMap.prototype,"showBoundaryBoxControl",void 0),__decorate([n({type:Boolean})],OrMap.prototype,"useZoomControl",void 0),__decorate([n({type:Object})],OrMap.prototype,"geoJson",void 0),__decorate([n({type:Boolean})],OrMap.prototype,"showGeoJson",void 0),__decorate([n({type:Array})],OrMap.prototype,"boundary",void 0),__decorate([s("#map")],OrMap.prototype,"_mapContainer",void 0),__decorate([s("slot")],OrMap.prototype,"_slotElement",void 0),OrMap=__decorate([a("or-map")],OrMap);export{h as Util,OrMap};
@@ -1 +1 @@
1
- export function isMapboxURL(r){return 0===r.indexOf("mapbox:")}export function transformMapboxUrl(r,t,o){return r.indexOf("/styles/")>-1&&-1===r.indexOf("/sprite")?{url:normalizeStyleURL(r,t)}:r.indexOf("/sprites/")>-1?{url:normalizeSpriteURL(r,t)}:r.indexOf("/fonts/")>-1?{url:normalizeGlyphsURL(r,t)}:r.indexOf("/v4/")>-1||"Source"===o?{url:normalizeSourceURL(r,t)}:void 0}function parseUrl(r){const t=r.match(/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/);if(!t)throw new Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}function formatUrl(r,t){const o=parseUrl("https://api.mapbox.com");r.protocol=o.protocol,r.authority=o.authority,r.params.push(`access_token=${t}`);const n=r.params.length?`?${r.params.join("&")}`:"";return`${r.protocol}://${r.authority}${r.path}${n}`}function normalizeStyleURL(r,t){const o=parseUrl(r);return o.path=`/styles/v1${o.path}`,formatUrl(o,t)}function normalizeGlyphsURL(r,t){const o=parseUrl(r);return o.path=`/fonts/v1${o.path}`,formatUrl(o,t)}function normalizeSourceURL(r,t){const o=parseUrl(r);return o.path=`/v4/${o.authority}.json`,o.params.push("secure"),formatUrl(o,t)}function normalizeSpriteURL(r,t){const o=parseUrl(r),n=o.path.split(".");let e=n[0];const a=n[1];let s="";return e.indexOf("@2x")&&(e=e.split("@2x")[0],s="@2x"),o.path=`/styles/v1${e}/sprite${s}.${a}`,formatUrl(o,t)}
1
+ export function isMapboxURL(r){return 0===r.indexOf("mapbox:")}export function transformMapboxUrl(r,t,e){return r.indexOf("/styles/")>-1&&-1===r.indexOf("/sprite")?{url:normalizeStyleURL(r,t)}:r.indexOf("/sprites/")>-1?{url:normalizeSpriteURL(r,t)}:r.indexOf("/fonts/")>-1?{url:normalizeGlyphsURL(r,t)}:r.indexOf("/v4/")>-1||"Source"===e?{url:normalizeSourceURL(r,t)}:void 0}function parseUrl(r){let t=r.match(/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/);if(!t)throw Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}function formatUrl(r,t){let e=parseUrl("https://api.mapbox.com");r.protocol=e.protocol,r.authority=e.authority,r.params.push(`access_token=${t}`);let o=r.params.length?`?${r.params.join("&")}`:"";return`${r.protocol}://${r.authority}${r.path}${o}`}function normalizeStyleURL(r,t){let e=parseUrl(r);return e.path=`/styles/v1${e.path}`,formatUrl(e,t)}function normalizeGlyphsURL(r,t){let e=parseUrl(r);return e.path=`/fonts/v1${e.path}`,formatUrl(e,t)}function normalizeSourceURL(r,t){let e=parseUrl(r);return e.path=`/v4/${e.authority}.json`,e.params.push("secure"),formatUrl(e,t)}function normalizeSpriteURL(r,t){let e=parseUrl(r),o=e.path.split("."),a=o[0],l=o[1],n="";return a.indexOf("@2x")&&(a=a.split("@2x")[0],n="@2x"),e.path=`/styles/v1${a}/sprite${n}.${l}`,formatUrl(e,t)}
@@ -1,5 +1,3 @@
1
- /// <reference types="mapbox" />
2
- /// <reference types="leaflet" />
3
1
  import { IControl, LngLat, LngLatLike, Map as MapGL, Marker as MarkerGL, GeoJSONSourceSpecification } from "maplibre-gl";
4
2
  import "@maplibre/maplibre-gl-geocoder/dist/maplibre-gl-geocoder.css";
5
3
  import { ControlPosition, ViewSettings } from "./index";
package/lib/mapwidget.js CHANGED
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,o,i){return new(o||(o=Promise))((function(s,r){function a(e){try{l(i.next(e))}catch(e){r(e)}}function n(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(a,n)}l((i=i.apply(e,t||[])).next())}))};import manager,{DefaultColor4}from"@openremote/core";import maplibregl,{GeolocateControl,Marker as MarkerGL,NavigationControl}from"maplibre-gl";import MaplibreGeocoder from"@maplibre/maplibre-gl-geocoder";import"@maplibre/maplibre-gl-geocoder/dist/maplibre-gl-geocoder.css";import{debounce}from"lodash";import{OrMapClickedEvent,OrMapGeocoderChangeEvent,OrMapLoadedEvent,OrMapLongPressEvent}from"./index";import{getLatLngBounds,getLngLat}from"./util";import{isMapboxURL,transformMapboxUrl}from"./mapbox-url-utils";const mapboxJsStyles=require("mapbox.js/dist/mapbox.css"),maplibreGlStyles=require("maplibre-gl/dist/maplibre-gl.css"),maplibreGeoCoderStyles=require("@maplibre/maplibre-gl-geocoder/dist/maplibre-gl-geocoder.css"),metersToPixelsAtMaxZoom=(e,t)=>e/.075/Math.cos(t*Math.PI/180);let pkey;export class MapWidget{constructor(e,t,o,i=!1,s=!1,r=!0,a=!0){this._loaded=!1,this._markersJs=new Map,this._markersGl=new Map,this._geoJsonSources=[],this._geoJsonLayers=new Map,this._showGeoCodingControl=!1,this._showBoundaryBox=!1,this._useZoomControls=!0,this._showGeoJson=!0,this._clickHandlers=new Map,this._type=e,this._styleParent=t,this._mapContainer=o,this._showGeoCodingControl=i,this._showBoundaryBox=s,this._useZoomControls=r,this._showGeoJson=a}setCenter(e){switch(this._center=getLngLat(e),this._type){case"RASTER":if(this._mapJs){const e=getLngLat(this._center)||(this._viewSettings?getLngLat(this._viewSettings.center):void 0);e&&this._mapJs.setView(e,void 0,{pan:{animate:!1},zoom:{animate:!1}})}break;case"VECTOR":this._mapGl&&this._center&&this._mapGl.setCenter(this._center)}return this}flyTo(e,t){switch(this._type){case"RASTER":this._mapJs;break;case"VECTOR":e||(e=this._center?this._center:this._viewSettings?this._viewSettings.center:void 0),t||(t=this._zoom?this._zoom:this._viewSettings&&this._viewSettings.zoom?this._viewSettings.zoom:void 0),this._mapGl?e&&this._mapGl.flyTo({center:e,zoom:t}):(this._center=e,this._zoom=t)}return this}resize(){switch(this._type){case"RASTER":this._mapJs;break;case"VECTOR":this._mapGl&&this._mapGl.resize()}return this}setZoom(e){switch(this._zoom=e,this._type){case"RASTER":this._mapJs&&this._zoom&&this._mapJs.setZoom(this._zoom,{animate:!1});break;case"VECTOR":this._mapGl&&this._zoom&&this._mapGl.setZoom(this._zoom)}return this}setControls(e){return this._controls=e,this._mapGl&&(this._controls?this._controls.forEach((e=>{if(Array.isArray(e)){const t=e;this._mapGl.addControl(t[0],t[1])}else this._mapGl.addControl(e)})):this._mapGl.addControl(new NavigationControl)),this}setGeoJson(e){var t;return this._geoJsonConfig=e,this._mapGl&&(this._geoJsonConfig?this.loadGeoJSON(this._geoJsonConfig):this.loadGeoJSON(null===(t=this._viewSettings)||void 0===t?void 0:t.geoJson)),this}loadViewSettings(){var e;return __awaiter(this,void 0,void 0,(function*(){let t;t="RASTER"===this._type?yield manager.rest.api.MapResource.getSettingsJs():yield manager.rest.api.MapResource.getSettings();const o=t.data;if(o.override)return o.override;const i=manager.displayRealm||"default";return this._viewSettings=o.options?o.options[i]?o.options[i]:o.options.default:null,this._viewSettings&&(this._mapGl&&(this._mapGl.setMinZoom(this._viewSettings.minZoom),this._mapGl.setMaxZoom(this._viewSettings.maxZoom),this._viewSettings.bounds&&this._mapGl.setMaxBounds(this._viewSettings.bounds),this._geoJsonConfig?yield this.loadGeoJSON(this._geoJsonConfig):yield this.loadGeoJSON(null===(e=this._viewSettings)||void 0===e?void 0:e.geoJson)),this._center?this.setCenter(this._center):this.setCenter(this._viewSettings.center)),o}))}load(){var e;return __awaiter(this,void 0,void 0,(function*(){if(!this._loaded){if("RASTER"===this._type){const e=document.createElement("style");e.id="mapboxJsStyle",e.textContent=mapboxJsStyles,this._styleParent.appendChild(e);const t=yield this.loadViewSettings();let o;if(this._viewSettings){if(o={},o.zoom=this._viewSettings.zoom?this._viewSettings.zoom+1:void 0,this._useZoomControls&&(o.maxZoom=this._viewSettings.maxZoom?this._viewSettings.maxZoom-1:void 0,o.minZoom=this._viewSettings.minZoom?this._viewSettings.minZoom+1:void 0),o.boxZoom=this._viewSettings.boxZoom,this._viewSettings.bounds&&(o.maxBounds=getLatLngBounds(this._viewSettings.bounds)),this._viewSettings.center){const e=getLngLat(this._viewSettings.center);o.center=e?L.latLng(e.lat,e.lng):void 0}if(this._center){const e=getLngLat(this._center);o.center=e?L.latLng(e.lat,e.lng):void 0}this._zoom&&(o.zoom=this._zoom+1)}if(this._mapJs=L.mapbox.map(this._mapContainer,t,o),this._mapJs.on("click",(e=>{this._onMapClick(e.latlng)})),o&&o.maxBounds){const e=this._mapJs.getBoundsZoom(o.maxBounds,!0);(!o.minZoom||o.minZoom<e)&&this._mapJs.setMinZoom(e)}}else{let t=document.createElement("style");t.id="maplibreGlStyle",t.textContent=maplibreGlStyles,this._styleParent.appendChild(t),t=document.createElement("style"),t.id="maplibreGeoCoderStyles",t.textContent=maplibreGeoCoderStyles,this._styleParent.appendChild(t);const o=yield import("maplibre-gl"),i=yield this.loadViewSettings(),s={attributionControl:{compact:!0},container:this._mapContainer,style:i,transformRequest:(e,t)=>(pkey||(pkey=new URL(e).searchParams.get("access_token")||""),isMapboxURL(e)?transformMapboxUrl(e,pkey,t):{headers:new URL(window.origin).hostname===new URL(e).hostname?{Authorization:manager.getAuthorizationHeader()}:{},url:e})};this._viewSettings&&(this._useZoomControls&&(s.maxZoom=this._viewSettings.maxZoom,s.minZoom=this._viewSettings.minZoom),this._viewSettings.bounds&&!this._showBoundaryBox&&(s.maxBounds=this._viewSettings.bounds),s.boxZoom=this._viewSettings.boxZoom,s.zoom=this._viewSettings.zoom,s.center=this._viewSettings.center),this._center=this._center||(this._viewSettings?this._viewSettings.center:void 0),s.center=this._center,this._zoom&&(s.zoom=this._zoom),this._mapGl=new o.Map(s),yield this.styleLoaded(),this._mapGl.on("click",(e=>{this._onMapClick(e.lngLat)})),this._mapGl.on("dblclick",(e=>{this._onMapClick(e.lngLat,!0)})),this._showGeoCodingControl&&this._viewSettings&&this._viewSettings.geocodeUrl&&(this._geocoder=new MaplibreGeocoder({forwardGeocode:this._forwardGeocode.bind(this),reverseGeocode:this._reverseGeocode},{maplibregl,showResultsWhileTyping:!0}),this._geocoder._onKeyDown=debounce((e=>{var t=27,o=9;if(e.keyCode===t&&this._geocoder.options.clearAndBlurOnEsc)return this._geocoder._clear(e),this._geocoder._inputEl.blur();var i=this._geocoder._inputEl.value||e.key;if(!i)return this._geocoder.fresh=!0,e.keyCode!==o&&this._geocoder.clear(e),this._geocoder._clearEl.style.display="none";if(!e.metaKey&&-1===[o,t,37,39,38,40].indexOf(e.keyCode)){if(13===e.keyCode){if(this._geocoder.options.showResultsWhileTyping)return this._geocoder.options.showResultMarkers&&this._geocoder._fitBoundsForMarkers(),this._geocoder._inputEl.value=this._geocoder._typeahead.query,this._geocoder.lastSelected=null,void(this._geocoder._typeahead.selected=null);this._geocoder._typeahead.list.selectingListItem||this._geocoder._geocode(i)}i.length>=this._geocoder.options.minLength&&this._geocoder.options.showResultsWhileTyping&&this._geocoder._geocode(i)}}),300),this._mapGl.addControl(this._geocoder,"top-left"),this._geocoder._inputEl.addEventListener("change",(()=>{var e=this._geocoder._typeahead.selected;this._onGeocodeChange(e)}))),this._controls?this._controls.forEach((e=>{if(Array.isArray(e)){const t=e;this._mapGl.addControl(t[0],t[1])}else this._mapGl.addControl(e)})):(this._mapGl.addControl(new NavigationControl),this._mapGl.addControl(new GeolocateControl({positionOptions:{enableHighAccuracy:!0},showAccuracyCircle:!0,showUserLocation:!0}))),this._geoJsonConfig?yield this.loadGeoJSON(this._geoJsonConfig):yield this.loadGeoJSON(null===(e=this._viewSettings)||void 0===e?void 0:e.geoJson),this._initLongPressEvent()}this._mapContainer.dispatchEvent(new OrMapLoadedEvent),this._loaded=!0,this.createBoundaryBox()}}))}styleLoaded(){return new Promise((e=>{this._mapGl&&this._mapGl.once("style.load",(()=>{e()}))}))}unload(){this._mapGl&&(this._mapGl.remove(),this._mapGl=void 0),this._mapJs&&(this._mapJs.remove(),this._mapJs=void 0)}_onMapClick(e,t=!1){this._mapContainer.dispatchEvent(new OrMapClickedEvent(e,t))}loadGeoJSON(e){return __awaiter(this,void 0,void 0,(function*(){if(this._geoJsonLayers.size>0&&(this._geoJsonLayers.forEach(((e,t)=>this._mapGl.removeLayer(t))),this._geoJsonLayers=new Map),this._geoJsonSources.length>0&&(this._geoJsonSources.forEach((e=>this._mapGl.removeSource(e))),this._geoJsonSources=[]),this._showGeoJson&&e)if("FeatureCollection"==e.source.type){const t=this.groupSourcesByGeometryType(e.source);null==t||t.forEach(((e,t)=>{const o={type:"geojson",data:{type:"FeatureCollection",features:e}},i=this.addGeoJSONSource(o);i&&this.addGeoJSONLayer(t,i.sourceId)}))}else if("Feature"==e.source.type){const t=this.addGeoJSONSource(e.source);t&&this.addGeoJSONLayer(t.source.type,t.sourceId)}else console.error("Could not create layer since source type is neither 'FeatureCollection' nor 'Feature'.")}))}groupSourcesByGeometryType(e){const t=new Map;return e.features.forEach((e=>{let o=t.get(e.geometry.type);null==o&&(o=[]),o.push(e),t.set(e.geometry.type,o)})),t}addGeoJSONSource(e){if(!this._mapGl)return void console.error("mapGl instance not found!");const t=Date.now()+"-"+(this._geoJsonSources.length+1);return this._mapGl.addSource(t,e),this._geoJsonSources.push(t),{source:e,sourceId:t}}addGeoJSONLayer(e,t){if(!this._mapGl)return void console.error("mapGl instance not found!");const o=e,i=t+"-"+o;if(null==this._geoJsonLayers.get(i)){let e=getComputedStyle(this._mapContainer).getPropertyValue("--or-app-color4");null!=e&&0!=e.length||(e=DefaultColor4);let s={id:i,source:t};switch(o){case"Point":case"MultiPoint":s.type="circle",s.paint={"circle-radius":12,"circle-color":e},this._geoJsonLayers.set(i,s),this._mapGl.addLayer(s);break;case"LineString":case"MultiLineString":s.type="line",s.paint={"line-color":e,"line-width":4},this._geoJsonLayers.set(i,s),this._mapGl.addLayer(s);break;case"Polygon":case"MultiPolygon":{s.type="fill",s.paint={"fill-color":e,"fill-opacity":.3},this._geoJsonLayers.set(i,s),this._mapGl.addLayer(s);const o=i+"-outline",r={id:o,source:t,type:"line",paint:{"line-color":e,"line-width":2}};this._geoJsonLayers.set(o,r),this._mapGl.addLayer(r);break}case"GeometryCollection":return void console.error("GeometryCollection GeoJSON is not implemented yet!")}}}addMarker(e){e.hasPosition()&&this._updateMarkerElement(e,!0)}removeMarker(e){this._removeMarkerRadius(e),this._updateMarkerElement(e,!1)}onMarkerChanged(e,t){if(this._loaded)switch(t){case"lat":case"lng":case"radius":e.hasPosition()?e._actualMarkerElement?this._updateMarkerPosition(e):this._updateMarkerElement(e,!0):e._actualMarkerElement&&this._updateMarkerElement(e,!1)}}_updateMarkerPosition(e){switch(this._type){case"RASTER":const t=this._markersJs.get(e);t&&t.setLatLng([e.lat,e.lng]);break;case"VECTOR":const o=this._markersGl.get(e);o&&o.setLngLat([e.lng,e.lat])}this._createMarkerRadius(e)}_updateMarkerElement(e,t){switch(this._type){case"RASTER":let o=this._markersJs.get(e);if(o&&(this._removeMarkerClickHandler(e,e.markerContainer),e._actualMarkerElement=void 0,o.removeFrom(this._mapJs),this._markersJs.delete(e)),t){const t=e._createMarkerElement();if(t){const i=L.divIcon({html:t.outerHTML,className:"or-marker-raster"});o=L.marker([e.lat,e.lng],{icon:i,clickable:e.interactive}),o.addTo(this._mapJs),e._actualMarkerElement=o.getElement()?o.getElement().firstElementChild:void 0,e.interactive&&this._addMarkerClickHandler(e,e.markerContainer),this._markersJs.set(e,o)}e.radius&&this._createMarkerRadius(e)}break;case"VECTOR":let i=this._markersGl.get(e);if(i&&(e._actualMarkerElement=void 0,this._removeMarkerClickHandler(e,i.getElement()),i.remove(),this._markersGl.delete(e)),t){const t=e._createMarkerElement();t&&(i=new MarkerGL({element:t,anchor:"top-left"}).setLngLat([e.lng,e.lat]).addTo(this._mapGl),this._markersGl.set(e,i),e._actualMarkerElement=i.getElement(),e.interactive&&this._addMarkerClickHandler(e,i.getElement())),e.radius&&this._createMarkerRadius(e)}}}_removeMarkerRadius(e){this._mapGl&&this._loaded&&e.radius&&e.lat&&e.lng&&this._mapGl.getSource("circleData")&&(this._mapGl.removeLayer("marker-radius-circle"),this._mapGl.removeSource("circleData"))}_createMarkerRadius(e){this._mapGl&&this._loaded&&e.radius&&e.lat&&e.lng&&(this._removeMarkerRadius(e),this._mapGl.addSource("circleData",{type:"geojson",data:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[e.lng,e.lat]},properties:{title:"You Found Me"}}]}}),this._mapGl.addLayer({id:"marker-radius-circle",type:"circle",source:"circleData",paint:{"circle-radius":["interpolate",["linear"],["zoom"],0,0,20,metersToPixelsAtMaxZoom(e.radius,e.lat)],"circle-color":"red","circle-opacity":.3}}))}createBoundaryBox(e=[]){var t,o;if(this._mapGl&&this._loaded&&this._showBoundaryBox&&(null===(t=this._viewSettings)||void 0===t?void 0:t.bounds)){this._mapGl.getSource("bounds")&&(this._mapGl.removeLayer("bounds"),this._mapGl.removeSource("bounds")),4!==e.length&&(e=null===(o=this._viewSettings)||void 0===o?void 0:o.bounds.toString().split(","));var i=[[[e[0],e[3]],[e[2],e[3]],[e[2],e[1]],[e[0],e[1]],[e[0],e[3]]]];this._mapGl.fitBounds([parseFloat(e[0])+.01,parseFloat(e[1])-.01,parseFloat(e[2])-.01,parseFloat(e[3])+.01]),this._mapGl.addSource("bounds",{type:"geojson",data:{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:i}}}),this._mapGl.addLayer({id:"bounds",type:"fill",source:"bounds",paint:{"fill-color":"#FF0000","fill-opacity":.4}})}}_addMarkerClickHandler(e,t){if(t){const o=t=>{t.stopPropagation(),e._onClick(t)};this._clickHandlers.set(e,o),t.addEventListener("click",o)}}_removeMarkerClickHandler(e,t){const o=this._clickHandlers.get(e);o&&t&&(t.removeEventListener("click",o),this._clickHandlers.delete(e))}_forwardGeocode(e){return __awaiter(this,void 0,void 0,(function*(){const t=[];try{let o=this._viewSettings.geocodeUrl+"/search?q="+e.query+"&format=geojson&polygon_geojson=1&addressdetails=1";const i=yield fetch(o),s=yield i.json();for(let e of s.features){let o=[e.bbox[0]+(e.bbox[2]-e.bbox[0])/2,e.bbox[1]+(e.bbox[3]-e.bbox[1])/2],i={type:"Feature",geometry:{type:"Point",coordinates:o},place_name:e.properties.display_name,properties:e.properties,text:e.properties.display_name,place_type:["place"],center:o};t.push(i)}}catch(e){console.error(`Failed to forwardGeocode with error: ${e}`)}return{features:t}}))}_reverseGeocode(e){return __awaiter(this,void 0,void 0,(function*(){const t=[];try{let o=this._viewSettings.geocodeUrl+"/reverse?lat="+e.lat+"&lon="+e.lon+"&format=geojson&polygon_geojson=1&addressdetails=1";const i=yield fetch(o),s=yield i.json();for(let e of s.features){let o=[e.bbox[0]+(e.bbox[2]-e.bbox[0])/2,e.bbox[1]+(e.bbox[3]-e.bbox[1])/2],i={type:"Feature",geometry:{type:"Point",coordinates:o},place_name:e.properties.display_name,properties:e.properties,text:e.properties.display_name,place_type:["place"],center:o};t.push(i)}}catch(e){console.error(`Failed to reverseGeocode with error: ${e}`)}return{features:t}}))}_initLongPressEvent(){if(this._mapGl){let e,t,o=()=>{e&&clearTimeout(e),e=null};this._mapGl.on("touchstart",(o=>{o.originalEvent.touches.length>1||(t=o.lngLat,e=setTimeout((()=>{this._onLongPress(t)}),500))})),this._mapGl.on("mousedown",(o=>{e||(t=o.lngLat,e=setTimeout((()=>{this._onLongPress(t),e=null}),500))})),this._mapGl.on("dragstart",o),this._mapGl.on("mouseup",o),this._mapGl.on("touchend",o),this._mapGl.on("touchcancel",o),this._mapGl.on("touchmove",o),this._mapGl.on("moveend",o),this._mapGl.on("gesturestart",o),this._mapGl.on("gesturechange",o),this._mapGl.on("gestureend",o)}}_onLongPress(e){this._mapContainer.dispatchEvent(new OrMapLongPressEvent(e))}_onGeocodeChange(e){this._mapContainer.dispatchEvent(new OrMapGeocoderChangeEvent(e))}}
1
+ let pkey;var __awaiter=this&&this.__awaiter||function(e,t,o,i){return new(o||(o=Promise))(function(s,r){function a(e){try{l(i.next(e))}catch(e){r(e)}}function n(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?s(e.value):((t=e.value)instanceof o?t:new o(function(e){e(t)})).then(a,n)}l((i=i.apply(e,t||[])).next())})};import e,{DefaultColor4 as t}from"@openremote/core";import o,{GeolocateControl as i,Marker as s,NavigationControl as r}from"maplibre-gl";import a from"@maplibre/maplibre-gl-geocoder";import"@maplibre/maplibre-gl-geocoder/dist/maplibre-gl-geocoder.css";import{debounce as n}from"lodash";import{OrMapClickedEvent as l,OrMapGeocoderChangeEvent as h,OrMapLoadedEvent as d,OrMapLongPressEvent as _}from"./index";import{getLatLngBounds as c,getLngLat as m}from"./util";import{isMapboxURL as p,transformMapboxUrl as u}from"./mapbox-url-utils";let mapboxJsStyles=require("mapbox.js/dist/mapbox.css"),maplibreGlStyles=require("maplibre-gl/dist/maplibre-gl.css"),maplibreGeoCoderStyles=require("@maplibre/maplibre-gl-geocoder/dist/maplibre-gl-geocoder.css"),metersToPixelsAtMaxZoom=(e,t)=>e/.075/Math.cos(t*Math.PI/180);export class MapWidget{constructor(e,t,o,i=!1,s=!1,r=!0,a=!0){this._loaded=!1,this._markersJs=new Map,this._markersGl=new Map,this._geoJsonSources=[],this._geoJsonLayers=new Map,this._showGeoCodingControl=!1,this._showBoundaryBox=!1,this._useZoomControls=!0,this._showGeoJson=!0,this._clickHandlers=new Map,this._type=e,this._styleParent=t,this._mapContainer=o,this._showGeoCodingControl=i,this._showBoundaryBox=s,this._useZoomControls=r,this._showGeoJson=a}setCenter(e){switch(this._center=m(e),this._type){case"RASTER":if(this._mapJs){let e=m(this._center)||(this._viewSettings?m(this._viewSettings.center):void 0);e&&this._mapJs.setView(e,void 0,{pan:{animate:!1},zoom:{animate:!1}})}break;case"VECTOR":this._mapGl&&this._center&&this._mapGl.setCenter(this._center)}return this}flyTo(e,t){switch(this._type){case"RASTER":this._mapJs;break;case"VECTOR":e||(e=this._center?this._center:this._viewSettings?this._viewSettings.center:void 0),t||(t=this._zoom?this._zoom:this._viewSettings&&this._viewSettings.zoom?this._viewSettings.zoom:void 0),this._mapGl?e&&this._mapGl.flyTo({center:e,zoom:t}):(this._center=e,this._zoom=t)}return this}resize(){switch(this._type){case"RASTER":this._mapJs;break;case"VECTOR":this._mapGl&&this._mapGl.resize()}return this}setZoom(e){switch(this._zoom=e,this._type){case"RASTER":this._mapJs&&this._zoom&&this._mapJs.setZoom(this._zoom,{animate:!1});break;case"VECTOR":this._mapGl&&this._zoom&&this._mapGl.setZoom(this._zoom)}return this}setControls(e){return this._controls=e,this._mapGl&&(this._controls?this._controls.forEach(e=>{Array.isArray(e)?this._mapGl.addControl(e[0],e[1]):this._mapGl.addControl(e)}):this._mapGl.addControl(new r)),this}setGeoJson(e){var t;return this._geoJsonConfig=e,this._mapGl&&(this._geoJsonConfig?this.loadGeoJSON(this._geoJsonConfig):this.loadGeoJSON(null==(t=this._viewSettings)?void 0:t.geoJson)),this}loadViewSettings(){return __awaiter(this,void 0,void 0,function*(){var t;let o=("RASTER"===this._type?yield e.rest.api.MapResource.getSettingsJs():yield e.rest.api.MapResource.getSettings()).data;if(o.override)return o.override;let i=e.displayRealm||"default";return this._viewSettings=o.options?o.options[i]?o.options[i]:o.options.default:null,this._viewSettings&&(this._mapGl&&(this._mapGl.setMinZoom(this._viewSettings.minZoom),this._mapGl.setMaxZoom(this._viewSettings.maxZoom),this._viewSettings.bounds&&this._mapGl.setMaxBounds(this._viewSettings.bounds),this._geoJsonConfig?yield this.loadGeoJSON(this._geoJsonConfig):yield this.loadGeoJSON(null==(t=this._viewSettings)?void 0:t.geoJson)),this._center?this.setCenter(this._center):this.setCenter(this._viewSettings.center)),o})}load(){return __awaiter(this,void 0,void 0,function*(){var t;if(!this._loaded){if("RASTER"===this._type){let e,t=document.createElement("style");t.id="mapboxJsStyle",t.textContent=mapboxJsStyles,this._styleParent.appendChild(t);let o=yield this.loadViewSettings();if(this._viewSettings){if((e={}).zoom=this._viewSettings.zoom?this._viewSettings.zoom+1:void 0,this._useZoomControls&&(e.maxZoom=this._viewSettings.maxZoom?this._viewSettings.maxZoom-1:void 0,e.minZoom=this._viewSettings.minZoom?this._viewSettings.minZoom+1:void 0),e.boxZoom=this._viewSettings.boxZoom,this._viewSettings.bounds&&(e.maxBounds=c(this._viewSettings.bounds)),this._viewSettings.center){let t=m(this._viewSettings.center);e.center=t?L.latLng(t.lat,t.lng):void 0}if(this._center){let t=m(this._center);e.center=t?L.latLng(t.lat,t.lng):void 0}this._zoom&&(e.zoom=this._zoom+1)}if(this._mapJs=L.mapbox.map(this._mapContainer,o,e),this._mapJs.on("click",e=>{this._onMapClick(e.latlng)}),e&&e.maxBounds){let t=this._mapJs.getBoundsZoom(e.maxBounds,!0);(!e.minZoom||e.minZoom<t)&&this._mapJs.setMinZoom(t)}}else{let s=document.createElement("style");s.id="maplibreGlStyle",s.textContent=maplibreGlStyles,this._styleParent.appendChild(s),(s=document.createElement("style")).id="maplibreGeoCoderStyles",s.textContent=maplibreGeoCoderStyles,this._styleParent.appendChild(s);let l=yield import("maplibre-gl"),h=yield this.loadViewSettings(),d={attributionControl:{compact:!0},container:this._mapContainer,style:h,transformRequest:(t,o)=>(pkey||(pkey=new URL(t).searchParams.get("access_token")||""),p(t))?u(t,pkey,o):{headers:new URL(window.origin).hostname===new URL(t).hostname?{Authorization:e.getAuthorizationHeader()}:{},url:t}};this._viewSettings&&(this._useZoomControls&&(d.maxZoom=this._viewSettings.maxZoom,d.minZoom=this._viewSettings.minZoom),this._viewSettings.bounds&&!this._showBoundaryBox&&(d.maxBounds=this._viewSettings.bounds),d.boxZoom=this._viewSettings.boxZoom,d.zoom=this._viewSettings.zoom,d.center=this._viewSettings.center),this._center=this._center||(this._viewSettings?this._viewSettings.center:void 0),d.center=this._center,this._zoom&&(d.zoom=this._zoom),this._mapGl=new l.Map(d),yield this.styleLoaded(),this._mapGl.on("click",e=>{this._onMapClick(e.lngLat)}),this._mapGl.on("dblclick",e=>{this._onMapClick(e.lngLat,!0)}),this._showGeoCodingControl&&this._viewSettings&&this._viewSettings.geocodeUrl&&(this._geocoder=new a({forwardGeocode:this._forwardGeocode.bind(this),reverseGeocode:this._reverseGeocode},{maplibregl:o,showResultsWhileTyping:!0}),this._geocoder._onKeyDown=n(e=>{if(27===e.keyCode&&this._geocoder.options.clearAndBlurOnEsc)return this._geocoder._clear(e),this._geocoder._inputEl.blur();var t=this._geocoder._inputEl.value||e.key;if(!t)return this._geocoder.fresh=!0,9!==e.keyCode&&this._geocoder.clear(e),this._geocoder._clearEl.style.display="none";if(!e.metaKey&&-1===[9,27,37,39,38,40].indexOf(e.keyCode)){if(13===e.keyCode)if(this._geocoder.options.showResultsWhileTyping){this._geocoder.options.showResultMarkers&&this._geocoder._fitBoundsForMarkers(),this._geocoder._inputEl.value=this._geocoder._typeahead.query,this._geocoder.lastSelected=null,this._geocoder._typeahead.selected=null;return}else this._geocoder._typeahead.list.selectingListItem||this._geocoder._geocode(t);t.length>=this._geocoder.options.minLength&&this._geocoder.options.showResultsWhileTyping&&this._geocoder._geocode(t)}},300),this._mapGl.addControl(this._geocoder,"top-left"),this._geocoder._inputEl.addEventListener("change",()=>{var e=this._geocoder._typeahead.selected;this._onGeocodeChange(e)})),this._controls?this._controls.forEach(e=>{Array.isArray(e)?this._mapGl.addControl(e[0],e[1]):this._mapGl.addControl(e)}):(this._mapGl.addControl(new r),this._mapGl.addControl(new i({positionOptions:{enableHighAccuracy:!0},showAccuracyCircle:!0,showUserLocation:!0}))),this._geoJsonConfig?yield this.loadGeoJSON(this._geoJsonConfig):yield this.loadGeoJSON(null==(t=this._viewSettings)?void 0:t.geoJson),this._initLongPressEvent()}this._mapContainer.dispatchEvent(new d),this._loaded=!0,this.createBoundaryBox()}})}styleLoaded(){return new Promise(e=>{this._mapGl&&this._mapGl.once("style.load",()=>{e()})})}unload(){this._mapGl&&(this._mapGl.remove(),this._mapGl=void 0),this._mapJs&&(this._mapJs.remove(),this._mapJs=void 0)}_onMapClick(e,t=!1){this._mapContainer.dispatchEvent(new l(e,t))}loadGeoJSON(e){return __awaiter(this,void 0,void 0,function*(){if(this._geoJsonLayers.size>0&&(this._geoJsonLayers.forEach((e,t)=>this._mapGl.removeLayer(t)),this._geoJsonLayers=new Map),this._geoJsonSources.length>0&&(this._geoJsonSources.forEach(e=>this._mapGl.removeSource(e)),this._geoJsonSources=[]),this._showGeoJson&&e)if("FeatureCollection"==e.source.type){let t=this.groupSourcesByGeometryType(e.source);null==t||t.forEach((e,t)=>{let o=this.addGeoJSONSource({type:"geojson",data:{type:"FeatureCollection",features:e}});o&&this.addGeoJSONLayer(t,o.sourceId)})}else if("Feature"==e.source.type){let t=this.addGeoJSONSource(e.source);t&&this.addGeoJSONLayer(t.source.type,t.sourceId)}else console.error("Could not create layer since source type is neither 'FeatureCollection' nor 'Feature'.")})}groupSourcesByGeometryType(e){let t=new Map;return e.features.forEach(e=>{let o=t.get(e.geometry.type);void 0==o&&(o=[]),o.push(e),t.set(e.geometry.type,o)}),t}addGeoJSONSource(e){if(!this._mapGl)return void console.error("mapGl instance not found!");let t=Date.now()+"-"+(this._geoJsonSources.length+1);return this._mapGl.addSource(t,e),this._geoJsonSources.push(t),{source:e,sourceId:t}}addGeoJSONLayer(e,o){if(!this._mapGl)return void console.error("mapGl instance not found!");let i=o+"-"+e;if(void 0==this._geoJsonLayers.get(i)){let s=getComputedStyle(this._mapContainer).getPropertyValue("--or-app-color4");(void 0==s||0==s.length)&&(s=t);let r={id:i,source:o};switch(e){case"Point":case"MultiPoint":r.type="circle",r.paint={"circle-radius":12,"circle-color":s},this._geoJsonLayers.set(i,r),this._mapGl.addLayer(r);break;case"LineString":case"MultiLineString":r.type="line",r.paint={"line-color":s,"line-width":4},this._geoJsonLayers.set(i,r),this._mapGl.addLayer(r);break;case"Polygon":case"MultiPolygon":{r.type="fill",r.paint={"fill-color":s,"fill-opacity":.3},this._geoJsonLayers.set(i,r),this._mapGl.addLayer(r);let e=i+"-outline",t={id:e,source:o,type:"line",paint:{"line-color":s,"line-width":2}};this._geoJsonLayers.set(e,t),this._mapGl.addLayer(t);break}case"GeometryCollection":return void console.error("GeometryCollection GeoJSON is not implemented yet!")}}}addMarker(e){e.hasPosition()&&this._updateMarkerElement(e,!0)}removeMarker(e){this._removeMarkerRadius(e),this._updateMarkerElement(e,!1)}onMarkerChanged(e,t){if(this._loaded)switch(t){case"lat":case"lng":case"radius":e.hasPosition()?e._actualMarkerElement?this._updateMarkerPosition(e):this._updateMarkerElement(e,!0):e._actualMarkerElement&&this._updateMarkerElement(e,!1)}}_updateMarkerPosition(e){switch(this._type){case"RASTER":let t=this._markersJs.get(e);t&&t.setLatLng([e.lat,e.lng]);break;case"VECTOR":let o=this._markersGl.get(e);o&&o.setLngLat([e.lng,e.lat])}this._createMarkerRadius(e)}_updateMarkerElement(e,t){switch(this._type){case"RASTER":let o=this._markersJs.get(e);if(o&&(this._removeMarkerClickHandler(e,e.markerContainer),e._actualMarkerElement=void 0,o.removeFrom(this._mapJs),this._markersJs.delete(e)),t){let t=e._createMarkerElement();if(t){let i=L.divIcon({html:t.outerHTML,className:"or-marker-raster"});(o=L.marker([e.lat,e.lng],{icon:i,clickable:e.interactive})).addTo(this._mapJs),e._actualMarkerElement=o.getElement()?o.getElement().firstElementChild:void 0,e.interactive&&this._addMarkerClickHandler(e,e.markerContainer),this._markersJs.set(e,o)}e.radius&&this._createMarkerRadius(e)}break;case"VECTOR":let i=this._markersGl.get(e);if(i&&(e._actualMarkerElement=void 0,this._removeMarkerClickHandler(e,i.getElement()),i.remove(),this._markersGl.delete(e)),t){let t=e._createMarkerElement();t&&(i=new s({element:t,anchor:"top-left"}).setLngLat([e.lng,e.lat]).addTo(this._mapGl),this._markersGl.set(e,i),e._actualMarkerElement=i.getElement(),e.interactive&&this._addMarkerClickHandler(e,i.getElement())),e.radius&&this._createMarkerRadius(e)}}}_removeMarkerRadius(e){this._mapGl&&this._loaded&&e.radius&&e.lat&&e.lng&&this._mapGl.getSource("circleData")&&(this._mapGl.removeLayer("marker-radius-circle"),this._mapGl.removeSource("circleData"))}_createMarkerRadius(e){this._mapGl&&this._loaded&&e.radius&&e.lat&&e.lng&&(this._removeMarkerRadius(e),this._mapGl.addSource("circleData",{type:"geojson",data:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[e.lng,e.lat]},properties:{title:"You Found Me"}}]}}),this._mapGl.addLayer({id:"marker-radius-circle",type:"circle",source:"circleData",paint:{"circle-radius":["interpolate",["linear"],["zoom"],0,0,20,metersToPixelsAtMaxZoom(e.radius,e.lat)],"circle-color":"red","circle-opacity":.3}}))}createBoundaryBox(e=[]){var t,o;if(this._mapGl&&this._loaded&&this._showBoundaryBox&&(null==(t=this._viewSettings)?void 0:t.bounds)){this._mapGl.getSource("bounds")&&(this._mapGl.removeLayer("bounds"),this._mapGl.removeSource("bounds")),4!==e.length&&(e=null==(o=this._viewSettings)?void 0:o.bounds.toString().split(","));var i=[[[e[0],e[3]],[e[2],e[3]],[e[2],e[1]],[e[0],e[1]],[e[0],e[3]]]];this._mapGl.fitBounds([parseFloat(e[0])+.01,parseFloat(e[1])-.01,parseFloat(e[2])-.01,parseFloat(e[3])+.01]),this._mapGl.addSource("bounds",{type:"geojson",data:{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:i}}}),this._mapGl.addLayer({id:"bounds",type:"fill",source:"bounds",paint:{"fill-color":"#FF0000","fill-opacity":.4}})}}_addMarkerClickHandler(e,t){if(t){let o=t=>{t.stopPropagation(),e._onClick(t)};this._clickHandlers.set(e,o),t.addEventListener("click",o)}}_removeMarkerClickHandler(e,t){let o=this._clickHandlers.get(e);o&&t&&(t.removeEventListener("click",o),this._clickHandlers.delete(e))}_forwardGeocode(e){return __awaiter(this,void 0,void 0,function*(){let t=[];try{let o=this._viewSettings.geocodeUrl+"/search?q="+e.query+"&format=geojson&polygon_geojson=1&addressdetails=1",i=yield fetch(o);for(let e of(yield i.json()).features){let o=[e.bbox[0]+(e.bbox[2]-e.bbox[0])/2,e.bbox[1]+(e.bbox[3]-e.bbox[1])/2],i={type:"Feature",geometry:{type:"Point",coordinates:o},place_name:e.properties.display_name,properties:e.properties,text:e.properties.display_name,place_type:["place"],center:o};t.push(i)}}catch(e){console.error(`Failed to forwardGeocode with error: ${e}`)}return{features:t}})}_reverseGeocode(e){return __awaiter(this,void 0,void 0,function*(){let t=[];try{let o=this._viewSettings.geocodeUrl+"/reverse?lat="+e.lat+"&lon="+e.lon+"&format=geojson&polygon_geojson=1&addressdetails=1",i=yield fetch(o);for(let e of(yield i.json()).features){let o=[e.bbox[0]+(e.bbox[2]-e.bbox[0])/2,e.bbox[1]+(e.bbox[3]-e.bbox[1])/2],i={type:"Feature",geometry:{type:"Point",coordinates:o},place_name:e.properties.display_name,properties:e.properties,text:e.properties.display_name,place_type:["place"],center:o};t.push(i)}}catch(e){console.error(`Failed to reverseGeocode with error: ${e}`)}return{features:t}})}_initLongPressEvent(){if(this._mapGl){let e,t,o=()=>{e&&clearTimeout(e),e=null};this._mapGl.on("touchstart",o=>{o.originalEvent.touches.length>1||(t=o.lngLat,e=setTimeout(()=>{this._onLongPress(t)},500))}),this._mapGl.on("mousedown",o=>{e||(t=o.lngLat,e=setTimeout(()=>{this._onLongPress(t),e=null},500))}),this._mapGl.on("dragstart",o),this._mapGl.on("mouseup",o),this._mapGl.on("touchend",o),this._mapGl.on("touchcancel",o),this._mapGl.on("touchmove",o),this._mapGl.on("moveend",o),this._mapGl.on("gesturestart",o),this._mapGl.on("gesturechange",o),this._mapGl.on("gestureend",o)}}_onLongPress(e){this._mapContainer.dispatchEvent(new _(e))}_onGeocodeChange(e){this._mapContainer.dispatchEvent(new h(e))}}
@@ -1 +1 @@
1
- {"version":3,"file":"mapwidget.js","sourceRoot":"","sources":["../src/mapwidget.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,OAAO,EAAE,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,UAAU,EAAC,EAGd,gBAAgB,EAMhB,MAAM,IAAI,QAAQ,EAClB,iBAAiB,GAGpB,MAAM,aAAa,CAAC;AACrB,OAAO,gBAAgB,MAAM,gCAAgC,CAAC;AAC9D,OAAO,8DAA8D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,CAAC;YAClD,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAC;QACnD,CAAC;IACL,CAAC;IAAA,CAAC;IACQ,YAAY,CAAC,MAAc;QACjC,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC;IACtE,CAAC;IACS,gBAAgB,CAAC,OAAW;QAClC,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,IAAI,wBAAwB,CAAC,OAAO,CAAC,CAAC,CAAC;IAC5E,CAAC;CACJ"}
@@ -28,9 +28,9 @@ export declare function getMarkerConfigForAssetType(config: MapMarkerAssetConfig
28
28
  export declare function getMarkerConfigAttributeName(config: MapMarkerAssetConfig | undefined, assetType: string | undefined): string | undefined;
29
29
  declare const OrMapMarkerAsset_base: (new (...args: any[]) => {
30
30
  _connectRequested: boolean;
31
- _subscriptionIds?: string[] | undefined;
32
- _assetIds?: string[] | undefined;
33
- _attributeRefs?: import("@openremote/model").AttributeRef[] | undefined;
31
+ _subscriptionIds?: string[];
32
+ _assetIds?: string[];
33
+ _attributeRefs?: import("@openremote/model").AttributeRef[];
34
34
  _status: import("@openremote/core").EventProviderStatus;
35
35
  _statusCallback: (status: import("@openremote/core").EventProviderStatus) => void;
36
36
  connectedCallback(): void;
@@ -52,7 +52,7 @@ declare const OrMapMarkerAsset_base: (new (...args: any[]) => {
52
52
  onEventsConnect(): void;
53
53
  onEventsDisconnect(): void;
54
54
  _onEvent(event: SharedEvent): void;
55
- requestUpdate(name?: PropertyKey | undefined, oldValue?: unknown): void;
55
+ requestUpdate(name?: PropertyKey, oldValue?: unknown): void;
56
56
  readonly isConnected: boolean;
57
57
  }) & typeof OrMapMarker;
58
58
  export declare class OrMapMarkerAsset extends OrMapMarkerAsset_base {
@@ -1 +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};
1
+ var __decorate=this&&this.__decorate||function(t,e,r,i){var s,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,r,i);else for(var n=t.length-1;n>=0;n--)(s=t[n])&&(a=(o<3?s(a):o>3?s(e,r,a):s(e,r))||a);return o>3&&a&&Object.defineProperty(e,r,a),a},__awaiter=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))(function(s,o){function a(t){try{c(i.next(t))}catch(t){o(t)}}function n(t){try{c(i.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?s(t.value):((e=t.value)instanceof r?e:new r(function(t){t(e)})).then(a,n)}c((i=i.apply(t,e||[])).next())})};import{customElement as t,property as e}from"lit/decorators.js";import{OrMapMarker as r}from"./or-map-marker";import{AssetModelUtil as i}from"@openremote/model";import s,{subscribe as o,Util as a}from"@openremote/core";import{getMarkerIconAndColorFromAssetType as n}from"../util";export function getMarkerConfigForAssetType(t,e){if(t&&e&&t[e])return t[e]}export function getMarkerConfigAttributeName(t,e){let r=getMarkerConfigForAssetType(t,e);if(r)return r.attributeName}let OrMapMarkerAsset=class extends o(s)(r){constructor(){super(),this.assetTypeAsIcon=!0,this.visible=!1}set type(t){let e,r=getMarkerConfigForAssetType(this.config,t);if(r&&r.attributeName&&this.asset&&this.asset.attributes&&this.asset.attributes[r.attributeName]&&r.colours){let t=this.asset.attributes[r.attributeName].value;e={markerConfig:r.colours,currentValue:t}}let i=n(t,e);if(!i){this.visible=!1;return}this.assetTypeAsIcon&&(this.icon=i.icon),this.markerColor=Array.isArray(i.color)?i.color[0].colour:i.color||void 0,this.updateColor(this.markerContainer),this.visible=!0}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)return"location"===t.ref.name?void this._updateLocation(t.value):void(this.asset&&(this.asset=a.updateAsset(this.asset,t),this.requestUpdate()));if("asset"===t.eventType)switch(t.cause){case"READ":case"CREATE":case"UPDATE":this.onAssetChanged(t.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;let e=t.attributes?t.attributes.location:void 0;this._updateLocation(e?e.value:null);let r=getMarkerConfigForAssetType(this.config,t.type),s=!r||!r.hideDirection,o=r&&!0===r.showLabel&&!!r.attributeName,n=!!(r&&!1!==r.showUnits);if(o&&t.attributes&&t.attributes[null==r?void 0:r.attributeName]){let e=t.attributes[r.attributeName],s=i.getAttributeAndValueDescriptors(t.type,e.name,e);this.displayValue=a.getAttributeValueAsString(e,s[0],t.type,n,"-")}if(s&&t.attributes&&t.attributes.direction){let 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([e({type:String,reflect:!0,attribute:!0})],OrMapMarkerAsset.prototype,"assetId",void 0),__decorate([e({type:Object,attribute:!0})],OrMapMarkerAsset.prototype,"asset",void 0),__decorate([e()],OrMapMarkerAsset.prototype,"config",void 0),OrMapMarkerAsset=__decorate([t("or-map-marker-asset")],OrMapMarkerAsset);export{OrMapMarkerAsset};
@@ -60,7 +60,7 @@ export declare class OrMapMarker extends LitElement {
60
60
  protected updateActive(container?: HTMLDivElement): void;
61
61
  protected updateInteractive(container?: HTMLDivElement): void;
62
62
  protected refreshMarkerContent(): void;
63
- protected render(): import("lit-html").TemplateResult<1>;
63
+ protected render(): import("lit").TemplateResult<1>;
64
64
  protected _raisePropertyChange(prop: string): void;
65
65
  protected addMarkerClassNames(markerElement: HTMLElement): void;
66
66
  protected addMarkerContainerClassNames(markerContainer: HTMLElement): void;
@@ -1,4 +1,4 @@
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`
1
+ var OrMapMarker_1,__decorate=this&&this.__decorate||function(e,t,r,a){var i,o=arguments.length,s=o<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--)(i=e[n])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s};import{css as e,html as t,LitElement as r,unsafeCSS as a}from"lit";import{customElement as i,property as o,query as s}from"lit/decorators.js";import{markerActiveColorVar as n,markerColorVar as c}from"../style";import{DefaultBoxShadow as l}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 r{constructor(){super(...arguments),this.visible=!0,this.interactive=!0,this.active=!1}static get styles(){return e`
2
2
  .label {
3
3
  background-color: white;
4
4
  width: auto;
@@ -10,9 +10,9 @@ var OrMapMarker_1,__decorate=this&&this.__decorate||function(e,t,r,a){var o,i=ar
10
10
  transform: translate(-50%, -50%);
11
11
  text-align: center;
12
12
  border-radius: 3px;
13
- -webkit-box-shadow: ${unsafeCSS(DefaultBoxShadow)};
14
- -moz-box-shadow: ${unsafeCSS(DefaultBoxShadow)};
15
- box-shadow: ${unsafeCSS(DefaultBoxShadow)};
13
+ -webkit-box-shadow: ${a(l)};
14
+ -moz-box-shadow: ${a(l)};
15
+ box-shadow: ${a(l)};
16
16
  }
17
17
  .label > span {
18
18
  white-space: nowrap;
@@ -65,6 +65,16 @@ var OrMapMarker_1,__decorate=this&&this.__decorate||function(e,t,r,a){var o,i=ar
65
65
  r: 18px;
66
66
  stroke-width: 4px;
67
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`
68
+ `}get markerContainer(){if(this._actualMarkerElement)return this._actualMarkerElement.firstElementChild}_onClick(e){this.dispatchEvent(new OrMapMarkerClickedEvent(this))}_createMarkerElement(){let 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(c),e.style.removeProperty(n);let t=this.getColor(),r=this.getActiveColor();t&&e.style.setProperty(c,t),r&&e.style.setProperty(n,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 t`
69
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};
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(){let 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)=>`
71
+ ${t&&void 0!==t.displayValue?`<div class="label"><span>${t.displayValue}</span></div>`:""}
72
+ ${t&&t.direction?`<div class="direction-icon-wrapper" style="transform: rotate(${t.direction}deg);">
73
+ <svg class="direction-circle">
74
+ <circle/>
75
+ </svg>
76
+ <or-icon class="direction-icon" icon="play"></or-icon>
77
+ </div>`:""}
78
+ <or-icon icon="or:marker"></or-icon>
79
+ <or-icon class="marker-icon" icon="${e||""}"></or-icon>
80
+ `,__decorate([o({type:Number,reflect:!0,attribute:!0})],OrMapMarker.prototype,"lat",void 0),__decorate([o({type:Number,reflect:!0})],OrMapMarker.prototype,"lng",void 0),__decorate([o({type:Number,reflect:!0})],OrMapMarker.prototype,"radius",void 0),__decorate([o({reflect:!0})],OrMapMarker.prototype,"displayValue",void 0),__decorate([o({reflect:!0})],OrMapMarker.prototype,"direction",void 0),__decorate([o({type:Boolean})],OrMapMarker.prototype,"visible",void 0),__decorate([o({type:String})],OrMapMarker.prototype,"icon",void 0),__decorate([o({type:String})],OrMapMarker.prototype,"color",void 0),__decorate([o({type:String})],OrMapMarker.prototype,"activeColor",void 0),__decorate([o({type:Boolean})],OrMapMarker.prototype,"interactive",void 0),__decorate([o({type:Boolean})],OrMapMarker.prototype,"active",void 0),__decorate([s("slot")],OrMapMarker.prototype,"_slot",void 0),OrMapMarker=OrMapMarker_1=__decorate([i("or-map-marker")],OrMapMarker);export{OrMapMarker};
@@ -25,9 +25,9 @@ declare global {
25
25
  export declare const DefaultConfig: MapAssetCardConfig;
26
26
  declare const OrMapAssetCard_base: (new (...args: any[]) => {
27
27
  _connectRequested: boolean;
28
- _subscriptionIds?: string[] | undefined;
29
- _assetIds?: string[] | undefined;
30
- _attributeRefs?: import("@openremote/model").AttributeRef[] | undefined;
28
+ _subscriptionIds?: string[];
29
+ _assetIds?: string[];
30
+ _attributeRefs?: import("@openremote/model").AttributeRef[];
31
31
  _status: import("@openremote/core").EventProviderStatus;
32
32
  _statusCallback: (status: import("@openremote/core").EventProviderStatus) => void;
33
33
  connectedCallback(): void;
@@ -49,7 +49,7 @@ declare const OrMapAssetCard_base: (new (...args: any[]) => {
49
49
  onEventsConnect(): void;
50
50
  onEventsDisconnect(): void;
51
51
  _onEvent(event: SharedEvent): void;
52
- requestUpdate(name?: PropertyKey | undefined, oldValue?: unknown): void;
52
+ requestUpdate(name?: PropertyKey, oldValue?: unknown): void;
53
53
  readonly isConnected: boolean;
54
54
  }) & typeof LitElement;
55
55
  export declare class OrMapAssetCard extends OrMapAssetCard_base {
@@ -1,18 +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}">
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 as t,LitElement as e}from"lit";import{customElement as s,property as r}from"lit/decorators.js";import{classMap as a}from"lit-html/directives/class-map.js";import{AssetModelUtil as o}from"@openremote/model";import i,{subscribe as n,Util as d}from"@openremote/core";import"@openremote/or-icon";import{mapAssetCardStyle as p}from"./style";import{InputType as c}from"@openremote/or-mwc-components/or-mwc-input";import{getMarkerIconAndColorFromAssetType as l}from"./util";import{getMarkerConfigAttributeName as u}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 n(i)(e){constructor(){super(...arguments),this.useAssetColor=!0}static get styles(){return p}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)switch(t.cause){case"READ":case"CREATE":case"UPDATE":this.asset=t.asset;break;case"DELETE":this.asset=void 0}"attribute"===t.eventType&&this.asset&&(this.asset=d.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 t``;let e=this.getIcon(),s=this.getColor(),r=this.getCardConfig(),i=Object.values(this.asset.attributes).filter(t=>"location"!==t.name),n=r&&r.include?r.include:void 0,p=r&&r.exclude?r.exclude:[],l=i.filter(t=>(!n||n.indexOf(t.name)>=0)&&(!p||0>p.indexOf(t.name))&&(!t.meta||!t.meta.hasOwnProperty("showOnDashboard")||!!d.getMetaValue("showOnDashboard",t))).sort(d.sortByString(t=>t.name)),h=u(this.markerconfig,this.asset.type);return t`
2
+ <div id="card-container" style="${s?"--internal-or-map-asset-card-header-color: #"+s+";":""}">
3
3
  <div id="header">
4
- ${t?html`<or-icon icon="${t}"></or-icon>`:""}
4
+ ${e?t`<or-icon icon="${e}"></or-icon>`:""}
5
5
  <span id="title">${this.asset.name}</span>
6
6
  </div>
7
7
  <div id="attribute-list">
8
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>`}}))}
9
+ ${l.map(e=>{if(!this.asset||!this.asset.type)return;let s=o.getAttributeAndValueDescriptors(this.asset.type,e.name,e);if(s&&s.length){let r=d.getAttributeLabel(e,s[0],this.asset.type,!0),o=d.getAttributeValueAsString(e,s[0],this.asset.type,!1,"-"),i={highlighted:h===e.name};return t`<li class="${a(i)}"><span class="attribute-name">${r}</span><span class="attribute-value">${o}</span></li>`}})}
10
10
  </ul>
11
11
  </div>
12
- ${r&&r.hideViewAsset?html``:html`
12
+ ${r&&r.hideViewAsset?t``:t`
13
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>
14
+ <or-mwc-input .type="${c.BUTTON}" label="viewAsset" @or-mwc-input-changed="${t=>{t.preventDefault(),this._loadAsset(this.asset.id)}}"></or-mwc-input>
15
15
  </div>
16
16
  `}
17
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};
18
+ `}_loadAsset(t){this.dispatchEvent(new OrMapAssetCardLoadAssetEvent(t))}getIcon(){var t;if(this.asset)return(null==(t=l(o.getAssetDescriptor(this.asset.type)))?void 0:t.icon)||void 0}getColor(){var t;if(this.asset){let e=null==(t=l(o.getAssetDescriptor(this.asset.type)))?void 0:t.color;if(e)return"string"==typeof e?e:e[0].colour}}};__decorate([r({type:String,reflect:!0,attribute:!0})],OrMapAssetCard.prototype,"assetId",void 0),__decorate([r({type:Object,attribute:!0})],OrMapAssetCard.prototype,"asset",void 0),__decorate([r({type:Object})],OrMapAssetCard.prototype,"config",void 0),__decorate([r({type:Object})],OrMapAssetCard.prototype,"markerconfig",void 0),__decorate([r({type:Boolean,attribute:!0})],OrMapAssetCard.prototype,"useAssetColor",void 0),OrMapAssetCard=__decorate([s("or-map-asset-card")],OrMapAssetCard);export{OrMapAssetCard};