@acorex/components 19.15.0-next.21 → 19.15.0-next.22

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.
@@ -1,5 +1,5 @@
1
1
  import { OnDestroy } from '@angular/core';
2
- import { AXMapControlPlace, AXMapData, AXMapMarker, AXMapPolygon } from './map.type';
2
+ import { AXMapControlPlace, AXMapData, AXMapMarker, AXMapPolygon, AXPoiMarker } from './map.type';
3
3
  import * as i0 from "@angular/core";
4
4
  /**
5
5
  * @description
@@ -75,6 +75,12 @@ export declare class AXMapComponent implements OnDestroy {
75
75
  * @default 'bottomright'
76
76
  */
77
77
  locatePlace: import("@angular/core").InputSignal<AXMapControlPlace>;
78
+ /**
79
+ * @description
80
+ * Minimum zoom level at which POI markers become visible.
81
+ * @default 10
82
+ */
83
+ poiMinZoom: import("@angular/core").InputSignal<number>;
78
84
  /**
79
85
  * @description
80
86
  * Array or single marker location(s) to be placed on the map.
@@ -87,6 +93,12 @@ export declare class AXMapComponent implements OnDestroy {
87
93
  * @default undefined
88
94
  */
89
95
  polygons: import("@angular/core").InputSignal<AXMapPolygon | AXMapPolygon[]>;
96
+ /**
97
+ * @description
98
+ * Array or single POI marker(s) to be placed on the map.
99
+ * @default undefined
100
+ */
101
+ pois: import("@angular/core").InputSignal<AXPoiMarker | AXPoiMarker[]>;
90
102
  /**
91
103
  * @description
92
104
  * Event triggered when a new marker is added to the map.
@@ -112,6 +124,16 @@ export declare class AXMapComponent implements OnDestroy {
112
124
  * Event triggered when a location is found via the location control.
113
125
  */
114
126
  onLocationFound: import("@angular/core").OutputEmitterRef<AXMapMarker>;
127
+ /**
128
+ * @description
129
+ * Event triggered when POI positions are changed on the map.
130
+ */
131
+ onPoiChanged: import("@angular/core").OutputEmitterRef<AXPoiMarker[]>;
132
+ /**
133
+ * @description
134
+ * Event triggered when a new POI is added to the map.
135
+ */
136
+ onPoiAdded: import("@angular/core").OutputEmitterRef<AXPoiMarker>;
115
137
  /**
116
138
  * @description
117
139
  * Event triggered map is loaded.
@@ -128,12 +150,14 @@ export declare class AXMapComponent implements OnDestroy {
128
150
  private onMarkerAddedSubscription?;
129
151
  private onPolygonChangedSubscription?;
130
152
  private onPolygonAddedSubscription?;
153
+ private onPoiChangedSubscription?;
154
+ private onPoiAddedSubscription?;
131
155
  /**
132
156
  * @description
133
157
  * Adds a marker to the specified location on the map.
134
158
  * @param location - The location where the marker should be placed.
135
159
  */
136
- addMarker(location: AXMapMarker | AXMapMarker[]): void;
160
+ addMarker(location: AXMapMarker | AXMapMarker[]): Promise<void>;
137
161
  /**
138
162
  * @description
139
163
  * Adds a polygon to the specified location on the map.
@@ -153,6 +177,12 @@ export declare class AXMapComponent implements OnDestroy {
153
177
  * @returns An array of `AXMapPolygon` representing all polygons.
154
178
  */
155
179
  getPolygons(): AXMapPolygon[];
180
+ /**
181
+ * @description
182
+ * Retrieves all POI markers currently placed on the map.
183
+ * @returns An array of `AXPoiMarker` representing all POI markers.
184
+ */
185
+ getPois(): AXPoiMarker[];
156
186
  /**
157
187
  * @description
158
188
  * Clear all markers and polygons
@@ -167,7 +197,7 @@ export declare class AXMapComponent implements OnDestroy {
167
197
  * @description
168
198
  * set markers and polygons
169
199
  */
170
- setDrawItem(data: AXMapData): void;
200
+ setDrawItem(data: AXMapData): Promise<void>;
171
201
  /**
172
202
  * Adjusts the map view to fit all markers and polygons currently on the map.
173
203
  */
