aur-openlayers 19.6.3 → 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 +160 -10
- package/fesm2022/aur-openlayers.mjs.map +1 -1
- package/lib/map-framework/public/types.d.ts +41 -0
- package/lib/map-framework/runtime/decorations/arrow-decoration-manager.d.ts +27 -0
- package/lib/map-framework/runtime/fit-layer.utils.d.ts +2 -1
- package/lib/map-framework/runtime/layer-manager.d.ts +1 -0
- package/package.json +1 -1
|
@@ -271,6 +271,8 @@ export type ViewFitOptions = {
|
|
|
271
271
|
duration?: number;
|
|
272
272
|
/** Верхний предел увеличения. */
|
|
273
273
|
maxZoom?: number;
|
|
274
|
+
/** Сохранить текущий зум (maxZoom = текущий зум). Перекрывает maxZoom. */
|
|
275
|
+
keepZoom?: boolean;
|
|
274
276
|
};
|
|
275
277
|
/**
|
|
276
278
|
* Функция отписки от событий.
|
|
@@ -454,6 +456,40 @@ export type MapController = {
|
|
|
454
456
|
/** Освободить ресурсы при отвязке (опционально). */
|
|
455
457
|
unbind?: () => void;
|
|
456
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
|
+
};
|
|
457
493
|
/**
|
|
458
494
|
* Описание фичи: геометрия, стиль, взаимодействия и popup.
|
|
459
495
|
*
|
|
@@ -666,6 +702,11 @@ export interface FeatureDescriptor<M, G extends Geometry, OPTS extends object> {
|
|
|
666
702
|
event?: MapBrowserEvent<UIEvent>;
|
|
667
703
|
}) => PopupItem<M>;
|
|
668
704
|
};
|
|
705
|
+
/**
|
|
706
|
+
* Декоративные элементы вдоль LineString-геометрий.
|
|
707
|
+
* Игнорируется для не-LineString геометрий.
|
|
708
|
+
*/
|
|
709
|
+
decorations?: LineDecorations;
|
|
669
710
|
}
|
|
670
711
|
/**
|
|
671
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
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import type OlMap from 'ol/Map';
|
|
1
2
|
import type { VectorLayerApi, ViewFitOptions, ViewFitPadding } from '../public/types';
|
|
2
3
|
export declare function toOlPadding(p?: ViewFitPadding, fallback?: [number, number, number, number] | undefined): [number, number, number, number] | undefined;
|
|
3
|
-
export declare function toOlFitOptions(opts?: ViewFitOptions): any;
|
|
4
|
+
export declare function toOlFitOptions(opts?: ViewFitOptions, map?: OlMap): any;
|
|
4
5
|
export declare function collectLayersExtent(layers: Record<string, VectorLayerApi<any, any>>, layerIds?: ReadonlyArray<string>): import('ol/extent').Extent | null;
|
|
@@ -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;
|