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

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,2 @@
1
+ /* eslint:disable:class-name */
2
+ declare module "@maplibre/maplibre-gl-geocoder";
package/README.md CHANGED
@@ -1,46 +1,113 @@
1
- # @openremote/or-map
2
-
3
- > IN DEVELOPMENT
4
-
1
+ # @openremote/or-map \<or-map\>
5
2
  [![NPM Version][npm-image]][npm-url]
6
3
  [![Linux Build][travis-image]][travis-url]
7
4
  [![Test Coverage][coveralls-image]][coveralls-url]
8
5
 
9
- ## Install
6
+ Web Component for displaying a Mapbox map; either raster or vector (default). This component requires an OpenRemote
7
+ Manager to retrieve map settings and tiles.
10
8
 
9
+ ## Install
11
10
  ```bash
12
- npm i -S @openremote/or-map
11
+ npm i @openremote/or-map
12
+ yarn add @openremote/or-map
13
13
  ```
14
14
 
15
15
  ## Usage
16
+ For a full list of properties, methods and options refer to the TypeDoc generated [documentation]().
16
17
 
17
- TODO
18
-
19
- ```{html}
20
- /**
21
- * By default this generates the following marker HTML:
22
- * <div class="or-map-marker">
23
- * <CHILD NODE>
24
- * <CHILD NODE>
25
- * </div>
26
- *
27
- * If there are no child nodes then the default or-map-marker is
28
- * used:
29
- * <div class="or-map-marker or-map-marker-default">
30
- * <div>
31
- * <or-icon icon="or:marker"></or-icon>
32
- * <or-icon class="marker-icon" icon="${icon || ""}"></or-icon>
33
- * </div>
34
- * </div>
35
- */
18
+ ```$html
19
+ <or-map center="5.454250, 51.445990" zoom="5" style="height: 500px; width: 100%;" />
36
20
  ```
37
21
 
38
- ## License
22
+ For a raster map (raster tile serving in the OpenRemote Manager must be properly configured):
23
+
24
+ ```$html
25
+ <or-map type="RASTER" center="5.454250, 51.445990" zoom="5" style="height: 500px; width: 100%;" />
26
+ ```
27
+
28
+ The center and zoom are optional overrides for the defaults that will be defined in the `mapsettings` loaded from the
29
+ OpenRemote Manager; each realm can have different `mapsettings` with a fallback to the default.
30
+
31
+ Markers can be added via markup as children:
32
+
33
+ ```$html
34
+ <or-map id="vectorMap" center="5.454250, 51.445990" zoom="5" style="height: 500px; width: 100%;">
35
+ <or-map-marker id="demo-marker" lng="5.454250" class="marker" icon="or:logo-plain"></or-map-marker>
36
+ </or-map>
37
+ ```
38
+
39
+ Or programmatically:
40
+
41
+ ```$typescript
42
+ const vectorMap = docuemnt.getElementById("vectorMap");
43
+ const assetMarker = document.createElement("or-map-marker-asset");
44
+ assetMarker.setAttribute("asset", apartment1.id!);
45
+ vectorMap.appendChild(assetMarker);
46
+ ```
47
+
48
+ There are two types of built in markers:
39
49
 
50
+ ### \<or-map-marker\>
51
+ This is a basic marker and the base class for any other markers and it has the following attributes:
52
+
53
+ * lat*
54
+ * lng*
55
+ * visible (show/hide the marker)
56
+ * icon (uses `or-icon` to render an icon inside the default marker)
57
+ * interactive (sets pointer events for the marker)
58
+
59
+ *required
60
+
61
+ The visual content of the marker can be controlled by adding child content to the `or-map-marker` element; any child
62
+ content is rendered inside a `div`. If no children are specified then the default marker will be used. Subclasses can
63
+ override the `createMarkerContent()` method to control the look of the marker.
64
+
65
+ ### \<or-map-marker-asset\>
66
+ This links the marker to an Asset in the OpenRemote Manager by using the `asset-mixin` and adds the following attribute:
67
+
68
+ * asset* (ID of the Asset to link)
69
+
70
+ *required
71
+
72
+ The Asset must be valid, accessible and must have a valid `location` attribute otherwise no marker will be shown. By
73
+ default the `AssetType` is used to set the icon of the marker but this can be controlled by setting the `assetTypeAsIcon`
74
+ property.
75
+
76
+ ### Styling
77
+ All styling is done through CSS, the following CSS variables can be used:
78
+
79
+ ```$css
80
+ --or-map-marker-fill (default: #1D5632)
81
+ --or-map-marker-stroke (default: none)
82
+ --or-map-marker-width (default: 48px)
83
+ --or-map-marker-height (default: 48px)
84
+ --or-map-marker-transform (default: translate(-24px, -45px))
85
+
86
+ --or-map-marker-icon-fill (default: #FFF)
87
+ --or-map-marker-icon-stroke (default: none)
88
+ --or-map-marker-icon-width (default: 24px)
89
+ --or-map-marker-icon-height (default: 24px)
90
+ --or-map-marker-icon-transform (default: translate(-50%, -19px))
91
+ ```
92
+
93
+ ### Events
94
+ The following DOM events may be fired by the component and markers:
95
+
96
+ * `click` - Standard click event is fired when the map itself is clicked
97
+ * `OrMapMarkerEvent.CLICKED` - A map marker has been clicked; details contains the clicked `marker`
98
+ * `OrMapMarkerEvent.CHANGED` - A map marker has been modified; details contains the changed `marker` and name of changed
99
+ `property`
100
+
101
+ ## Supported Browsers
102
+ The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge. In addition,
103
+ Internet Explorer 11 is also supported.
104
+
105
+
106
+ ## License
40
107
  [GNU AGPL](https://www.gnu.org/licenses/agpl-3.0.en.html)
41
108
 
42
109
  [npm-image]: https://img.shields.io/npm/v/live-xxx.svg
43
- [npm-url]: https://npmjs.org/package/live-xxx
110
+ [npm-url]: https://npmjs.org/package/@openremote/or-map
44
111
  [travis-image]: https://img.shields.io/travis/live-js/live-xxx/master.svg
45
112
  [travis-url]: https://travis-ci.org/live-js/live-xxx
46
113
  [coveralls-image]: https://img.shields.io/coveralls/live-js/live-xxx/master.svg
package/lib/index.d.ts ADDED
@@ -0,0 +1,115 @@
1
+ import { EventCallback } from "@openremote/core";
2
+ import { FlattenedNodesObserver } from "@polymer/polymer/lib/utils/flattened-nodes-observer.js";
3
+ import { CSSResult, LitElement, PropertyValues } from "lit";
4
+ import { IControl, LngLat, LngLatBoundsLike, LngLatLike, Map as MapGL } from "maplibre-gl";
5
+ import { MapWidget } from "./mapwidget";
6
+ import "./markers/or-map-marker";
7
+ import "./markers/or-map-marker-asset";
8
+ import { OrMapMarker, OrMapMarkerChangedEvent } from "./markers/or-map-marker";
9
+ import * as Util from "./util";
10
+ import { OrMwcInput, ValueInputProviderGenerator } from "@openremote/or-mwc-components/or-mwc-input";
11
+ import { GeoJsonConfig, MapType } from "@openremote/model";
12
+ export { Util, LngLatLike };
13
+ export * from "./markers/or-map-marker";
14
+ export * from "./markers/or-map-marker-asset";
15
+ export { IControl } from "maplibre-gl";
16
+ export * from "./or-map-asset-card";
17
+ export interface ViewSettings {
18
+ center: LngLatLike;
19
+ bounds?: LngLatBoundsLike | null;
20
+ zoom: number;
21
+ maxZoom: number;
22
+ minZoom: number;
23
+ boxZoom: boolean;
24
+ geocodeUrl: String;
25
+ geoJson?: GeoJsonConfig;
26
+ }
27
+ export interface MapEventDetail {
28
+ lngLat: LngLat;
29
+ doubleClick: boolean;
30
+ }
31
+ export interface MapGeocoderEventDetail {
32
+ geocode: any;
33
+ }
34
+ export declare class OrMapLoadedEvent extends CustomEvent<void> {
35
+ static readonly NAME = "or-map-loaded";
36
+ constructor();
37
+ }
38
+ export declare class OrMapClickedEvent extends CustomEvent<MapEventDetail> {
39
+ static readonly NAME = "or-map-clicked";
40
+ constructor(lngLat: LngLat, doubleClick?: boolean);
41
+ }
42
+ export declare class OrMapLongPressEvent extends CustomEvent<MapEventDetail> {
43
+ static readonly NAME = "or-map-long-press";
44
+ constructor(lngLat: LngLat);
45
+ }
46
+ export declare class OrMapGeocoderChangeEvent extends CustomEvent<MapGeocoderEventDetail> {
47
+ static readonly NAME = "or-map-geocoder-change";
48
+ constructor(geocode: any);
49
+ }
50
+ declare global {
51
+ export interface HTMLElementEventMap {
52
+ [OrMapClickedEvent.NAME]: OrMapClickedEvent;
53
+ [OrMapLoadedEvent.NAME]: OrMapLoadedEvent;
54
+ [OrMapLongPressEvent.NAME]: OrMapLongPressEvent;
55
+ [OrMapGeocoderChangeEvent.NAME]: OrMapGeocoderChangeEvent;
56
+ }
57
+ }
58
+ export type ControlPosition = "top-right" | "top-left" | "bottom-right" | "bottom-left";
59
+ export declare class CenterControl {
60
+ protected map?: MapGL;
61
+ protected elem?: HTMLElement;
62
+ pos?: LngLatLike;
63
+ onAdd(map: MapGL): HTMLElement;
64
+ onRemove(map: MapGL): void;
65
+ }
66
+ export declare class CoordinatesControl {
67
+ protected map?: MapGL;
68
+ protected elem?: HTMLElement;
69
+ protected input: OrMwcInput;
70
+ protected _readonly: boolean;
71
+ protected _value: any;
72
+ protected _valueChangedHandler: (value: LngLat | undefined) => void;
73
+ constructor(disabled: boolean | undefined, valueChangedHandler: (value: LngLat | undefined) => void);
74
+ onAdd(map: MapGL): HTMLElement;
75
+ onRemove(map: MapGL): void;
76
+ set readonly(readonly: boolean);
77
+ set value(value: any);
78
+ }
79
+ export declare const geoJsonPointInputTemplateProvider: ValueInputProviderGenerator;
80
+ export declare class OrMap extends LitElement {
81
+ static styles: CSSResult;
82
+ type: MapType;
83
+ protected _markerStyles: string[];
84
+ center?: LngLatLike;
85
+ zoom?: number;
86
+ showGeoCodingControl: boolean;
87
+ showBoundaryBoxControl: boolean;
88
+ useZoomControl: boolean;
89
+ geoJson?: GeoJsonConfig;
90
+ showGeoJson: boolean;
91
+ boundary: string[];
92
+ controls?: (IControl | [IControl, ControlPosition?])[];
93
+ protected _initCallback?: EventCallback;
94
+ protected _map?: MapWidget;
95
+ protected _loaded: boolean;
96
+ protected _observer?: FlattenedNodesObserver;
97
+ protected _markers: OrMapMarker[];
98
+ protected _resizeObserver?: ResizeObserver;
99
+ protected _mapContainer?: HTMLElement;
100
+ protected _slotElement?: HTMLSlotElement;
101
+ constructor();
102
+ protected firstUpdated(_changedProperties: PropertyValues): void;
103
+ get markers(): OrMapMarker[];
104
+ connectedCallback(): void;
105
+ disconnectedCallback(): void;
106
+ protected render(): import("lit-html").TemplateResult<1>;
107
+ protected updated(changedProperties: PropertyValues): void;
108
+ refresh(): void;
109
+ loadMap(): void;
110
+ resize(): void;
111
+ flyTo(coordinates?: LngLatLike, zoom?: number): void;
112
+ protected _onMarkerChangedEvent(evt: OrMapMarkerChangedEvent): void;
113
+ protected _processNewMarkers(nodes: Element[]): void;
114
+ protected _processRemovedMarkers(nodes: Element[]): void;
115
+ }
package/lib/index.js ADDED
@@ -0,0 +1,41 @@
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>
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`
7
+ <style>
8
+ .dialog-container {
9
+ flex-direction: column !important;
10
+ }
11
+ .dialog-container .long-press-msg {
12
+ display: block;
13
+ text-align: center;
14
+ }
15
+ or-map {
16
+ width: 600px !important;
17
+ min-height: 600px !important;
18
+ }
19
+ </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>
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`
34
+ <div id="container">
35
+ <div id="map"></div>
36
+ <slot></slot>
37
+ <a id="openremote" href="https://openremote.io/" target="_blank">
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+S6fwNsezPdfBejI6fCEDMa95oAT/t31pVxDQ6p6oy2WYSb18w0D2V3Klez2w3y8CNAR2G6vShxXUCxMkXLvS7Y6E/5+3emaJ92JqezzG+8M2nHW/flTi59xladU4phtfluYgnsDWUt8Nv7+8UfO73UUuenvDLxuCKu0RQt90BFo14wxzzpamD8uExtHSsu5HSP7XMCtZ5uTPyO0SdVCBlXahHjNG4WFrGY9Y4tXzODL7zb7NYJS64eHzWK92xYAa9yBKa8Wphf0xaQ4XOz0qF9JhMnXh//mIm4dnDSMOusWALepwQUnrm2t4pi9hrGyP+ccloxV6kOZFemoWi2mOpclaQycqGlt9R8XHS/GixinnVWvbDpjDEEpNpdnWrtd+HvZWzMQT9xjj1iXzUau6MPS9X9NKOeTmqzPpZWwfMkEKnza2ivimqxCKZjQa9BMmFI2D+gxibql4z7EiobYOSy1o7V6Xt1aYacGvD/7lse1+GZ9t0Zc8kHaGcOa1K6o+FePL1iy7K7wYHy70FZa9+qVWOm7tgslfpecKcy46GS0xXKM6g6d14VU+RfTnRJ8Y223w8j4tkMOOeR1j6nAMT8tzkCUcvlbn3ImbJn0RyWC+1af1Iv6ukcbf+aIRKDR3b5ipVCiy+PenaupWRsSfzCWim0ftUmdiqrJwWLpbmk3196UfXG0X6NKIWKDXva0I0UQZT2nRaDfc/mhgCj0PS9ImZzefbg5fliIvuTA++/0ZaYDTDqqpzhn6lHoW36iSuLHnslfCiBqdMBGDI6/0LUhfkgGiWFbC29c+epRaJMX3YJuD+R75l15wG4DaKh5dsPJsj0GXLaawavkWY/MyUcU/JOPHCkK7fAjNZiIf/PeX/vWx1814muF0Y/EKWs95mFVuKhgX352EYAoY5vnNSDRF/9p/MgHfQ2dldNIqbPeJm2aBBix20vzg26RpUUpLfb43FxZU4YMmEJGoxXKQeIfCg4uzMkrTDVitZ0ecst1B05i0Cv26Vk8H68JjFKabXa/Zkul5w5Lxp120EHdlyu/AQCiQI1P+YxaGcwY1+20kasnM/wXCa5/Ik1hKTEAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTktMDgtMjBUMTU6MTc6NTUrMDA6MDCwJSdSAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE5LTA4LTIwVDE1OjE3OjU1KzAwOjAwwXif7gAAAABJRU5ErkJggg==" />
39
+ </a>
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};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,OAAwB,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAC,sBAAsB,EAAC,MAAM,wDAAwD,CAAC;AAC9F,OAAO,EAAY,IAAI,EAAE,UAAU,EAAiB,MAAM,KAAK,CAAC;AAChE,OAAO,EAAC,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAW,MAAM,EAA8C,gBAAgB,EAAC,MAAM,aAAa,CAAC;AAC3G,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAC;AAC9B,OAAO,yBAAyB,CAAC;AACjC,OAAO,+BAA+B,CAAC;AACvC,OAAO,EAAC,WAAW,EAAE,uBAAuB,EAAC,MAAM,yBAAyB,CAAC;AAC7E,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,EACH,SAAS,EACT,UAAU,EAGb,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAC,WAAW,EAAE,UAAU,EAAC,MAAM,6CAA6C,CAAC;AACpF,OAAO,EAAC,kCAAkC,EAAC,MAAM,QAAQ,CAAC;AAC1D,OAAO,EAAC,OAAO,EAAC,MAAM,0BAA0B,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAGlC,aAAa;AACb,OAAO,EAAC,IAAI,EAAa,CAAC;AAC1B,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAE9C,cAAc,qBAAqB,CAAC;AAoBpC,MAAM,OAAO,gBAAiB,SAAQ,WAAiB;IAInD;QACI,KAAK,CAAC,gBAAgB,CAA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AC,CAAC;uCACO;AAarB;IADT,KAAK,CAAC,MAAM,CAAC;4CACwB;AAG5B;IADT,KAAK,CAAC,MAAM,CAAC;2CAC2B;AAtEhC,KAAK;IADjB,aAAa,CAAC,QAAQ,CAAC;GACX,KAAK,CAmPjB"}
@@ -0,0 +1,94 @@
1
+ /// <reference types="mapbox" />
2
+ /// <reference types="leaflet" />
3
+ import { IControl, LngLat, LngLatLike, Map as MapGL, Marker as MarkerGL, GeoJSONSourceSpecification } from "maplibre-gl";
4
+ import "@maplibre/maplibre-gl-geocoder/dist/maplibre-gl-geocoder.css";
5
+ import { ControlPosition, ViewSettings } from "./index";
6
+ import { OrMapMarker } from "./markers/or-map-marker";
7
+ import { GeoJsonConfig, MapType } from "@openremote/model";
8
+ import { Feature, FeatureCollection } from "geojson";
9
+ export declare class MapWidget {
10
+ protected _mapJs?: L.mapbox.Map;
11
+ protected _mapGl?: MapGL;
12
+ protected _type: MapType;
13
+ protected _styleParent: Node;
14
+ protected _mapContainer: HTMLElement;
15
+ protected _loaded: boolean;
16
+ protected _markersJs: Map<OrMapMarker, L.Marker>;
17
+ protected _markersGl: Map<OrMapMarker, MarkerGL>;
18
+ protected _geoJsonConfig?: GeoJsonConfig;
19
+ protected _geoJsonSources: string[];
20
+ protected _geoJsonLayers: Map<string, any>;
21
+ protected _viewSettings?: ViewSettings;
22
+ protected _center?: LngLatLike;
23
+ protected _zoom?: number;
24
+ protected _showGeoCodingControl: boolean;
25
+ protected _showBoundaryBox: boolean;
26
+ protected _useZoomControls: boolean;
27
+ protected _showGeoJson: boolean;
28
+ protected _controls?: (IControl | [IControl, ControlPosition?])[];
29
+ protected _clickHandlers: Map<OrMapMarker, (ev: MouseEvent) => void>;
30
+ protected _geocoder?: any;
31
+ constructor(type: MapType, styleParent: Node, mapContainer: HTMLElement, showGeoCodingControl?: boolean, showBoundaryBox?: boolean, useZoomControls?: boolean, showGeoJson?: boolean);
32
+ setCenter(center?: LngLatLike): this;
33
+ flyTo(coordinates?: LngLatLike, zoom?: number): this;
34
+ resize(): this;
35
+ setZoom(zoom?: number): this;
36
+ setControls(controls?: (IControl | [IControl, ControlPosition?])[]): this;
37
+ setGeoJson(geoJsonConfig?: GeoJsonConfig): this;
38
+ loadViewSettings(): Promise<any>;
39
+ load(): Promise<void>;
40
+ protected styleLoaded(): Promise<void>;
41
+ unload(): void;
42
+ protected _onMapClick(lngLat: LngLat, doubleClicked?: boolean): void;
43
+ protected loadGeoJSON(geoJsonConfig?: GeoJsonConfig): Promise<void>;
44
+ groupSourcesByGeometryType(sources: FeatureCollection): Map<string, Feature[]> | undefined;
45
+ addGeoJSONSource(source: GeoJSONSourceSpecification): {
46
+ source: GeoJSONSourceSpecification;
47
+ sourceId: string;
48
+ } | undefined;
49
+ addGeoJSONLayer(typeString: string, sourceId: string): void;
50
+ addMarker(marker: OrMapMarker): void;
51
+ removeMarker(marker: OrMapMarker): void;
52
+ onMarkerChanged(marker: OrMapMarker, prop: string): void;
53
+ protected _updateMarkerPosition(marker: OrMapMarker): void;
54
+ protected _updateMarkerElement(marker: OrMapMarker, doAdd: boolean): void;
55
+ protected _removeMarkerRadius(marker: OrMapMarker): void;
56
+ protected _createMarkerRadius(marker: OrMapMarker): void;
57
+ createBoundaryBox(boundsArray?: string[]): void;
58
+ protected _addMarkerClickHandler(marker: OrMapMarker, elem: HTMLElement): void;
59
+ protected _removeMarkerClickHandler(marker: OrMapMarker, elem: HTMLElement): void;
60
+ protected _forwardGeocode(config: any): Promise<{
61
+ features: {
62
+ type: string;
63
+ geometry: {
64
+ type: string;
65
+ coordinates: any[];
66
+ };
67
+ place_name: any;
68
+ properties: any;
69
+ text: any;
70
+ place_type: string[];
71
+ center: any[];
72
+ }[];
73
+ }>;
74
+ _reverseGeocode(config: {
75
+ lat: number;
76
+ lon: number;
77
+ }): Promise<{
78
+ features: {
79
+ type: string;
80
+ geometry: {
81
+ type: string;
82
+ coordinates: any[];
83
+ };
84
+ place_name: any;
85
+ properties: any;
86
+ text: any;
87
+ place_type: string[];
88
+ center: any[];
89
+ }[];
90
+ }>;
91
+ protected _initLongPressEvent(): void;
92
+ protected _onLongPress(lngLat: LngLat): void;
93
+ protected _onGeocodeChange(geocode: any): void;
94
+ }
@@ -0,0 +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";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);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,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)=>({headers:{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))}}
@@ -0,0 +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,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAEH,iBAAiB,EACjB,wBAAwB,EACxB,gBAAgB,EAChB,mBAAmB,GAEtB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAIpD,MAAM,cAAc,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;AAC5D,MAAM,gBAAgB,GAAG,OAAO,CAAC,kCAAkC,CAAC,CAAC;AACrE,MAAM,sBAAsB,GAAG,OAAO,CAAC,8DAA8D,CAAC,CAAC;AAEvG,qBAAqB;AACrB,MAAM,uBAAuB,GAAG,CAAC,MAAc,EAAE,QAAgB,EAAE,EAAE,CACnE,MAAM,GAAG,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,GAAG,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC;AAGtD,MAAM,OAAO,SAAS;IAuBlB,YAAY,IAAa,EAAE,WAAiB,EAAE,YAAyB,EAAE,uBAAgC,KAAK,EAAE,eAAe,GAAG,KAAK,EAAE,eAAe,GAAG,IAAI,EAAE,WAAW,GAAG,IAAI;QAjBzK,YAAO,GAAY,KAAK,CAAC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C,MAAM,CAAC,EAAE,CAAC,eAAe,EAAE,gBAAgB,CAAC,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"}
@@ -0,0 +1,78 @@
1
+ import { PropertyValues } from "lit";
2
+ import { OrMapMarker } from "./or-map-marker";
3
+ import { Asset, GeoJSONPoint, SharedEvent } from "@openremote/model";
4
+ export type MapMarkerConfig = {
5
+ attributeName: string;
6
+ showLabel?: boolean;
7
+ showUnits?: boolean;
8
+ hideDirection?: boolean;
9
+ colours?: MapMarkerColours;
10
+ };
11
+ export type MapMarkerColours = AttributeMarkerColours | RangeAttributeMarkerColours;
12
+ export type MapMarkerAssetConfig = {
13
+ [assetType: string]: MapMarkerConfig;
14
+ };
15
+ export type AttributeMarkerColours = {
16
+ type: "string" | "boolean";
17
+ [value: string]: string;
18
+ };
19
+ export type RangeAttributeMarkerColours = {
20
+ type: "range";
21
+ ranges: AttributeMarkerColoursRange[];
22
+ };
23
+ export type AttributeMarkerColoursRange = {
24
+ min: number;
25
+ colour: string;
26
+ };
27
+ export declare function getMarkerConfigForAssetType(config: MapMarkerAssetConfig | undefined, assetType: string | undefined): MapMarkerConfig | undefined;
28
+ export declare function getMarkerConfigAttributeName(config: MapMarkerAssetConfig | undefined, assetType: string | undefined): string | undefined;
29
+ declare const OrMapMarkerAsset_base: (new (...args: any[]) => {
30
+ _connectRequested: boolean;
31
+ _subscriptionIds?: string[] | undefined;
32
+ _assetIds?: string[] | undefined;
33
+ _attributeRefs?: import("@openremote/model").AttributeRef[] | undefined;
34
+ _status: import("@openremote/core").EventProviderStatus;
35
+ _statusCallback: (status: import("@openremote/core").EventProviderStatus) => void;
36
+ connectedCallback(): void;
37
+ disconnectedCallback(): void;
38
+ connectEvents(): void;
39
+ disconnectEvents(): void;
40
+ _doConnect(): Promise<void>;
41
+ readonly eventsConnected: boolean;
42
+ _onEventProviderStatusChanged(status: import("@openremote/core").EventProviderStatus): void;
43
+ _onEventsConnect(): void;
44
+ _onEventsDisconnect(): void;
45
+ _addEventSubscriptions(): Promise<void>;
46
+ _removeEventSubscriptions(): void;
47
+ _refreshEventSubscriptions(): void;
48
+ assetIds: string[] | undefined;
49
+ attributeRefs: import("@openremote/model").AttributeRef[] | undefined;
50
+ _sendEvent(event: SharedEvent): void;
51
+ _sendEventWithReply<U extends SharedEvent, V extends SharedEvent>(event: import("@openremote/model").EventRequestResponseWrapper<U>): Promise<V>;
52
+ onEventsConnect(): void;
53
+ onEventsDisconnect(): void;
54
+ _onEvent(event: SharedEvent): void;
55
+ requestUpdate(name?: PropertyKey | undefined, oldValue?: unknown): void;
56
+ readonly isConnected: boolean;
57
+ }) & typeof OrMapMarker;
58
+ export declare class OrMapMarkerAsset extends OrMapMarkerAsset_base {
59
+ assetId?: string;
60
+ asset?: Asset;
61
+ config?: MapMarkerAssetConfig;
62
+ assetTypeAsIcon: boolean;
63
+ constructor();
64
+ protected markerColor?: string;
65
+ protected set type(type: string | undefined);
66
+ protected shouldUpdate(_changedProperties: PropertyValues): boolean;
67
+ /**
68
+ * This will only get called when assetId is set; if asset is set then it is expected that attribute changes are
69
+ * handled outside this component and the asset should be replaced when attributes change that require the marker
70
+ * to re-render
71
+ */
72
+ _onEvent(event: SharedEvent): void;
73
+ protected onAssetChanged(asset?: Asset): Promise<void>;
74
+ protected _updateLocation(location: GeoJSONPoint | null): void;
75
+ protected getColor(): string | undefined;
76
+ protected getActiveColor(): string | undefined;
77
+ }
78
+ export {};