@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
package/package.json CHANGED
@@ -1,29 +1,40 @@
1
1
  {
2
2
  "name": "@openremote/or-map",
3
- "version": "1.0.2-alpha",
3
+ "version": "1.2.0-snapshot.20240512160221",
4
4
  "description": "Displays s vector or raster map",
5
- "main": "dist/index.js",
6
- "types": "src/index.ts",
5
+ "main": "dist/umd/index.bundle.js",
6
+ "module": "lib/index.js",
7
+ "exports": {
8
+ ".": "./lib/index.js",
9
+ "./*": "./lib/*.js"
10
+ },
11
+ "types": "lib/index.d.ts",
7
12
  "scripts": {
8
13
  "build": "npx tsc -b",
9
- "test": "echo \"No tests\" && exit 0"
14
+ "test": "echo \"No tests\" && exit 0",
15
+ "prepublishOnly": "npx webpack"
10
16
  },
11
17
  "author": "OpenRemote",
12
18
  "license": "AGPL-3.0-or-later",
13
19
  "dependencies": {
14
- "@polymer/polymer": "^3.2.0",
15
- "@openremote/core": "^1.0.0",
16
- "@types/mapbox-gl": "^0.51.1",
17
- "lit-element": "^2.1.0",
18
- "mapbox-gl": "^0.52.0-beta.1",
19
- "mapbox.js": "^3.2.0"
20
+ "@maplibre/maplibre-gl-geocoder": "^1.5.0",
21
+ "@openremote/core": "1.2.0-snapshot.20240512160221",
22
+ "@openremote/model": "1.2.0-snapshot.20240512160221",
23
+ "@openremote/or-icon": "1.2.0-snapshot.20240512160221",
24
+ "@openremote/or-mwc-components": "1.2.0-snapshot.20240512160221",
25
+ "@openremote/or-translate": "1.2.0-snapshot.20240512160221",
26
+ "@openremote/rest": "1.2.0-snapshot.20240512160221",
27
+ "@polymer/polymer": "^3.3.1",
28
+ "@types/mapbox": "^1.6.42",
29
+ "lit": "^2.0.2",
30
+ "mapbox.js": "^3.3.1",
31
+ "maplibre-gl": "^4.1.2"
20
32
  },
21
33
  "devDependencies": {
22
- "@webcomponents/webcomponentsjs": "^2.0.0",
23
- "css-loader": "^2.0.0",
24
- "style-loader": "^0.23.1",
25
- "tslint": "^5.11.0",
26
- "typescript": "^3.2.2",
27
- "wct-browser-legacy": "^1.0.0"
34
+ "@openremote/util": "1.2.0-snapshot.20240512160221",
35
+ "@types/geojson": "^7946.0.7"
36
+ },
37
+ "publishConfig": {
38
+ "access": "public"
28
39
  }
29
- }
40
+ }
@@ -1,139 +0,0 @@
1
- /* tslint:disable:class-name */
2
- declare module "mapbox.js" {
3
-
4
- export type Point2d = [number, number];
5
- export type Point3d = [number, number, number];
6
-
7
- export type LatLngLike = Point2d | Point3d | LatLng;
8
- export type LatLngBoundsLike = [LatLngLike, LatLngLike] | LatLngBounds;
9
-
10
- export default L;
11
-
12
- export class LatLng {
13
- public alt?: number;
14
- public lat: number;
15
- public lng: number;
16
- private constructor(lat: number, lng: number, alt?: number);
17
- }
18
-
19
- export class LatLngBounds {
20
- private constructor();
21
- public getSouthEast(): LatLng;
22
- public getNorthWest(): LatLng;
23
- public getNorthEast(): LatLng;
24
- public getSouthWest(): LatLng;
25
- public getCenter(): LatLng;
26
- }
27
-
28
- export class Map {
29
- private constructor();
30
- public getBoundsZoom(bounds: LatLngBoundsLike, inside?: boolean): number;
31
- public setMaxZoom(zoom: number): this;
32
- public setMinZoom(zoom: number): this;
33
- public getContainer(): HTMLElement;
34
- public setView(center: LatLngLike, zoom?: number, options?: ZoomPanOptions): this;
35
- public setZoom(zoom: number, options?: ZoomOptions): this;
36
- }
37
-
38
- export interface MapOptions {
39
- zoom?: number;
40
- boxZoom?: boolean;
41
- center?: LatLngLike;
42
- maxBounds?: LatLngBoundsLike;
43
- maxZoom?: number;
44
- minZoom?: number;
45
- }
46
-
47
- export interface IconOptions {
48
- iconUrl?: string;
49
- iconRetinaUrl?: string;
50
- iconSize?: Point;
51
- iconAnchor?: Point;
52
- popupAnchor?: Point;
53
- tooltipAnchor?: Point;
54
- shadowUrl?: string;
55
- shadowRetinaUrl?: string;
56
- shadowSize?: Point;
57
- shadowAnchor?: Point;
58
- className?: string;
59
- }
60
-
61
- export interface DivIconOptions extends IconOptions {
62
- html?: string;
63
- bgPos?: Point;
64
- }
65
-
66
- export interface MarkerOptions {
67
- icon?: Icon;
68
- keyboard?: boolean;
69
- title?: string;
70
- alt?: string;
71
- zIndexOffset?: number;
72
- opacity?: number;
73
- clickable?: boolean;
74
- }
75
-
76
- export interface ZoomOptions {
77
- animate?: boolean;
78
- }
79
-
80
- export interface PanOptions extends ZoomOptions {
81
- duration?: number;
82
- easeLinearity?: number;
83
- noMoveStart?: boolean;
84
- }
85
-
86
- export interface ZoomPanOptions extends ZoomOptions {
87
- reset?: boolean;
88
- pan?: PanOptions;
89
- zoom?: ZoomOptions;
90
- }
91
-
92
- export interface Icon {
93
-
94
- }
95
-
96
- export interface DivIcon extends Icon {
97
-
98
- }
99
-
100
- export interface Point {
101
- x: number;
102
- y: number;
103
- }
104
-
105
- export class Marker extends Layer {
106
- public setLatLng(latLng: LatLngLike): this;
107
- public on(event: any, func: any): this;
108
- public off(event: any, func?: any): this;
109
- public getElement(): HTMLElement;
110
- }
111
-
112
- class Layer {
113
- public addTo(addTo: Map): this;
114
- public removeFrom(removeFrom: Map): this;
115
- }
116
-
117
- namespace L {
118
-
119
- namespace mapbox {
120
- function map(element: string | Element, tilejson: object, options?: MapOptions): Map;
121
- }
122
-
123
- function icon(options: IconOptions): Icon;
124
-
125
- function divIcon(options: DivIconOptions): DivIcon;
126
-
127
- function point(x: number, y: number): Point;
128
-
129
- function latLng(lat: number, lng: number, alt?: number): LatLng;
130
-
131
- function latLng(pos: LatLngLike): LatLng;
132
-
133
- function latLngBounds(corner1: LatLngLike, corner2: LatLngLike): LatLngBounds;
134
-
135
- function latLngBounds(bounds: LatLngBoundsLike): LatLngBounds;
136
-
137
- function marker(pos: LatLngLike, options: MarkerOptions): Marker;
138
- }
139
- }
package/dist/index.d.ts DELETED
@@ -1,41 +0,0 @@
1
- import { EventCallback } from "@openremote/core";
2
- import { FlattenedNodesObserver } from "@polymer/polymer/lib/utils/flattened-nodes-observer.js";
3
- import { LitElement, PropertyValues, CSSResult } from "lit-element";
4
- import { LngLatBoundsLike, LngLatLike } from "mapbox-gl";
5
- import { MapWidget } from "./mapwidget";
6
- import { OrMapMarker, OrMapMarkerChangedEvent } from "./markers/or-map-marker";
7
- export declare enum Type {
8
- VECTOR = "VECTOR",
9
- RASTER = "RASTER"
10
- }
11
- export interface ViewSettings {
12
- "center": LngLatLike;
13
- "bounds": LngLatBoundsLike;
14
- "zoom": number;
15
- "maxZoom": number;
16
- "minZoom": number;
17
- "boxZoom": boolean;
18
- }
19
- export declare class OrMap extends LitElement {
20
- static styles: CSSResult[];
21
- type: Type;
22
- protected _markerStyles: string[];
23
- center?: LngLatLike;
24
- zoom?: number;
25
- protected _initCallback?: EventCallback;
26
- protected _map?: MapWidget;
27
- protected _loaded: boolean;
28
- protected _observer?: FlattenedNodesObserver;
29
- protected _markers: OrMapMarker[];
30
- protected _mapContainer?: HTMLElement;
31
- protected _slotElement?: HTMLSlotElement;
32
- constructor();
33
- readonly markers: OrMapMarker[];
34
- disconnectedCallback(): void;
35
- protected firstUpdated(_changedProperties: PropertyValues): void;
36
- loadMap(): void;
37
- protected _onMarkerChangedEvent(evt: OrMapMarkerChangedEvent): void;
38
- protected _processNewMarkers(nodes: Element[]): void;
39
- protected _processRemovedMarkers(nodes: Element[]): void;
40
- protected render(): import("lit-element").TemplateResult;
41
- }
package/dist/index.js DELETED
@@ -1,196 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import openremote, { OREvent } from "@openremote/core";
8
- import { FlattenedNodesObserver } from "@polymer/polymer/lib/utils/flattened-nodes-observer.js";
9
- import { css, customElement, html, LitElement, property, query } from "lit-element";
10
- import { LngLat } from "mapbox-gl";
11
- import { MapWidget } from "./mapwidget";
12
- import { OrMapMarker, OrMapMarkerEvent, MarkerStyle } from "./markers/or-map-marker";
13
- import { getLngLat } from "./util";
14
- export var Type;
15
- (function (Type) {
16
- Type["VECTOR"] = "VECTOR";
17
- Type["RASTER"] = "RASTER";
18
- })(Type || (Type = {}));
19
- let OrMap = class OrMap extends LitElement {
20
- constructor() {
21
- super();
22
- this.type = Type.VECTOR;
23
- this._markerStyles = [];
24
- this._loaded = false;
25
- this._markers = [];
26
- this.addEventListener(OrMapMarkerEvent.CHANGED, this._onMarkerChangedEvent);
27
- }
28
- get markers() {
29
- return this._markers;
30
- }
31
- disconnectedCallback() {
32
- super.disconnectedCallback();
33
- this._observer.disconnect();
34
- }
35
- firstUpdated(_changedProperties) {
36
- if (!openremote.ready) {
37
- // Defer until openremote is initialised
38
- this._initCallback = (initEvent) => {
39
- if (initEvent === OREvent.READY) {
40
- this.loadMap();
41
- openremote.removeListener(this._initCallback);
42
- }
43
- };
44
- openremote.addListener(this._initCallback);
45
- }
46
- else {
47
- this.loadMap();
48
- }
49
- }
50
- loadMap() {
51
- if (this._loaded) {
52
- return;
53
- }
54
- if (this._mapContainer && this._slotElement) {
55
- this._map = new MapWidget(this.type, this.shadowRoot, this._mapContainer)
56
- .setCenter(this.center)
57
- .setZoom(this.zoom);
58
- this._map.load().then(() => {
59
- // Get markers from slot
60
- this._observer = new FlattenedNodesObserver(this._slotElement, (info) => {
61
- this._processNewMarkers(info.addedNodes);
62
- this._processRemovedMarkers(info.removedNodes);
63
- });
64
- });
65
- }
66
- this._loaded = true;
67
- }
68
- _onMarkerChangedEvent(evt) {
69
- if (this._map) {
70
- this._map.onMarkerChanged(evt.detail.marker, evt.detail.property);
71
- }
72
- }
73
- _processNewMarkers(nodes) {
74
- nodes.forEach((node) => {
75
- if (!this._map) {
76
- return;
77
- }
78
- if (node instanceof OrMapMarker) {
79
- this._markers.push(node);
80
- // Add styles of marker class to the shadow root if not already added
81
- const className = node.constructor.name;
82
- if (this._markerStyles.indexOf(className) < 0) {
83
- const styles = node.constructor.styles;
84
- let stylesArr = [];
85
- if (styles) {
86
- if (!Array.isArray(styles)) {
87
- stylesArr.push(styles);
88
- }
89
- else {
90
- stylesArr = styles;
91
- }
92
- stylesArr.forEach((styleItem) => {
93
- const styleElem = document.createElement("style");
94
- styleElem.textContent = styleItem.toString();
95
- if (this._mapContainer.children.length > 0) {
96
- this._mapContainer.insertBefore(styleElem, this._mapContainer.children[0]);
97
- }
98
- else {
99
- this._mapContainer.appendChild(styleElem);
100
- }
101
- });
102
- }
103
- this._markerStyles.push(className);
104
- }
105
- this._map.addMarker(node);
106
- }
107
- });
108
- }
109
- _processRemovedMarkers(nodes) {
110
- nodes.forEach((node) => {
111
- if (!this._map) {
112
- return;
113
- }
114
- if (node instanceof OrMapMarker) {
115
- const i = this._markers.indexOf(node);
116
- if (i >= 0) {
117
- this._markers.splice(i, 1);
118
- }
119
- this._map.removeMarker(node);
120
- }
121
- });
122
- }
123
- render() {
124
- return html `
125
- <div id="map"></div>
126
- <slot></slot>
127
- `;
128
- }
129
- };
130
- OrMap.styles = [
131
- MarkerStyle,
132
- css `
133
- :host {
134
- display: block;
135
- overflow: hidden;
136
- }
137
-
138
- #map {
139
- position: relative;
140
- width: 100%;
141
- height: 100%;
142
- }
143
-
144
- slot {
145
- display: none;
146
- }
147
-
148
- :host([hidden]) {
149
- display: none;
150
- }
151
-
152
- .leaflet-marker-icon, .mapboxgl-marker {
153
- pointer-events: none !important;
154
- }
155
- `
156
- ];
157
- __decorate([
158
- property({ type: String })
159
- ], OrMap.prototype, "type", void 0);
160
- __decorate([
161
- property({ type: String, converter: {
162
- fromAttribute(value, type) {
163
- if (!value) {
164
- return;
165
- }
166
- const coords = value.split(",");
167
- if (coords.length !== 2) {
168
- return;
169
- }
170
- const lng = Number(coords[0]);
171
- const lat = Number(coords[1]);
172
- return new LngLat(lng, lat);
173
- },
174
- toAttribute(value, type) {
175
- const lngLat = getLngLat(value);
176
- if (!lngLat) {
177
- return "";
178
- }
179
- return "" + lngLat.lng + "," + lngLat.lat;
180
- }
181
- } })
182
- ], OrMap.prototype, "center", void 0);
183
- __decorate([
184
- property({ type: Number })
185
- ], OrMap.prototype, "zoom", void 0);
186
- __decorate([
187
- query("#map")
188
- ], OrMap.prototype, "_mapContainer", void 0);
189
- __decorate([
190
- query("slot")
191
- ], OrMap.prototype, "_slotElement", void 0);
192
- OrMap = __decorate([
193
- customElement("or-map")
194
- ], OrMap);
195
- export { OrMap };
196
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,UAAU,EAAE,EAAgB,OAAO,EAAC,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAC,sBAAsB,EAAC,MAAM,wDAAwD,CAAC;AAC9F,OAAO,EAAC,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAA4B,MAAM,aAAa,CAAC;AAC7G,OAAO,EAAC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AC,MAAM,EAAE;oBACT,OAAO,EAAE,CAAC;iBACb;gBAED,OAAO,EAAE,GAAG,MAAM,CAAC,GAAG,GAAG,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;YAC9C,CAAC;SACJ,EAAC,CAAC;qCACoB;AAG3B;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;mCACJ;AASrB;IADC,KAAK,CAAC,MAAM,CAAC;4CACwB;AAGtC;IADC,KAAK,CAAC,MAAM,CAAC;2CAC2B;AA1EhC,KAAK;IADjB,aAAa,CAAC,QAAQ,CAAC;GACX,KAAK,CAwMjB;SAxMY,KAAK"}
@@ -1,31 +0,0 @@
1
- import { LngLatLike, Map as MapGL, Marker as MarkerGL, LngLat } from "mapbox-gl";
2
- import { Map as MapJS, Marker as MarkerJS } from "mapbox.js";
3
- import { Type, ViewSettings } from "./index";
4
- import { OrMapMarker } from "./markers/or-map-marker";
5
- export declare class MapWidget {
6
- protected static _mapboxGlStyle?: any;
7
- protected static _mapboxJsStyle?: any;
8
- protected _mapJs?: MapJS;
9
- protected _mapGl?: MapGL;
10
- protected _type: Type;
11
- protected _styleParent: Node;
12
- protected _mapContainer: HTMLElement;
13
- protected _loaded: boolean;
14
- protected _markersJs: Map<OrMapMarker, MarkerJS>;
15
- protected _markersGl: Map<OrMapMarker, MarkerGL>;
16
- protected _viewSettings?: ViewSettings;
17
- protected _center?: LngLat;
18
- protected _zoom?: number;
19
- protected _clickHandlers: Map<OrMapMarker, (ev: MouseEvent) => void>;
20
- constructor(type: Type, styleParent: Node, mapContainer: HTMLElement);
21
- setCenter(center?: LngLatLike): this;
22
- setZoom(zoom?: number): this;
23
- load(): Promise<void>;
24
- addMarker(marker: OrMapMarker): void;
25
- removeMarker(marker: OrMapMarker): void;
26
- onMarkerChanged(marker: OrMapMarker, prop: string): void;
27
- protected _updateMarkerPosition(marker: OrMapMarker): void;
28
- protected _updateMarkerElement(marker: OrMapMarker, doAdd: boolean): void;
29
- protected _addMarkerClickHandler(marker: OrMapMarker, elem: HTMLElement): void;
30
- protected _removeMarkerClickHandler(marker: OrMapMarker, elem: HTMLElement): void;
31
- }