@smart-factor/gem-ui-map-component 0.0.30 → 0.0.32
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/dist/{MapButtons-DiqEb1dh.js → MapButtons-C0R3op3n.js} +9917 -9823
- package/dist/components/Map/config.d.ts +1 -1
- package/dist/components/MapButtons/index.js +1 -1
- package/dist/components/MapPopups/PrintConfigDrawer/AdditionalOptions.d.ts +9 -0
- package/dist/components/MapPopups/PrintConfigDrawer/FrameManagement.d.ts +10 -0
- package/dist/components/MapPopups/PrintConfigDrawer/PrintConfigDrawer.d.ts +1 -0
- package/dist/components/MapPopups/PrintConfigDrawer/index.d.ts +2 -0
- package/dist/components/MapPopups/PrintConfigDrawer/styles.d.ts +22 -0
- package/dist/components/MapPopups/PrintConfigDrawer/types.d.ts +4 -0
- package/dist/components/MapPopups/PrintConfigDrawer/usePrintConfigDrawer.d.ts +22 -0
- package/dist/components/MapPopups/PrintConfigDrawer/utils.d.ts +21 -0
- package/dist/main.js +16271 -7004
- package/dist/services/Layers/LayersService.d.ts +1 -0
- package/dist/services/Print/PrintService.d.ts +112 -0
- package/dist/snap/helpers.d.ts +1 -1
- package/dist/types/print.d.ts +116 -0
- package/package.json +1 -1
|
@@ -16,6 +16,7 @@ declare class LayersService {
|
|
|
16
16
|
addLayersToSelected(layers: (GEMLayer | WMSLayerDetailed)[]): void;
|
|
17
17
|
removeLayersFromSelected(layers: (GEMLayer | WMSLayerDetailed)[]): void;
|
|
18
18
|
getSelectedLayersSymbols(): string[];
|
|
19
|
+
getSelectedLayersIds(): string[];
|
|
19
20
|
queryLayersByKeys(unprocessedLayers: GEMLayer[], checkedLayersKeys: string[]): GEMLayer[];
|
|
20
21
|
processLayersStructure(layers: GEMLayer[], selectedLayerIds: string[]): {
|
|
21
22
|
id: string;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { Feature } from 'ol';
|
|
2
|
+
import { Coordinate } from 'ol/coordinate';
|
|
3
|
+
import { Polygon } from 'ol/geom';
|
|
4
|
+
import { default as VectorLayer } from 'ol/layer/Vector';
|
|
5
|
+
import { default as Map } from 'ol/Map';
|
|
6
|
+
import { default as VectorSource } from 'ol/source/Vector';
|
|
7
|
+
import { Style } from 'ol/style';
|
|
8
|
+
import { PrintConfig, PrintFormat, PrintFrame, PrintPayload, PrintTemplate, SaveTemplatePayload } from '../../types/print';
|
|
9
|
+
declare class PrintService {
|
|
10
|
+
private printLayer;
|
|
11
|
+
private printFeatures;
|
|
12
|
+
private translateInteraction;
|
|
13
|
+
private currentMap;
|
|
14
|
+
/**
|
|
15
|
+
* Get the current map scale
|
|
16
|
+
*/
|
|
17
|
+
getMapScale(map: Map): number;
|
|
18
|
+
/**
|
|
19
|
+
* Get printable area dimensions in cm based on format and orientation
|
|
20
|
+
*/
|
|
21
|
+
getPrintableAreaDimensions(config: PrintConfig): {
|
|
22
|
+
width: number;
|
|
23
|
+
height: number;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Create print frame coordinates using pixel-based calculation
|
|
27
|
+
* This properly handles map projections by working in pixel space
|
|
28
|
+
*/
|
|
29
|
+
createPrintFrameCoordinates(map: Map, centerPixel: [number, number], config: PrintConfig): Coordinate[];
|
|
30
|
+
/**
|
|
31
|
+
* Create print frame style
|
|
32
|
+
*/
|
|
33
|
+
createPrintFrameStyle(format: PrintFormat | string, frameNumber: number): Style;
|
|
34
|
+
/**
|
|
35
|
+
* Create a styled print frame feature
|
|
36
|
+
*/
|
|
37
|
+
createPrintFrameFeature(map: Map, centerPixel: [number, number], config: PrintConfig, frameNumber?: number): Feature<Polygon>;
|
|
38
|
+
/**
|
|
39
|
+
* Initialize the print layer on the map
|
|
40
|
+
*/
|
|
41
|
+
initializePrintLayer(map: Map): VectorLayer<VectorSource>;
|
|
42
|
+
/**
|
|
43
|
+
* Initialize translate interaction for dragging the frame
|
|
44
|
+
*/
|
|
45
|
+
initializeTranslateInteraction(map: Map): void;
|
|
46
|
+
/**
|
|
47
|
+
* Get the center of the first print feature
|
|
48
|
+
*/
|
|
49
|
+
getPrintFeatureCenter(): Coordinate | null;
|
|
50
|
+
/**
|
|
51
|
+
* Show print frame on map
|
|
52
|
+
*/
|
|
53
|
+
showPrintFrame(map: Map, config: PrintConfig): void;
|
|
54
|
+
/**
|
|
55
|
+
* Add a new print frame to the map
|
|
56
|
+
*/
|
|
57
|
+
addPrintFrame(map: Map, config: PrintConfig): void;
|
|
58
|
+
/**
|
|
59
|
+
* Remove a print frame by index
|
|
60
|
+
*/
|
|
61
|
+
removePrintFrame(index: number): void;
|
|
62
|
+
/**
|
|
63
|
+
* Get the number of print frames
|
|
64
|
+
*/
|
|
65
|
+
getPrintFrameCount(): number;
|
|
66
|
+
/**
|
|
67
|
+
* Update print frame with new config while preserving position
|
|
68
|
+
*/
|
|
69
|
+
updatePrintFrame(map: Map, config: PrintConfig): void;
|
|
70
|
+
/**
|
|
71
|
+
* Hide and remove print frame from map
|
|
72
|
+
*/
|
|
73
|
+
hidePrintFrame(map: Map): void;
|
|
74
|
+
/**
|
|
75
|
+
* Restore frames from a saved template
|
|
76
|
+
*/
|
|
77
|
+
restoreFramesFromTemplate(map: Map, frames: PrintFrame[], config: PrintConfig): void;
|
|
78
|
+
/**
|
|
79
|
+
* Get the current print frames extent as FeatureCRSPayload array
|
|
80
|
+
*/
|
|
81
|
+
getPrintFrameExtents(): PrintFrame[];
|
|
82
|
+
/**
|
|
83
|
+
* Build the print payload for API request
|
|
84
|
+
*/
|
|
85
|
+
buildPrintPayload(config: PrintConfig, layers: string[], date?: string): PrintPayload | null;
|
|
86
|
+
/**
|
|
87
|
+
* Execute print request
|
|
88
|
+
*/
|
|
89
|
+
printMap(payload: PrintPayload): Promise<void>;
|
|
90
|
+
/**
|
|
91
|
+
* Get print templates from API
|
|
92
|
+
*/
|
|
93
|
+
getTemplates(): Promise<PrintTemplate[]>;
|
|
94
|
+
/**
|
|
95
|
+
* Save print template to API
|
|
96
|
+
*/
|
|
97
|
+
saveTemplate(payload: SaveTemplatePayload): Promise<PrintTemplate>;
|
|
98
|
+
/**
|
|
99
|
+
* Delete print templates from API
|
|
100
|
+
*/
|
|
101
|
+
deleteTemplates(templateIds: number[]): Promise<void>;
|
|
102
|
+
/**
|
|
103
|
+
* Download the print result file
|
|
104
|
+
*/
|
|
105
|
+
private downloadFile;
|
|
106
|
+
/**
|
|
107
|
+
* Extract filename from response headers or use fallback
|
|
108
|
+
*/
|
|
109
|
+
private queryFilename;
|
|
110
|
+
}
|
|
111
|
+
declare const _default: PrintService;
|
|
112
|
+
export default _default;
|
package/dist/snap/helpers.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ import { Collection, Feature } from 'ol';
|
|
|
2
2
|
import { Coordinate } from 'ol/coordinate';
|
|
3
3
|
import { FindInteractionProps, QuerySnapProps, RemoveInteractionProps } from './types';
|
|
4
4
|
export declare const removeInteraction: ({ type, map }: RemoveInteractionProps) => void;
|
|
5
|
-
export declare const findInteraction: ({ type, interactions, }: FindInteractionProps) => import('ol/interaction
|
|
5
|
+
export declare const findInteraction: ({ type, interactions, }: FindInteractionProps) => import('ol/interaction').Interaction | undefined;
|
|
6
6
|
export declare const createAngleFeatures: (points: Coordinate[]) => Collection<Feature<import('ol/geom').Geometry>>;
|
|
7
7
|
export declare const querySnapPoints: ({ interactLayers, type }: QuerySnapProps) => Collection<Feature<import('ol/geom').Geometry>>;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { Coordinate } from 'ol/coordinate';
|
|
2
|
+
export declare enum OutputFormat {
|
|
3
|
+
PDF = "PDF",
|
|
4
|
+
GEOTIFF = "GEOTIFF"
|
|
5
|
+
}
|
|
6
|
+
export declare enum PrintOrientation {
|
|
7
|
+
PORTRAIT = "PORTRAIT",
|
|
8
|
+
LANDSCAPE = "LANDSCAPE"
|
|
9
|
+
}
|
|
10
|
+
export declare enum PrintFormat {
|
|
11
|
+
A0 = "A0",
|
|
12
|
+
A1 = "A1",
|
|
13
|
+
A2 = "A2",
|
|
14
|
+
A3 = "A3",
|
|
15
|
+
A4 = "A4",
|
|
16
|
+
A5 = "A5",
|
|
17
|
+
SIZE_610x297 = "610x297",
|
|
18
|
+
SIZE_610x420 = "610x420",
|
|
19
|
+
SIZE_914x297 = "914x297",
|
|
20
|
+
SIZE_914x420 = "914x420"
|
|
21
|
+
}
|
|
22
|
+
export declare enum LegendOption {
|
|
23
|
+
EMPTY = "EMPTY",
|
|
24
|
+
ALL = "ALL",
|
|
25
|
+
LAST = "LAST"
|
|
26
|
+
}
|
|
27
|
+
type CrsPayload = {
|
|
28
|
+
properties: {
|
|
29
|
+
name: string;
|
|
30
|
+
};
|
|
31
|
+
type: string;
|
|
32
|
+
};
|
|
33
|
+
export type FeatureCRSPayload = {
|
|
34
|
+
coordinates: Coordinate[] | Coordinate[][];
|
|
35
|
+
crs: CrsPayload;
|
|
36
|
+
type: string;
|
|
37
|
+
};
|
|
38
|
+
export type PrintFrame = {
|
|
39
|
+
extent: FeatureCRSPayload;
|
|
40
|
+
number?: number;
|
|
41
|
+
rotation?: number;
|
|
42
|
+
};
|
|
43
|
+
export type PrintPayload = {
|
|
44
|
+
border_color: string;
|
|
45
|
+
dpi: number;
|
|
46
|
+
height: number;
|
|
47
|
+
width: number;
|
|
48
|
+
orientation: PrintOrientation;
|
|
49
|
+
print_format: PrintFormat | string;
|
|
50
|
+
scale: number;
|
|
51
|
+
show_legend: boolean;
|
|
52
|
+
show_north_arrow: boolean;
|
|
53
|
+
show_scale: boolean;
|
|
54
|
+
frames: PrintFrame[];
|
|
55
|
+
layers: string[];
|
|
56
|
+
outputFormat: OutputFormat;
|
|
57
|
+
legend?: LegendOption;
|
|
58
|
+
title?: string;
|
|
59
|
+
clauses?: string;
|
|
60
|
+
showDate?: boolean;
|
|
61
|
+
date?: string;
|
|
62
|
+
showFrameNumber?: boolean;
|
|
63
|
+
};
|
|
64
|
+
export type PrintConfig = {
|
|
65
|
+
format: PrintFormat;
|
|
66
|
+
orientation: PrintOrientation;
|
|
67
|
+
scale: number;
|
|
68
|
+
dpi: number;
|
|
69
|
+
borderColor: string;
|
|
70
|
+
showScale: boolean;
|
|
71
|
+
showNorthArrow: boolean;
|
|
72
|
+
showDate: boolean;
|
|
73
|
+
showFrameNumber: boolean;
|
|
74
|
+
legend: LegendOption;
|
|
75
|
+
title: string;
|
|
76
|
+
clauses: string;
|
|
77
|
+
outputFormat: OutputFormat;
|
|
78
|
+
offset: number;
|
|
79
|
+
};
|
|
80
|
+
export type PrintTemplate = {
|
|
81
|
+
id: number;
|
|
82
|
+
name: string;
|
|
83
|
+
frames: PrintFrame[];
|
|
84
|
+
border_color: string;
|
|
85
|
+
dpi: number;
|
|
86
|
+
print_format: string;
|
|
87
|
+
orientation: string;
|
|
88
|
+
show_scale: boolean;
|
|
89
|
+
show_north_arrow: boolean;
|
|
90
|
+
scale: number;
|
|
91
|
+
legend?: LegendOption;
|
|
92
|
+
title?: string;
|
|
93
|
+
clauses?: string;
|
|
94
|
+
showDate?: boolean;
|
|
95
|
+
showFrameNumber?: boolean;
|
|
96
|
+
outputFormat?: OutputFormat;
|
|
97
|
+
};
|
|
98
|
+
export type SaveTemplatePayload = {
|
|
99
|
+
configuration: string;
|
|
100
|
+
};
|
|
101
|
+
export declare const PRINT_DIMENSIONS: Record<string, {
|
|
102
|
+
portrait: {
|
|
103
|
+
width: number;
|
|
104
|
+
height: number;
|
|
105
|
+
};
|
|
106
|
+
landscape: {
|
|
107
|
+
width: number;
|
|
108
|
+
height: number;
|
|
109
|
+
};
|
|
110
|
+
}>;
|
|
111
|
+
export declare const CM_TO_PIXEL = 37.795276;
|
|
112
|
+
export declare const METERS_PER_PIXEL = 0.000264583;
|
|
113
|
+
export declare const DEFAULT_PRINT_CONFIG: PrintConfig;
|
|
114
|
+
export declare const SCALE_OPTIONS: number[];
|
|
115
|
+
export declare const DPI_OPTIONS: number[];
|
|
116
|
+
export {};
|