@@ -205,10 +235,32 @@ export declare class AXMapComponent implements OnDestroy {
205
235
  * Unsubscribe from draw events
206
236
  */
207
237
  private unsubscribeFromDrawEvents;
238
+ /**
239
+ * @description
240
+ * Update popup for a specific marker
241
+ * @param marker - The marker to update
242
+ * @param popup - The new popup text
243
+ * @param open - Whether the popup should be opened after update
244
+ * @param closeButton - Whether the popup should have a close button
245
+ * @returns True if the update was successful, false otherwise
246
+ */
247
+ updateMarkerPopup(marker: AXMapMarker, popup: string, open?: boolean, closeButton?: boolean): boolean;
248
+ /**
249
+ * @description
250
+ * Update popup for multiple markers
251
+ * @param updates - Array of marker popup updates
252
+ * @returns Number of markers successfully updated
253
+ */
254
+ updateMarkersPopups(updates: {
255
+ marker: AXMapMarker;
256
+ popup: string;
257
+ open?: boolean;
258
+ closeButton?: boolean;
259
+ }[]): number;
208
260
  /**
209
261
  * Cleanup function that destroys the map and unsubscribes from all subscriptions.
210
262
  */
211
263
  ngOnDestroy(): void;
212
264
  static ɵfac: i0.ɵɵFactoryDeclaration<AXMapComponent, never>;
213
- static ɵcmp: i0.ɵɵComponentDeclaration<AXMapComponent, "ax-map", never, { "zoomLevel": { "alias": "zoomLevel"; "required": false; "isSignal": true; }; "latitude": { "alias": "latitude"; "required": false; "isSignal": true; }; "longitude": { "alias": "longitude"; "required": false; "isSignal": true; }; "maxMarker": { "alias": "maxMarker"; "required": false; "isSignal": true; }; "maxPolygon": { "alias": "maxPolygon"; "required": false; "isSignal": true; }; "hasDraw": { "alias": "hasDraw"; "required": false; "isSignal": true; }; "hasLocator": { "alias": "hasLocator"; "required": false; "isSignal": true; }; "fitToDraw": { "alias": "fitToDraw"; "required": false; "isSignal": true; }; "limitDraw": { "alias": "limitDraw"; "required": false; "isSignal": true; }; "markerPlace": { "alias": "markerPlace"; "required": false; "isSignal": true; }; "locatePlace": { "alias": "locatePlace"; "required": false; "isSignal": true; }; "markers": { "alias": "markers"; "required": false; "isSignal": true; }; "polygons": { "alias": "polygons"; "required": false; "isSignal": true; }; }, { "zoomLevel": "zoomLevelChange"; "latitude": "latitudeChange"; "longitude": "longitudeChange"; "onMarkerAdded": "onMarkerAdded"; "onMarkerChanged": "onMarkerChanged"; "onPolygonAdded": "onPolygonAdded"; "onPolygonChanged": "onPolygonChanged"; "onLocationFound": "onLocationFound"; "onMapReady": "onMapReady"; }, never, never, true, never>;
265
+ static ɵcmp: i0.ɵɵComponentDeclaration<AXMapComponent, "ax-map", never, { "zoomLevel": { "alias": "zoomLevel"; "required": false; "isSignal": true; }; "latitude": { "alias": "latitude"; "required": false; "isSignal": true; }; "longitude": { "alias": "longitude"; "required": false; "isSignal": true; }; "maxMarker": { "alias": "maxMarker"; "required": false; "isSignal": true; }; "maxPolygon": { "alias": "maxPolygon"; "required": false; "isSignal": true; }; "hasDraw": { "alias": "hasDraw"; "required": false; "isSignal": true; }; "hasLocator": { "alias": "hasLocator"; "required": false; "isSignal": true; }; "fitToDraw": { "alias": "fitToDraw"; "required": false; "isSignal": true; }; "limitDraw": { "alias": "limitDraw"; "required": false; "isSignal": true; }; "markerPlace": { "alias": "markerPlace"; "required": false; "isSignal": true; }; "locatePlace": { "alias": "locatePlace"; "required": false; "isSignal": true; }; "poiMinZoom": { "alias": "poiMinZoom"; "required": false; "isSignal": true; }; "markers": { "alias": "markers"; "required": false; "isSignal": true; }; "polygons": { "alias": "polygons"; "required": false; "isSignal": true; }; "pois": { "alias": "pois"; "required": false; "isSignal": true; }; }, { "zoomLevel": "zoomLevelChange"; "latitude": "latitudeChange"; "longitude": "longitudeChange"; "onMarkerAdded": "onMarkerAdded"; "onMarkerChanged": "onMarkerChanged"; "onPolygonAdded": "onPolygonAdded"; "onPolygonChanged": "onPolygonChanged"; "onLocationFound": "onLocationFound"; "onPoiChanged": "onPoiChanged"; "onPoiAdded": "onPoiAdded"; "onMapReady": "onMapReady"; }, never, never, true, never>;
214
266
  }
