aur-openlayers 19.6.4 → 19.6.5
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/fesm2022/aur-openlayers.mjs +150 -3
- package/fesm2022/aur-openlayers.mjs.map +1 -1
- package/lib/map-framework/public/types.d.ts +39 -0
- package/lib/map-framework/runtime/decorations/arrow-decoration-manager.d.ts +27 -0
- package/lib/map-framework/runtime/layer-manager.d.ts +1 -0
- package/package.json +1 -1
|
@@ -456,6 +456,40 @@ export type MapController = {
|
|
|
456
456
|
/** Освободить ресурсы при отвязке (опционально). */
|
|
457
457
|
unbind?: () => void;
|
|
458
458
|
};
|
|
459
|
+
/**
|
|
460
|
+
* Конфигурация стрелок направления вдоль LineString.
|
|
461
|
+
*/
|
|
462
|
+
export type ArrowDecoration = {
|
|
463
|
+
/**
|
|
464
|
+
* Расстояние между стрелками в метрах.
|
|
465
|
+
* Функция — для адаптации интервала к масштабу.
|
|
466
|
+
*
|
|
467
|
+
* @example
|
|
468
|
+
* interval: (view) => Math.max(100, view.resolution * 80)
|
|
469
|
+
*/
|
|
470
|
+
interval: MaybeFn<number, [view: StyleView]>;
|
|
471
|
+
/**
|
|
472
|
+
* Стиль стрелки.
|
|
473
|
+
* Получает rotation (радианы, по часовой от севера — конвенция OL)
|
|
474
|
+
* и текущий вид карты.
|
|
475
|
+
*/
|
|
476
|
+
style: (args: {
|
|
477
|
+
rotation: number;
|
|
478
|
+
view: StyleView;
|
|
479
|
+
}) => Style | Style[];
|
|
480
|
+
/**
|
|
481
|
+
* Смещение первой стрелки от начала линии как доля интервала (0–1).
|
|
482
|
+
* По умолчанию: 0.5.
|
|
483
|
+
*/
|
|
484
|
+
offsetRatio?: number;
|
|
485
|
+
};
|
|
486
|
+
/**
|
|
487
|
+
* Декоративные элементы вдоль LineString-геометрий.
|
|
488
|
+
*/
|
|
489
|
+
export type LineDecorations = {
|
|
490
|
+
/** Стрелки направления вдоль линии. */
|
|
491
|
+
arrows?: ArrowDecoration;
|
|
492
|
+
};
|
|
459
493
|
/**
|
|
460
494
|
* Описание фичи: геометрия, стиль, взаимодействия и popup.
|
|
461
495
|
*
|
|
@@ -668,6 +702,11 @@ export interface FeatureDescriptor<M, G extends Geometry, OPTS extends object> {
|
|
|
668
702
|
event?: MapBrowserEvent<UIEvent>;
|
|
669
703
|
}) => PopupItem<M>;
|
|
670
704
|
};
|
|
705
|
+
/**
|
|
706
|
+
* Декоративные элементы вдоль LineString-геометрий.
|
|
707
|
+
* Игнорируется для не-LineString геометрий.
|
|
708
|
+
*/
|
|
709
|
+
decorations?: LineDecorations;
|
|
671
710
|
}
|
|
672
711
|
/**
|
|
673
712
|
* Конфигурация кластеризации слоя.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import VectorLayer from 'ol/layer/Vector';
|
|
2
|
+
import type OlMap from 'ol/Map';
|
|
3
|
+
import type { ArrowDecoration, VectorLayerApi } from '../../public/types';
|
|
4
|
+
export type ArrowDecorationManagerOptions = {
|
|
5
|
+
map: OlMap;
|
|
6
|
+
parentLayer: VectorLayer;
|
|
7
|
+
parentApi: VectorLayerApi<any, any>;
|
|
8
|
+
config: ArrowDecoration;
|
|
9
|
+
};
|
|
10
|
+
export declare class ArrowDecorationManager {
|
|
11
|
+
private readonly source;
|
|
12
|
+
private readonly layer;
|
|
13
|
+
private readonly config;
|
|
14
|
+
private readonly map;
|
|
15
|
+
private readonly parentLayer;
|
|
16
|
+
private readonly parentApi;
|
|
17
|
+
private readonly moveEndKey;
|
|
18
|
+
private readonly unsubCollection;
|
|
19
|
+
private readonly unsubChanges;
|
|
20
|
+
private rafId;
|
|
21
|
+
constructor(options: ArrowDecorationManagerOptions);
|
|
22
|
+
private scheduleUpdate;
|
|
23
|
+
private rebuild;
|
|
24
|
+
private syncVisibility;
|
|
25
|
+
private syncOpacity;
|
|
26
|
+
dispose(): void;
|
|
27
|
+
}
|
|
@@ -9,6 +9,7 @@ export declare class LayerManager<Layers extends readonly VectorLayerDescriptor<
|
|
|
9
9
|
private readonly scheduler;
|
|
10
10
|
private readonly popupHost;
|
|
11
11
|
private readonly ctx;
|
|
12
|
+
private readonly decorationManagers;
|
|
12
13
|
private constructor();
|
|
13
14
|
static create<Layers extends readonly VectorLayerDescriptor<any, any, any, any>[]>(map: OlMap, schema: MapSchema<Layers>): LayerManager<Layers>;
|
|
14
15
|
getLayer(id: string): VectorLayer | undefined;
|