@angular-helpers/openlayers 0.4.0 → 0.5.0
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/README.md +14 -6
- package/fesm2022/angular-helpers-openlayers-controls.mjs +289 -36
- package/fesm2022/angular-helpers-openlayers-core.mjs +197 -16
- package/fesm2022/angular-helpers-openlayers-interactions.mjs +414 -23
- package/fesm2022/angular-helpers-openlayers-layers.mjs +634 -83
- package/fesm2022/angular-helpers-openlayers-military.mjs +244 -144
- package/fesm2022/angular-helpers-openlayers-overlays.mjs +9 -9
- package/package.json +2 -2
- package/types/angular-helpers-openlayers-controls.d.ts +24 -4
- package/types/angular-helpers-openlayers-core.d.ts +126 -4
- package/types/angular-helpers-openlayers-interactions.d.ts +120 -23
- package/types/angular-helpers-openlayers-layers.d.ts +152 -7
- package/types/angular-helpers-openlayers-military.d.ts +84 -94
|
@@ -157,7 +157,11 @@ declare class OlMapService {
|
|
|
157
157
|
private zoneHelper;
|
|
158
158
|
private map;
|
|
159
159
|
private readyCallbacks;
|
|
160
|
-
|
|
160
|
+
private _resolution;
|
|
161
|
+
/** Signal that emits the current map resolution in meters per pixel */
|
|
162
|
+
readonly resolution: _angular_core.Signal<number>;
|
|
163
|
+
setMap(map: OLMap | null): void;
|
|
164
|
+
setResolution(resolution: number): void;
|
|
161
165
|
getMap(): OLMap | null;
|
|
162
166
|
onReady(callback: (map: OLMap) => void): void;
|
|
163
167
|
getView(): View | null;
|
|
@@ -215,12 +219,130 @@ declare class OlZoneHelper {
|
|
|
215
219
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<OlZoneHelper>;
|
|
216
220
|
}
|
|
217
221
|
|
|
218
|
-
|
|
222
|
+
/**
|
|
223
|
+
* Configuration for an ellipse polygon centered at `center`.
|
|
224
|
+
* Coordinates are emitted in EPSG:4326 (lon/lat) using a local tangent-plane
|
|
225
|
+
* approximation; accuracy degrades for radii > ~100 km or near the poles.
|
|
226
|
+
*/
|
|
227
|
+
interface EllipseConfig {
|
|
228
|
+
/** Ellipse center as `[lon, lat]` in EPSG:4326. */
|
|
229
|
+
center: Coordinate;
|
|
230
|
+
/** Semi-major axis in meters. Must be > 0. */
|
|
231
|
+
semiMajor: number;
|
|
232
|
+
/** Semi-minor axis in meters. Must be > 0. */
|
|
233
|
+
semiMinor: number;
|
|
234
|
+
/**
|
|
235
|
+
* Rotation in radians, counter-clockwise from East. Default: 0
|
|
236
|
+
* (semi-major axis points East).
|
|
237
|
+
*/
|
|
238
|
+
rotation?: number;
|
|
239
|
+
/**
|
|
240
|
+
* Number of vertices used to approximate the ellipse. Default: 64.
|
|
241
|
+
* Minimum: 8.
|
|
242
|
+
*/
|
|
243
|
+
segments?: number;
|
|
244
|
+
/** Custom feature properties to attach to the output feature. */
|
|
245
|
+
properties?: Record<string, unknown>;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Configuration for a circular sector (pie-slice) polygon.
|
|
249
|
+
* Same projection caveats as `EllipseConfig`.
|
|
250
|
+
*/
|
|
251
|
+
interface SectorConfig {
|
|
252
|
+
/** Sector apex / center as `[lon, lat]` in EPSG:4326. */
|
|
253
|
+
center: Coordinate;
|
|
254
|
+
/** Sector radius in meters. Must be > 0. */
|
|
255
|
+
radius: number;
|
|
256
|
+
/** Start angle in radians (0 = East, CCW positive). */
|
|
257
|
+
startAngle: number;
|
|
258
|
+
/**
|
|
259
|
+
* End angle in radians. Must satisfy `startAngle < endAngle <= startAngle + 2π`.
|
|
260
|
+
*/
|
|
261
|
+
endAngle: number;
|
|
262
|
+
/**
|
|
263
|
+
* Number of vertices along the arc. Default: 32. Minimum: 4. The output
|
|
264
|
+
* polygon has `segments + 3` vertices (apex + arc + apex closer).
|
|
265
|
+
*/
|
|
266
|
+
segments?: number;
|
|
267
|
+
/** Custom feature properties to attach to the output feature. */
|
|
268
|
+
properties?: Record<string, unknown>;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Configuration for a donut (annular ring) polygon — a disk with a
|
|
272
|
+
* concentric circular hole.
|
|
273
|
+
*
|
|
274
|
+
* The output `Feature<Polygon>` has TWO rings: an outer ring (CCW) and
|
|
275
|
+
* an inner ring (CW per the GeoJSON right-hand rule), so renderers that
|
|
276
|
+
* follow the spec fill only the band between the radii.
|
|
277
|
+
*/
|
|
278
|
+
interface DonutConfig {
|
|
279
|
+
/** Donut center as `[lon, lat]` in EPSG:4326. */
|
|
280
|
+
center: Coordinate;
|
|
281
|
+
/** Outer radius in meters. Must be > `innerRadius`. */
|
|
282
|
+
outerRadius: number;
|
|
283
|
+
/** Inner radius in meters. Must be > 0 and < `outerRadius`. */
|
|
284
|
+
innerRadius: number;
|
|
285
|
+
/**
|
|
286
|
+
* Number of vertices per ring. Default: 64. Minimum: 8. Both rings use
|
|
287
|
+
* the same segment count.
|
|
288
|
+
*/
|
|
289
|
+
segments?: number;
|
|
290
|
+
/** Custom feature properties to attach to the output feature. */
|
|
291
|
+
properties?: Record<string, unknown>;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Service exposing general purpose geometry helpers for creating
|
|
296
|
+
* approximated polygons (ellipses, sectors, donuts) from metric parameters.
|
|
297
|
+
*/
|
|
298
|
+
declare class OlGeometryService {
|
|
299
|
+
private idCounter;
|
|
300
|
+
/**
|
|
301
|
+
* Build a `Feature<Polygon>` approximating an ellipse centered at
|
|
302
|
+
* `config.center`. See {@link EllipseConfig} for parameter semantics.
|
|
303
|
+
*/
|
|
304
|
+
createEllipse(config: EllipseConfig): Feature;
|
|
305
|
+
/**
|
|
306
|
+
* Build a `Feature<Polygon>` for a circular sector (pie slice).
|
|
307
|
+
* See {@link SectorConfig} for parameter semantics.
|
|
308
|
+
*/
|
|
309
|
+
createSector(config: SectorConfig): Feature;
|
|
310
|
+
/**
|
|
311
|
+
* Build a `Feature<Polygon>` for a donut (annular ring). The output has
|
|
312
|
+
* two rings: an outer ring wound counter-clockwise and an inner ring
|
|
313
|
+
* wound clockwise so the GeoJSON right-hand rule renders the hole.
|
|
314
|
+
*/
|
|
315
|
+
createDonut(config: DonutConfig): Feature;
|
|
316
|
+
/**
|
|
317
|
+
* Project an `(dx, dy)` meter offset from `center` to lon/lat using true
|
|
318
|
+
* geodesic math (Vincenty's formulae) via ol/sphere.
|
|
319
|
+
*/
|
|
320
|
+
offsetMetersToLonLat(center: Coordinate, dx: number, dy: number): Coordinate;
|
|
321
|
+
private nextId;
|
|
322
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<OlGeometryService, never>;
|
|
323
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<OlGeometryService>;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
type OlFeatureKind = 'layers' | 'controls' | 'interactions' | 'overlays' | 'military' | 'projections';
|
|
219
327
|
interface OlFeature<Kind extends OlFeatureKind> {
|
|
220
328
|
kind: Kind;
|
|
221
329
|
providers: Provider[];
|
|
222
330
|
}
|
|
223
331
|
declare function provideOpenLayers(...features: OlFeature<OlFeatureKind>[]): EnvironmentProviders;
|
|
224
332
|
|
|
225
|
-
|
|
226
|
-
|
|
333
|
+
interface Proj4Definition {
|
|
334
|
+
code: string;
|
|
335
|
+
def: string;
|
|
336
|
+
extent?: [number, number, number, number];
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Registers custom projections using proj4.
|
|
340
|
+
*
|
|
341
|
+
* @param proj4 - The proj4 instance (must be passed to avoid strong dependency on proj4 package)
|
|
342
|
+
* @param definitions - Array of projection definitions
|
|
343
|
+
* @returns OlFeature for projections
|
|
344
|
+
*/
|
|
345
|
+
declare function withProjections(proj4: any, definitions: Proj4Definition[]): OlFeature<'projections'>;
|
|
346
|
+
|
|
347
|
+
export { OlGeometryService, OlMapComponent, OlMapService, OlZoneHelper, provideOpenLayers, withProjections };
|
|
348
|
+
export type { AnimationOptions, Coordinate, DonutConfig, EllipseConfig, Extent, Feature, FitOptions, Geometry, GeometryType, Layer, MapClickEvent, MapConfig, MapViewOptions, OlFeature, OlFeatureKind, Pixel, Proj4Definition, ProjectionCode, SectorConfig, Style, ViewState };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as rxjs from 'rxjs';
|
|
2
2
|
import * as _angular_helpers_openlayers_interactions from '@angular-helpers/openlayers/interactions';
|
|
3
|
-
import * as
|
|
3
|
+
import * as _angular_core from '@angular/core';
|
|
4
4
|
import { Provider } from '@angular/core';
|
|
5
5
|
import * as _angular_helpers_openlayers_core from '@angular-helpers/openlayers/core';
|
|
6
6
|
import { Feature, OlFeature } from '@angular-helpers/openlayers/core';
|
|
@@ -22,9 +22,10 @@ interface SelectConfig extends InteractionConfig {
|
|
|
22
22
|
layers?: string[];
|
|
23
23
|
multi?: boolean;
|
|
24
24
|
hitTolerance?: number;
|
|
25
|
+
condition?: 'click' | 'pointerMove';
|
|
25
26
|
}
|
|
26
27
|
interface DrawConfig extends InteractionConfig {
|
|
27
|
-
type: 'Point' | 'LineString' | 'Polygon' | 'Circle';
|
|
28
|
+
type: 'Point' | 'LineString' | 'Polygon' | 'Circle' | 'Ellipse' | 'Donut';
|
|
28
29
|
source?: string;
|
|
29
30
|
freehand?: boolean;
|
|
30
31
|
snapTolerance?: number;
|
|
@@ -38,17 +39,21 @@ interface DragAndDropConfig extends InteractionConfig {
|
|
|
38
39
|
projection?: string;
|
|
39
40
|
}
|
|
40
41
|
interface SelectEvent {
|
|
41
|
-
|
|
42
|
-
selected:
|
|
42
|
+
interactionId: string;
|
|
43
|
+
selected: Feature[];
|
|
44
|
+
deselected: Feature[];
|
|
43
45
|
}
|
|
44
46
|
interface DrawEndEvent {
|
|
47
|
+
interactionId: string;
|
|
45
48
|
feature: Feature;
|
|
46
49
|
type: string;
|
|
47
50
|
}
|
|
48
51
|
interface DrawStartEvent {
|
|
52
|
+
interactionId: string;
|
|
49
53
|
feature: Feature;
|
|
50
54
|
}
|
|
51
55
|
interface ModifyEvent {
|
|
56
|
+
interactionId: string;
|
|
52
57
|
features: Feature[];
|
|
53
58
|
type: 'modifystart' | 'modifyend';
|
|
54
59
|
}
|
|
@@ -83,13 +88,14 @@ declare class OlInteractionService {
|
|
|
83
88
|
private selectService;
|
|
84
89
|
private drawService;
|
|
85
90
|
private modifyService;
|
|
86
|
-
readonly selectedFeatures:
|
|
87
|
-
readonly selectionCount:
|
|
88
|
-
readonly hasSelection:
|
|
89
|
-
readonly activeInteractions:
|
|
91
|
+
readonly selectedFeatures: _angular_core.Signal<_angular_helpers_openlayers_core.Feature[]>;
|
|
92
|
+
readonly selectionCount: _angular_core.Signal<number>;
|
|
93
|
+
readonly hasSelection: _angular_core.Signal<boolean>;
|
|
94
|
+
readonly activeInteractions: _angular_core.Signal<_angular_helpers_openlayers_interactions.ManagedInteraction[]>;
|
|
90
95
|
readonly drawStart$: rxjs.Observable<_angular_helpers_openlayers_interactions.DrawStartEvent>;
|
|
91
96
|
readonly drawEnd$: rxjs.Observable<_angular_helpers_openlayers_interactions.DrawEndEvent>;
|
|
92
97
|
readonly modify$: rxjs.Observable<_angular_helpers_openlayers_interactions.ModifyEvent>;
|
|
98
|
+
readonly select$: rxjs.Observable<_angular_helpers_openlayers_interactions.SelectEvent>;
|
|
93
99
|
/**
|
|
94
100
|
* Enable a select interaction on the map.
|
|
95
101
|
* @param id - Unique identifier for this interaction
|
|
@@ -144,8 +150,8 @@ declare class OlInteractionService {
|
|
|
144
150
|
* @returns Array of interaction state summaries
|
|
145
151
|
*/
|
|
146
152
|
getInteractionState(): _angular_helpers_openlayers_interactions.InteractionState[];
|
|
147
|
-
static ɵfac:
|
|
148
|
-
static ɵprov:
|
|
153
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<OlInteractionService, never>;
|
|
154
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<OlInteractionService>;
|
|
149
155
|
}
|
|
150
156
|
|
|
151
157
|
/**
|
|
@@ -175,13 +181,15 @@ declare class InteractionStateService {
|
|
|
175
181
|
private drawStartSubject;
|
|
176
182
|
private drawEndSubject;
|
|
177
183
|
private modifySubject;
|
|
178
|
-
|
|
179
|
-
readonly
|
|
180
|
-
readonly
|
|
181
|
-
readonly
|
|
184
|
+
private selectSubject;
|
|
185
|
+
readonly selectedFeatures: _angular_core.Signal<Feature[]>;
|
|
186
|
+
readonly selectionCount: _angular_core.Signal<number>;
|
|
187
|
+
readonly hasSelection: _angular_core.Signal<boolean>;
|
|
188
|
+
readonly activeInteractions: _angular_core.Signal<ManagedInteraction[]>;
|
|
182
189
|
readonly drawStart$: rxjs.Observable<DrawStartEvent>;
|
|
183
190
|
readonly drawEnd$: rxjs.Observable<DrawEndEvent>;
|
|
184
191
|
readonly modify$: rxjs.Observable<ModifyEvent>;
|
|
192
|
+
readonly select$: rxjs.Observable<SelectEvent>;
|
|
185
193
|
/**
|
|
186
194
|
* Adds a managed interaction to the state.
|
|
187
195
|
* If the interaction is marked as exclusive, it disables other exclusive interactions.
|
|
@@ -228,6 +236,11 @@ declare class InteractionStateService {
|
|
|
228
236
|
* @param event - The modify event data
|
|
229
237
|
*/
|
|
230
238
|
emitModify(event: ModifyEvent): void;
|
|
239
|
+
/**
|
|
240
|
+
* Emits a select event.
|
|
241
|
+
* @param event - The select event data
|
|
242
|
+
*/
|
|
243
|
+
emitSelect(event: SelectEvent): void;
|
|
231
244
|
/**
|
|
232
245
|
* Gets the current interaction state summary.
|
|
233
246
|
* @returns Array of interaction state objects
|
|
@@ -244,8 +257,8 @@ declare class InteractionStateService {
|
|
|
244
257
|
* Note: This only clears the state tracking, not the actual OL interactions.
|
|
245
258
|
*/
|
|
246
259
|
clearAll(): void;
|
|
247
|
-
static ɵfac:
|
|
248
|
-
static ɵprov:
|
|
260
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<InteractionStateService, never>;
|
|
261
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<InteractionStateService>;
|
|
249
262
|
}
|
|
250
263
|
|
|
251
264
|
/**
|
|
@@ -263,8 +276,8 @@ declare class SelectInteractionService {
|
|
|
263
276
|
* @returns Promise that resolves when the interaction is created
|
|
264
277
|
*/
|
|
265
278
|
createSelectInteraction(id: string, config: SelectConfig, map: OLMap): void;
|
|
266
|
-
static ɵfac:
|
|
267
|
-
static ɵprov:
|
|
279
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SelectInteractionService, never>;
|
|
280
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<SelectInteractionService>;
|
|
268
281
|
}
|
|
269
282
|
|
|
270
283
|
/**
|
|
@@ -283,8 +296,8 @@ declare class DrawInteractionService {
|
|
|
283
296
|
* @returns True if the interaction was created successfully
|
|
284
297
|
*/
|
|
285
298
|
createDrawInteraction(id: string, config: DrawConfig, map: OLMap): boolean;
|
|
286
|
-
static ɵfac:
|
|
287
|
-
static ɵprov:
|
|
299
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DrawInteractionService, never>;
|
|
300
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<DrawInteractionService>;
|
|
288
301
|
}
|
|
289
302
|
|
|
290
303
|
/**
|
|
@@ -301,8 +314,30 @@ declare class ModifyInteractionService {
|
|
|
301
314
|
* @param map - OpenLayers map instance
|
|
302
315
|
*/
|
|
303
316
|
createModifyInteraction(id: string, config: ModifyConfig, map: OLMap): void;
|
|
304
|
-
static ɵfac:
|
|
305
|
-
static ɵprov:
|
|
317
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ModifyInteractionService, never>;
|
|
318
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<ModifyInteractionService>;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
declare class MeasurementInteractionService {
|
|
322
|
+
private mapService;
|
|
323
|
+
private zoneHelper;
|
|
324
|
+
private draw?;
|
|
325
|
+
private source;
|
|
326
|
+
private vectorLayer?;
|
|
327
|
+
private map?;
|
|
328
|
+
private sketch;
|
|
329
|
+
private measureTooltipElement;
|
|
330
|
+
private measureTooltip;
|
|
331
|
+
private listener;
|
|
332
|
+
private isMeasuring;
|
|
333
|
+
startMeasuring(type: 'LineString' | 'Polygon'): void;
|
|
334
|
+
stopMeasuring(): void;
|
|
335
|
+
isActive(): boolean;
|
|
336
|
+
private createMeasureTooltip;
|
|
337
|
+
private formatLength;
|
|
338
|
+
private formatArea;
|
|
339
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MeasurementInteractionService, never>;
|
|
340
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<MeasurementInteractionService>;
|
|
306
341
|
}
|
|
307
342
|
|
|
308
343
|
/**
|
|
@@ -314,6 +349,63 @@ declare class ModifyInteractionService {
|
|
|
314
349
|
*/
|
|
315
350
|
declare function olFeatureToFeature(olFeature: Feature$1): Feature;
|
|
316
351
|
|
|
352
|
+
/**
|
|
353
|
+
* Declarative component to configure an OpenLayers Draw Interaction.
|
|
354
|
+
*/
|
|
355
|
+
declare class OlDrawInteractionComponent {
|
|
356
|
+
private interactionService;
|
|
357
|
+
private destroyRef;
|
|
358
|
+
id: _angular_core.InputSignal<string>;
|
|
359
|
+
type: _angular_core.InputSignal<"Point" | "LineString" | "Polygon" | "Circle">;
|
|
360
|
+
source: _angular_core.InputSignal<string>;
|
|
361
|
+
freehand: _angular_core.InputSignal<boolean>;
|
|
362
|
+
snapTolerance: _angular_core.InputSignal<number>;
|
|
363
|
+
active: _angular_core.InputSignal<boolean>;
|
|
364
|
+
private drawStartFiltered$;
|
|
365
|
+
private drawEndFiltered$;
|
|
366
|
+
drawStart: _angular_core.OutputRef<_angular_helpers_openlayers_interactions.DrawStartEvent>;
|
|
367
|
+
drawEnd: _angular_core.OutputRef<_angular_helpers_openlayers_interactions.DrawEndEvent>;
|
|
368
|
+
constructor();
|
|
369
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<OlDrawInteractionComponent, never>;
|
|
370
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<OlDrawInteractionComponent, "ol-draw-interaction", never, { "id": { "alias": "id"; "required": true; "isSignal": true; }; "type": { "alias": "type"; "required": true; "isSignal": true; }; "source": { "alias": "source"; "required": false; "isSignal": true; }; "freehand": { "alias": "freehand"; "required": false; "isSignal": true; }; "snapTolerance": { "alias": "snapTolerance"; "required": false; "isSignal": true; }; "active": { "alias": "active"; "required": false; "isSignal": true; }; }, { "drawStart": "drawStart"; "drawEnd": "drawEnd"; }, never, never, true, never>;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Declarative component to configure an OpenLayers Modify Interaction.
|
|
375
|
+
*/
|
|
376
|
+
declare class OlModifyInteractionComponent {
|
|
377
|
+
private interactionService;
|
|
378
|
+
private destroyRef;
|
|
379
|
+
id: _angular_core.InputSignal<string>;
|
|
380
|
+
source: _angular_core.InputSignal<string>;
|
|
381
|
+
snapTolerance: _angular_core.InputSignal<number>;
|
|
382
|
+
active: _angular_core.InputSignal<boolean>;
|
|
383
|
+
private modifyFiltered$;
|
|
384
|
+
modifyEvent: _angular_core.OutputRef<_angular_helpers_openlayers_interactions.ModifyEvent>;
|
|
385
|
+
constructor();
|
|
386
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<OlModifyInteractionComponent, never>;
|
|
387
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<OlModifyInteractionComponent, "ol-modify-interaction", never, { "id": { "alias": "id"; "required": true; "isSignal": true; }; "source": { "alias": "source"; "required": false; "isSignal": true; }; "snapTolerance": { "alias": "snapTolerance"; "required": false; "isSignal": true; }; "active": { "alias": "active"; "required": false; "isSignal": true; }; }, { "modifyEvent": "modifyEvent"; }, never, never, true, never>;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Declarative component to configure an OpenLayers Select Interaction.
|
|
392
|
+
*/
|
|
393
|
+
declare class OlSelectInteractionComponent {
|
|
394
|
+
private interactionService;
|
|
395
|
+
private destroyRef;
|
|
396
|
+
id: _angular_core.InputSignal<string>;
|
|
397
|
+
layers: _angular_core.InputSignal<string[]>;
|
|
398
|
+
multi: _angular_core.InputSignal<boolean>;
|
|
399
|
+
hitTolerance: _angular_core.InputSignal<number>;
|
|
400
|
+
condition: _angular_core.InputSignal<"click" | "pointerMove">;
|
|
401
|
+
active: _angular_core.InputSignal<boolean>;
|
|
402
|
+
private selectFiltered$;
|
|
403
|
+
selectEvent: _angular_core.OutputRef<_angular_helpers_openlayers_interactions.SelectEvent>;
|
|
404
|
+
constructor();
|
|
405
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<OlSelectInteractionComponent, never>;
|
|
406
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<OlSelectInteractionComponent, "ol-select-interaction", never, { "id": { "alias": "id"; "required": true; "isSignal": true; }; "layers": { "alias": "layers"; "required": false; "isSignal": true; }; "multi": { "alias": "multi"; "required": false; "isSignal": true; }; "hitTolerance": { "alias": "hitTolerance"; "required": false; "isSignal": true; }; "condition": { "alias": "condition"; "required": false; "isSignal": true; }; "active": { "alias": "active"; "required": false; "isSignal": true; }; }, { "selectEvent": "selectEvent"; }, never, never, true, never>;
|
|
407
|
+
}
|
|
408
|
+
|
|
317
409
|
/**
|
|
318
410
|
* Provide the interactions feature with OlInteractionService and all specialized services.
|
|
319
411
|
* Note: ZoneHelper is inherited from core's provideOpenLayers.
|
|
@@ -346,6 +438,11 @@ declare function withDrawInteraction(id: string, config: DrawConfig): Provider;
|
|
|
346
438
|
* @returns Provider function that enables modify interaction
|
|
347
439
|
*/
|
|
348
440
|
declare function withModifyInteraction(id: string, config?: ModifyConfig): Provider;
|
|
441
|
+
/**
|
|
442
|
+
* Enable measurement interaction when providing the interactions feature.
|
|
443
|
+
* @returns Provider function that enables measurement interaction
|
|
444
|
+
*/
|
|
445
|
+
declare function withMeasurementInteraction(): Provider;
|
|
349
446
|
|
|
350
|
-
export { DrawInteractionService, InteractionStateService, ModifyInteractionService, OlInteractionService, SelectInteractionService, olFeatureToFeature, provideInteractions, withDrawInteraction, withInteractions, withModifyInteraction, withSelectInteraction };
|
|
447
|
+
export { DrawInteractionService, InteractionStateService, MeasurementInteractionService, ModifyInteractionService, OlDrawInteractionComponent, OlInteractionService, OlModifyInteractionComponent, OlSelectInteractionComponent, SelectInteractionService, olFeatureToFeature, provideInteractions, withDrawInteraction, withInteractions, withMeasurementInteraction, withModifyInteraction, withSelectInteraction };
|
|
351
448
|
export type { DragAndDropConfig, DrawConfig, DrawEndEvent, DrawStartEvent, InteractionConfig, InteractionState, InteractionType, ManagedInteraction, ModifyConfig, ModifyEvent, SelectConfig, SelectEvent };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { Layer, Extent, Feature, Style, OlFeature } from '@angular-helpers/openlayers/core';
|
|
3
|
+
import { FlatStyleLike } from 'ol/style/flat';
|
|
4
|
+
import { Style as Style$1 } from 'ol/layer/WebGLTile';
|
|
3
5
|
import BaseLayer from 'ol/layer/Base';
|
|
4
6
|
|
|
5
7
|
interface LayerConfig extends Layer {
|
|
6
|
-
type: 'vector' | 'tile' | 'image';
|
|
8
|
+
type: 'vector' | 'tile' | 'image' | 'heatmap';
|
|
7
9
|
extent?: Extent;
|
|
8
10
|
minResolution?: number;
|
|
9
11
|
maxResolution?: number;
|
|
@@ -23,9 +25,18 @@ interface ClusterConfig {
|
|
|
23
25
|
interface VectorLayerConfig extends LayerConfig {
|
|
24
26
|
type: 'vector';
|
|
25
27
|
features?: Feature[];
|
|
28
|
+
url?: string;
|
|
29
|
+
format?: 'geojson' | 'topojson' | 'kml';
|
|
26
30
|
style?: Style | ((feature: Feature) => Style);
|
|
27
31
|
cluster?: ClusterConfig;
|
|
28
32
|
}
|
|
33
|
+
interface HeatmapLayerConfig extends LayerConfig {
|
|
34
|
+
type: 'heatmap';
|
|
35
|
+
features?: Feature[];
|
|
36
|
+
weight?: string | ((feature: Feature) => number);
|
|
37
|
+
blur?: number;
|
|
38
|
+
radius?: number;
|
|
39
|
+
}
|
|
29
40
|
interface TileLayerConfig extends LayerConfig {
|
|
30
41
|
type: 'tile';
|
|
31
42
|
source: SourceConfig;
|
|
@@ -46,20 +57,33 @@ interface ImageSourceConfig {
|
|
|
46
57
|
params?: Record<string, unknown>;
|
|
47
58
|
imageExtent?: Extent;
|
|
48
59
|
}
|
|
60
|
+
type AnyLayerConfig = VectorLayerConfig | TileLayerConfig | ImageLayerConfig | HeatmapLayerConfig;
|
|
61
|
+
|
|
62
|
+
declare class OlClusterComponent {
|
|
63
|
+
distance: _angular_core.InputSignal<number>;
|
|
64
|
+
minDistance: _angular_core.InputSignal<number>;
|
|
65
|
+
showCount: _angular_core.InputSignal<boolean>;
|
|
66
|
+
featureStyle: _angular_core.InputSignal<Style>;
|
|
67
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<OlClusterComponent, never>;
|
|
68
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<OlClusterComponent, "ol-cluster", never, { "distance": { "alias": "distance"; "required": false; "isSignal": true; }; "minDistance": { "alias": "minDistance"; "required": false; "isSignal": true; }; "showCount": { "alias": "showCount"; "required": false; "isSignal": true; }; "featureStyle": { "alias": "featureStyle"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
69
|
+
}
|
|
49
70
|
|
|
50
71
|
declare class OlVectorLayerComponent {
|
|
51
72
|
private layerService;
|
|
52
73
|
private destroyRef;
|
|
53
74
|
id: _angular_core.InputSignal<string>;
|
|
54
75
|
features: _angular_core.InputSignal<Feature[]>;
|
|
76
|
+
url: _angular_core.InputSignal<string>;
|
|
77
|
+
format: _angular_core.InputSignal<"geojson" | "topojson" | "kml">;
|
|
55
78
|
zIndex: _angular_core.InputSignal<number>;
|
|
56
79
|
opacity: _angular_core.InputSignal<number>;
|
|
57
80
|
visible: _angular_core.InputSignal<boolean>;
|
|
58
|
-
style: _angular_core.InputSignal<
|
|
81
|
+
style: _angular_core.InputSignal<any>;
|
|
59
82
|
cluster: _angular_core.InputSignal<ClusterConfig>;
|
|
83
|
+
clusterComponent: _angular_core.Signal<OlClusterComponent>;
|
|
60
84
|
constructor();
|
|
61
85
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<OlVectorLayerComponent, never>;
|
|
62
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<OlVectorLayerComponent, "ol-vector-layer", never, { "id": { "alias": "id"; "required": true; "isSignal": true; }; "features": { "alias": "features"; "required": false; "isSignal": true; }; "zIndex": { "alias": "zIndex"; "required": false; "isSignal": true; }; "opacity": { "alias": "opacity"; "required": false; "isSignal": true; }; "visible": { "alias": "visible"; "required": false; "isSignal": true; }; "style": { "alias": "style"; "required": false; "isSignal": true; }; "cluster": { "alias": "cluster"; "required": false; "isSignal": true; }; }, {},
|
|
86
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<OlVectorLayerComponent, "ol-vector-layer", never, { "id": { "alias": "id"; "required": true; "isSignal": true; }; "features": { "alias": "features"; "required": false; "isSignal": true; }; "url": { "alias": "url"; "required": false; "isSignal": true; }; "format": { "alias": "format"; "required": false; "isSignal": true; }; "zIndex": { "alias": "zIndex"; "required": false; "isSignal": true; }; "opacity": { "alias": "opacity"; "required": false; "isSignal": true; }; "visible": { "alias": "visible"; "required": false; "isSignal": true; }; "style": { "alias": "style"; "required": false; "isSignal": true; }; "cluster": { "alias": "cluster"; "required": false; "isSignal": true; }; }, {}, ["clusterComponent"], never, true, never>;
|
|
63
87
|
}
|
|
64
88
|
|
|
65
89
|
declare class OlTileLayerComponent {
|
|
@@ -94,9 +118,124 @@ declare class OlImageLayerComponent {
|
|
|
94
118
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<OlImageLayerComponent, "ol-image-layer", never, { "id": { "alias": "id"; "required": true; "isSignal": true; }; "sourceType": { "alias": "sourceType"; "required": true; "isSignal": true; }; "url": { "alias": "url"; "required": true; "isSignal": true; }; "params": { "alias": "params"; "required": false; "isSignal": true; }; "imageExtent": { "alias": "imageExtent"; "required": false; "isSignal": true; }; "zIndex": { "alias": "zIndex"; "required": false; "isSignal": true; }; "opacity": { "alias": "opacity"; "required": false; "isSignal": true; }; "visible": { "alias": "visible"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
95
119
|
}
|
|
96
120
|
|
|
121
|
+
declare class OlHeatmapLayerComponent {
|
|
122
|
+
private layerService;
|
|
123
|
+
private mapService;
|
|
124
|
+
private destroyRef;
|
|
125
|
+
id: _angular_core.InputSignal<string>;
|
|
126
|
+
features: _angular_core.InputSignal<Feature[]>;
|
|
127
|
+
zIndex: _angular_core.InputSignal<number>;
|
|
128
|
+
opacity: _angular_core.InputSignal<number>;
|
|
129
|
+
visible: _angular_core.InputSignal<boolean>;
|
|
130
|
+
blur: _angular_core.InputSignal<number>;
|
|
131
|
+
radius: _angular_core.InputSignal<number>;
|
|
132
|
+
/** Unit for radius and blur: 'pixels' (default) or 'meters' */
|
|
133
|
+
radiusUnit: _angular_core.InputSignal<"pixels" | "meters">;
|
|
134
|
+
weight: _angular_core.InputSignal<string | ((feature: Feature) => number)>;
|
|
135
|
+
/** Computed radius in pixels based on current resolution if unit is 'meters' */
|
|
136
|
+
private scaledRadius;
|
|
137
|
+
/** Computed blur in pixels based on current resolution if unit is 'meters' */
|
|
138
|
+
private scaledBlur;
|
|
139
|
+
constructor();
|
|
140
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<OlHeatmapLayerComponent, never>;
|
|
141
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<OlHeatmapLayerComponent, "ol-heatmap-layer", never, { "id": { "alias": "id"; "required": true; "isSignal": true; }; "features": { "alias": "features"; "required": false; "isSignal": true; }; "zIndex": { "alias": "zIndex"; "required": false; "isSignal": true; }; "opacity": { "alias": "opacity"; "required": false; "isSignal": true; }; "visible": { "alias": "visible"; "required": false; "isSignal": true; }; "blur": { "alias": "blur"; "required": false; "isSignal": true; }; "radius": { "alias": "radius"; "required": false; "isSignal": true; }; "radiusUnit": { "alias": "radiusUnit"; "required": false; "isSignal": true; }; "weight": { "alias": "weight"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* GPU-accelerated vector layer for rendering large datasets.
|
|
146
|
+
*
|
|
147
|
+
* Important: Uses WebGL 2 for rendering. Styles must be provided as
|
|
148
|
+
* `FlatStyleLike` objects (not `ol/style/Style` instances).
|
|
149
|
+
* Hit detection is disabled by default for performance.
|
|
150
|
+
*
|
|
151
|
+
* @usageNotes
|
|
152
|
+
* ```html
|
|
153
|
+
* <ol-webgl-vector-layer
|
|
154
|
+
* id="big-dataset"
|
|
155
|
+
* [features]="largeDataset()"
|
|
156
|
+
* [flatStyle]="{
|
|
157
|
+
* 'circle-radius': 6,
|
|
158
|
+
* 'circle-fill-color': ['match', ['get', 'type'], 'alert', 'red', 'blue'],
|
|
159
|
+
* 'stroke-color': '#333',
|
|
160
|
+
* 'stroke-width': 1
|
|
161
|
+
* }"
|
|
162
|
+
* [disableHitDetection]="true">
|
|
163
|
+
* </ol-webgl-vector-layer>
|
|
164
|
+
* ```
|
|
165
|
+
*/
|
|
166
|
+
declare class OlWebGLVectorLayerComponent {
|
|
167
|
+
private mapService;
|
|
168
|
+
private destroyRef;
|
|
169
|
+
/** Unique layer identifier */
|
|
170
|
+
id: _angular_core.InputSignal<string>;
|
|
171
|
+
/** Features to render */
|
|
172
|
+
features: _angular_core.InputSignal<Feature[]>;
|
|
173
|
+
/** WebGL flat style (required — no default provided) */
|
|
174
|
+
flatStyle: _angular_core.InputSignal<FlatStyleLike>;
|
|
175
|
+
/** Z-index for layer ordering */
|
|
176
|
+
zIndex: _angular_core.InputSignal<number>;
|
|
177
|
+
/** Opacity (0–1) */
|
|
178
|
+
opacity: _angular_core.InputSignal<number>;
|
|
179
|
+
/** Layer visibility */
|
|
180
|
+
visible: _angular_core.InputSignal<boolean>;
|
|
181
|
+
/** Disable hit detection for better performance (default: true) */
|
|
182
|
+
disableHitDetection: _angular_core.InputSignal<boolean>;
|
|
183
|
+
/** Style variables for dynamic expressions (e.g. `['var', 'threshold']`) */
|
|
184
|
+
variables: _angular_core.InputSignal<Record<string, string | number | boolean | number[]>>;
|
|
185
|
+
private layer;
|
|
186
|
+
private vectorSource;
|
|
187
|
+
constructor();
|
|
188
|
+
private syncFeatures;
|
|
189
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<OlWebGLVectorLayerComponent, never>;
|
|
190
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<OlWebGLVectorLayerComponent, "ol-webgl-vector-layer", never, { "id": { "alias": "id"; "required": true; "isSignal": true; }; "features": { "alias": "features"; "required": false; "isSignal": true; }; "flatStyle": { "alias": "flatStyle"; "required": true; "isSignal": true; }; "zIndex": { "alias": "zIndex"; "required": false; "isSignal": true; }; "opacity": { "alias": "opacity"; "required": false; "isSignal": true; }; "visible": { "alias": "visible"; "required": false; "isSignal": true; }; "disableHitDetection": { "alias": "disableHitDetection"; "required": false; "isSignal": true; }; "variables": { "alias": "variables"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* GPU-accelerated tile layer with color/brightness/contrast expressions.
|
|
195
|
+
*
|
|
196
|
+
* Supports the same tile sources as `ol-tile-layer` but renders via WebGL,
|
|
197
|
+
* enabling GPU-powered color manipulation (brightness, contrast, saturation, gamma).
|
|
198
|
+
*
|
|
199
|
+
* @usageNotes
|
|
200
|
+
* ```html
|
|
201
|
+
* <ol-webgl-tile-layer
|
|
202
|
+
* id="satellite-webgl"
|
|
203
|
+
* source="xyz"
|
|
204
|
+
* [url]="'https://server.arcgisonline.com/.../{z}/{y}/{x}'"
|
|
205
|
+
* [tileStyle]="{ brightness: 0.1, contrast: 0.2 }">
|
|
206
|
+
* </ol-webgl-tile-layer>
|
|
207
|
+
* ```
|
|
208
|
+
*/
|
|
209
|
+
declare class OlWebGLTileLayerComponent {
|
|
210
|
+
private mapService;
|
|
211
|
+
private destroyRef;
|
|
212
|
+
/** Unique layer identifier */
|
|
213
|
+
id: _angular_core.InputSignal<string>;
|
|
214
|
+
/** Tile source type */
|
|
215
|
+
source: _angular_core.InputSignal<"osm" | "xyz" | "mvt">;
|
|
216
|
+
/** Tile URL template (required for 'xyz' and 'mvt') */
|
|
217
|
+
url: _angular_core.InputSignal<string>;
|
|
218
|
+
/** Attribution text */
|
|
219
|
+
attributions: _angular_core.InputSignal<string | string[]>;
|
|
220
|
+
/** WebGL tile style (raster expressions) or flat style (MVT) */
|
|
221
|
+
tileStyle: _angular_core.InputSignal<FlatStyleLike | Style$1>;
|
|
222
|
+
/** Z-index for layer ordering */
|
|
223
|
+
zIndex: _angular_core.InputSignal<number>;
|
|
224
|
+
/** Opacity (0–1) */
|
|
225
|
+
opacity: _angular_core.InputSignal<number>;
|
|
226
|
+
/** Layer visibility */
|
|
227
|
+
visible: _angular_core.InputSignal<boolean>;
|
|
228
|
+
/** Preload low-res tiles up to this many zoom levels */
|
|
229
|
+
preload: _angular_core.InputSignal<number>;
|
|
230
|
+
private layer;
|
|
231
|
+
constructor();
|
|
232
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<OlWebGLTileLayerComponent, never>;
|
|
233
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<OlWebGLTileLayerComponent, "ol-webgl-tile-layer", never, { "id": { "alias": "id"; "required": true; "isSignal": true; }; "source": { "alias": "source"; "required": true; "isSignal": true; }; "url": { "alias": "url"; "required": false; "isSignal": true; }; "attributions": { "alias": "attributions"; "required": false; "isSignal": true; }; "tileStyle": { "alias": "tileStyle"; "required": false; "isSignal": true; }; "zIndex": { "alias": "zIndex"; "required": false; "isSignal": true; }; "opacity": { "alias": "opacity"; "required": false; "isSignal": true; }; "visible": { "alias": "visible"; "required": false; "isSignal": true; }; "preload": { "alias": "preload"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
234
|
+
}
|
|
235
|
+
|
|
97
236
|
interface LayerInfo {
|
|
98
237
|
id: string;
|
|
99
|
-
type: 'vector' | 'tile' | 'image';
|
|
238
|
+
type: 'vector' | 'tile' | 'image' | 'heatmap';
|
|
100
239
|
visible: boolean;
|
|
101
240
|
opacity: number;
|
|
102
241
|
zIndex: number;
|
|
@@ -110,7 +249,7 @@ declare class OlLayerService {
|
|
|
110
249
|
readonly visibleLayers: _angular_core.Signal<LayerInfo[]>;
|
|
111
250
|
readonly tileLayers: _angular_core.Signal<LayerInfo[]>;
|
|
112
251
|
readonly vectorLayers: _angular_core.Signal<LayerInfo[]>;
|
|
113
|
-
addLayer(config:
|
|
252
|
+
addLayer(config: AnyLayerConfig): {
|
|
114
253
|
id: string;
|
|
115
254
|
};
|
|
116
255
|
private flushPending;
|
|
@@ -122,6 +261,11 @@ declare class OlLayerService {
|
|
|
122
261
|
toggleVisibility(id: string): boolean;
|
|
123
262
|
setOpacity(id: string, opacity: number): void;
|
|
124
263
|
setZIndex(id: string, zIndex: number): void;
|
|
264
|
+
setHeatmapProperties(id: string, props: {
|
|
265
|
+
blur?: number;
|
|
266
|
+
radius?: number;
|
|
267
|
+
weight?: string | ((feature: any) => number);
|
|
268
|
+
}): void;
|
|
125
269
|
isVisible(id: string): boolean;
|
|
126
270
|
getOpacity(id: string): number;
|
|
127
271
|
getZIndex(id: string): number;
|
|
@@ -140,6 +284,7 @@ declare class OlLayerService {
|
|
|
140
284
|
updateFeatures(id: string, features: VectorLayerConfig['features']): void;
|
|
141
285
|
private updateLayerState;
|
|
142
286
|
private createVectorLayer;
|
|
287
|
+
private createHeatmapLayer;
|
|
143
288
|
private createTileLayer;
|
|
144
289
|
private createImageLayer;
|
|
145
290
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<OlLayerService, never>;
|
|
@@ -149,5 +294,5 @@ declare class OlLayerService {
|
|
|
149
294
|
declare function withLayers(): OlFeature<'layers'>;
|
|
150
295
|
declare function provideLayers(): OlFeature<'layers'>;
|
|
151
296
|
|
|
152
|
-
export { OlImageLayerComponent, OlLayerService, OlTileLayerComponent, OlVectorLayerComponent, provideLayers, withLayers };
|
|
153
|
-
export type { ImageLayerConfig, ImageSourceConfig, LayerConfig, LayerInfo, SourceConfig, TileLayerConfig, VectorLayerConfig };
|
|
297
|
+
export { OlClusterComponent, OlHeatmapLayerComponent, OlImageLayerComponent, OlLayerService, OlTileLayerComponent, OlVectorLayerComponent, OlWebGLTileLayerComponent, OlWebGLVectorLayerComponent, provideLayers, withLayers };
|
|
298
|
+
export type { HeatmapLayerConfig, ImageLayerConfig, ImageSourceConfig, LayerConfig, LayerInfo, SourceConfig, TileLayerConfig, VectorLayerConfig };
|