@@ -1,21 +1,25 @@
1
1
  import { EventEmitter } from '@angular/core';
2
- import { AXMapControlPlace, AXMapData, AXMapLatLng, AXMapLocation, AXMapMarker, AXMapPolygon } from './map.type';
2
+ import { AXMapControlPlace, AXMapData, AXMapLatLng, AXMapLocation, AXMapMarker, AXMapPolygon, AXPoiMarker } from './map.type';
3
3
  import * as i0 from "@angular/core";
4
4
  /**
5
5
  * Service for managing Leaflet maps and related functionalities.
6
6
  */
7
7
  export declare class AXLeafletService {
8
8
  private mapConfig;
9
- private icon;
9
+ private iconResolver;
10
+ private defaultIcon;
10
11
  private position;
11
12
  private maxMarkers;
12
13
  private maxPolygons;
13
14
  private polygonColor;
15
+ private poiMinZoom;
16
+ private poiMarkers;
14
17
  protected L: typeof import('leaflet');
15
18
  private map?;
16
19
  private drawControl?;
17
20
  private locateControl?;
18
21
  private drawnItems;
22
+ private poiLayer?;
19
23
  private boundary;
20
24
  private boundaryLayer;
21
25
  /**
@@ -34,6 +38,14 @@ export declare class AXLeafletService {
34
38
  * Emits when marker data changes.
35
39
  */
36
40
  onMarkerChanged: EventEmitter<AXMapMarker[]>;
41
+ /**
42
+ * Emits when a poi is added.
43
+ */
44
+ onPoiAdded: EventEmitter<AXPoiMarker>;
45
+ /**
46
+ * Emits when a poi is changed.
47
+ */
48
+ onPoiChanged: EventEmitter<AXPoiMarker[]>;
37
49
  /**
38
50
  * Emits when a marker is added.
39
51
  */
@@ -63,6 +75,18 @@ export declare class AXLeafletService {
63
75
  initMap(mapElement: HTMLElement, location: AXMapLatLng, zoom?: number): Promise<void>;
64
76
  private handleZoomChange;
65
77
  private handleCenterChange;
78
+ /**
79
+ * Creates a custom icon from SVG string or URL using the icon resolver if possible
80
+ * @param iconSrc Path to the icon, SVG string, or icon key
81
+ * @returns Leaflet icon
82
+ */
83
+ setCustomIcon(iconSrc: string): Promise<any>;
84
+ /**
85
+ * Creates a Leaflet icon from SVG or URL
86
+ * @param iconSrc The icon source (SVG string or URL)
87
+ * @returns Leaflet icon
88
+ */
89
+ private createLeafletIcon;
66
90
  /**
67
91
  * Gets the Leaflet map instance.
68
92
  * @returns The Leaflet map instance, or undefined if not initialized.
@@ -91,17 +115,6 @@ export declare class AXLeafletService {
91
115
  * @param duration The duration of the fly animation in seconds.
92
116
  */
93
117
  flyTo(location: AXMapLatLng, zoom?: number, setMarker?: boolean, duration?: number): void;
94
- /**
95
- * Adds a marker or markers to the map.
96
- * @param locations The marker or markers to add.
97
- */
98
- addMarker(locations: AXMapMarker | AXMapMarker[]): void;
99
- /**
100
- * Adds a polygon or polygons to the map, respecting the boundary if set.
101
- * @param polygons The polygon or polygons to add.
102
- * @param clickCallback Optional callback function to be executed on polygon click.
103
- */
104
- addPolygon(polygons: AXMapPolygon | AXMapPolygon[], clickCallback?: (event: L.LeafletMouseEvent) => void): void;
105
118
  /**
106
119
  * Gets all markers currently on the map.
107
120
  * @returns An array of AXMapMarker objects.
@@ -112,6 +125,11 @@ export declare class AXLeafletService {
112
125
  * @returns An array of AXMapPolygon objects.
113
126
  */
114
127
  getPolygons(): AXMapPolygon[];
128
+ /**
129
+ * Gets POI markers from the POI layer.
130
+ * @returns Array of POI markers.
131
+ */
132
+ getPois(): AXPoiMarker[];
115
133
  /**
116
134
  * Adds a draw control to the map for creating markers and polygons.
117
135
  * @param position The position of the control on the map. Defaults to 'topleft'.
@@ -136,7 +154,7 @@ export declare class AXLeafletService {
136
154
  */
137
155
  removeLocateControl(): void;
138
156
  /**
139
- * Clears all drawn items (markers and polygons) from the map.
157
+ * Clears all drawn items, including markers, polygons, and POIs.
140
158
  */
141
159
  clearDrawItems(): void;
142
160
  /**
@@ -148,7 +166,7 @@ export declare class AXLeafletService {
148
166
  * Sets the drawn items (markers and polygons) on the map.
149
167
  * @param data An object containing arrays of markers and polygons.
150
168
  */
151
- setDrawItem(data: AXMapData): void;
169
+ setDrawItem(data: AXMapData): Promise<void>;
152
170
  /**
153
171
  * Adjusts the map view to fit all markers, polygons, and boundaries currently on the map.
154
172
  */
@@ -167,6 +185,63 @@ export declare class AXLeafletService {
167
185
  * Destroys the map instance and removes all event listeners.
168
186
  */
169
187
  destroyMap(): void;
188
+ /**
189
+ * Updates a marker's popup text and options
190
+ * @param marker The marker to update
191
+ * @param popup The new popup text
192
+ * @param open Whether the popup should be opened after update
193
+ * @param closeButton Whether the popup should have a close button
194
+ * @returns True if the update was successful, false otherwise
195
+ */
196
+ updateMarkerPopup(marker: AXMapMarker, popup: string, open?: boolean, closeButton?: boolean): boolean;
197
+ /**
198
+ * Finds a marker layer by its latitude and longitude
199
+ * @param marker The marker to find
200
+ * @returns The Leaflet marker layer or undefined if not found
201
+ */
202
+ private findMarkerLayer;
203
+ /**
204
+ * Updates popups for multiple markers in a single operation
205
+ * @param updates Array of marker popup updates
206
+ * @returns Number of markers successfully updated
207
+ */
208
+ updateMarkerPopups(updates: {
209
+ marker: AXMapMarker;
210
+ popup: string;
211
+ open?: boolean;
212
+ closeButton?: boolean;
213
+ }[]): number;
214
+ /**
215
+ * Adds a marker or markers to the map.
216
+ * @param locations The marker or markers to add.
217
+ */
218
+ addMarker(locations: AXMapMarker | AXMapMarker[]): Promise<void>;
219
+ /**
220
+ * Adds a polygon or polygons to the map, respecting the boundary if set.
221
+ * @param polygons The polygon or polygons to add.
222
+ * @param clickCallback Optional callback function to be executed on polygon click.
223
+ */
224
+ addPolygon(polygons: AXMapPolygon | AXMapPolygon[], clickCallback?: (event: L.LeafletMouseEvent) => void): void;
225
+ /**
226
+ * Adds a POI marker to the map.
227
+ * @param locations One or more POI markers to add.
228
+ */
229
+ addPoi(locations: AXPoiMarker | AXPoiMarker[]): Promise<void>;
230
+ /**
231
+ * Updates the visibility of POI markers based on the current zoom level
232
+ * @param currentZoom The current zoom level of the map
233
+ */
234
+ private updatePoiVisibility;
235
+ /**
236
+ * Sets the minimum zoom level at which POI markers become visible
237
+ * @param minZoom The minimum zoom level (default is 10)
238
+ */
239
+ setPoiMinZoom(minZoom: number): void;
240
+ /**
241
+ * Gets the current minimum zoom level for POI visibility
242
+ * @returns The minimum zoom level
243
+ */
244
+ getPoiMinZoom(): number;
170
245
  static ɵfac: i0.ɵɵFactoryDeclaration<AXLeafletService, never>;
171
246
  static ɵprov: i0.ɵɵInjectableDeclaration<AXLeafletService>;
172
247
  }
@@ -2,8 +2,40 @@ export interface AXMapLatLng {
2
2
  latitude: number;
3
3
  longitude: number;
4
4
  }
5
+ /**
6
+ * Represents a marker on the map with position and optional display properties.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * const marker: AXMapMarker = {
11
+ * latitude: 51.505,
12
+ * longitude: -0.09,
13
+ * title: "London",
14
+ * popup: "Capital of UK",
15
+ * popupOpen: false,
16
+ * popupCloseButton: true,
17
+ * iconKey: "map-marker" // Icon key to be resolved by icon resolver service
18
+ * // OR
19
+ * icon: "<svg>...</svg>" // Direct SVG content or image URL
20
+ * };
21
+ * ```
22
+ */
5
23
  export interface AXMapMarker extends AXMapLatLng {
6
24
  title?: string;
25
+ iconKey?: string;
26
+ popup?: string;
27
+ popupOpen?: boolean;
28
+ popupCloseButton?: boolean;
29
+ }
30
+ /**
31
+ * Represents a Point of Interest marker on the map with the same properties as AXMapMarker.
32
+ */
33
+ export interface AXPoiMarker extends AXMapLatLng {
34
+ title?: string;
35
+ iconKey?: string;
36
+ popup?: string;
37
+ popupOpen?: boolean;
38
+ popupCloseButton?: boolean;
7
39
  }
8
40
  export interface AXMapLocation extends AXMapMarker {
9
41
  precision?: number;
@@ -16,5 +48,6 @@ export interface AXMapPolygon {
16
48
  export interface AXMapData {
17
49
  markers: AXMapMarker[];
18
50
  polygons: AXMapPolygon[];
51
+ pois: AXPoiMarker[];
19
52
  }
20
53
  export type AXMapControlPlace = 'topleft' | 'topright' | 'bottomleft' | 'bottomright';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acorex/components",
3
- "version": "19.15.0-next.21",
3
+ "version": "19.15.0-next.22",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=19.0.0",
6
6
  "@angular/core": ">=19.0.0",
@@ -29,6 +29,14 @@
29
29
  "types": "./action-sheet/index.d.ts",
30
30
  "default": "./fesm2022/acorex-components-action-sheet.mjs"
31
31
  },
32
+ "./alert": {
33
+ "types": "./alert/index.d.ts",
34
+ "default": "./fesm2022/acorex-components-alert.mjs"
35
+ },
36
+ "./audio-wave": {
37
+ "types": "./audio-wave/index.d.ts",
38
+ "default": "./fesm2022/acorex-components-audio-wave.mjs"
39
+ },
32
40
  "./autocomplete": {
33
41
  "types": "./autocomplete/index.d.ts",
34
42
  "default": "./fesm2022/acorex-components-autocomplete.mjs"
@@ -41,18 +49,10 @@
41
49
  "types": "./badge/index.d.ts",
42
50
  "default": "./fesm2022/acorex-components-badge.mjs"
43
51
  },
44
- "./alert": {
45
- "types": "./alert/index.d.ts",
46
- "default": "./fesm2022/acorex-components-alert.mjs"
47
- },
48
52
  "./bottom-navigation": {
49
53
  "types": "./bottom-navigation/index.d.ts",
50
54
  "default": "./fesm2022/acorex-components-bottom-navigation.mjs"
51
55
  },
52
- "./audio-wave": {
53
- "types": "./audio-wave/index.d.ts",
54
- "default": "./fesm2022/acorex-components-audio-wave.mjs"
55
- },
56
56
  "./breadcrumbs": {
57
57
  "types": "./breadcrumbs/index.d.ts",
58
58
  "default": "./fesm2022/acorex-components-breadcrumbs.mjs"
@@ -137,14 +137,14 @@
137
137
  "types": "./drawer/index.d.ts",
138
138
  "default": "./fesm2022/acorex-components-drawer.mjs"
139
139
  },
140
- "./dropdown": {
141
- "types": "./dropdown/index.d.ts",
142
- "default": "./fesm2022/acorex-components-dropdown.mjs"
143
- },
144
140
  "./drawer-2": {
145
141
  "types": "./drawer-2/index.d.ts",
146
142
  "default": "./fesm2022/acorex-components-drawer-2.mjs"
147
143
  },
144
+ "./dropdown": {
145
+ "types": "./dropdown/index.d.ts",
146
+ "default": "./fesm2022/acorex-components-dropdown.mjs"
147
+ },
148
148
  "./dropdown-button": {
149
149
  "types": "./dropdown-button/index.d.ts",
150
150
  "default": "./fesm2022/acorex-components-dropdown-button.mjs"
@@ -157,14 +157,14 @@
157
157
  "types": "./flow-chart/index.d.ts",
158
158
  "default": "./fesm2022/acorex-components-flow-chart.mjs"
159
159
  },
160
- "./grid-layout-builder": {
161
- "types": "./grid-layout-builder/index.d.ts",
162
- "default": "./fesm2022/acorex-components-grid-layout-builder.mjs"
163
- },
164
160
  "./form": {
165
161
  "types": "./form/index.d.ts",
166
162
  "default": "./fesm2022/acorex-components-form.mjs"
167
163
  },
164
+ "./grid-layout-builder": {
165
+ "types": "./grid-layout-builder/index.d.ts",
166
+ "default": "./fesm2022/acorex-components-grid-layout-builder.mjs"
167
+ },
168
168
  "./image": {
169
169
  "types": "./image/index.d.ts",
170
170
  "default": "./fesm2022/acorex-components-image.mjs"