@inovitas/infra3dapi 1.1.0 → 1.1.1

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 CHANGED
@@ -37,112 +37,111 @@ To use the API, you can call the init functions in infra3dapi. After loggin in a
37
37
 
38
38
  # Changelog
39
39
 
40
- ## 1.1.0 - 09.10.2024
41
-
42
- ### Bugfixes
43
-
44
- - Bug in viewer.getRoutesOutline() when using as migrated user.
45
- - Same default EPSG-Code (4326) when using start-position for (un)-migrated users.
46
-
47
- ### Added
48
-
49
- - ProjectScope is available to restrict the access inside a project accordingly.
50
- - New concept for routes abstraction in the map, using hexagons
51
- - viewer.getRouteLines() and viewer.getRouteHexes()
52
- - PointCloudExport
53
- - Support of EPSG-Code in start-position
54
-
55
- ## 1.0.3 - 17.09.2024
56
-
57
- ### Bugfixes
58
-
59
- - Fixed pilegate URL for migrated users.
60
- - Using the profiletool, added an information and reset the tool when changing the image while performing a measurement.
61
- - Fix the bug when using jest for testing.
62
- - Added missing bounding box parameter to viewer.getRoutes().
63
-
64
- ## 1.0.2 - 06.08.2024
65
-
66
- ### Bugfixes
67
-
68
- - Fixed bug in the layer tree view. The layer tree is visible again.
69
-
70
- ## 1.0.1 - 23.07.2024
71
-
72
- ### Bugfixes
73
-
74
- - Fixed a bug in the campaign change event in the viewer.
75
-
76
- ## 1.0.0 - 17.05.2024
77
-
78
- ### Bugfixes
79
-
80
- - Restoration of toolbar and top bar functionality: They can now be shown and hidden smoothly.
81
-
82
- ### Added
83
-
84
- - Introduction of machine authentication and a new corresponding example.
85
- - Added: Option for access token in the init function.
86
- - Added: Refresh token for the init function.
87
- - Typings
88
-
89
- ### Changed
90
-
91
- - Examples have been updated to accommodate the new authentication process.
92
-
93
- ### Deleted
94
-
95
- - Interactive login functions.
96
- - Removed: Two options from the init function:
97
- - demoAccess
98
- - redirectPath
99
-
100
- ## 0.2.8 - 08.04.2024
101
-
102
- ### Added
103
-
104
- - Integrated and documented functions
105
- - moveToPosition
106
- - moveToCampaign
107
- - lookAtPosition
108
- - getRoutes
109
-
110
- ## 0.2.7 - 04.04.2024
111
-
112
- ### Added
113
-
114
- - Improved documentation
115
- - Description of the event types
116
- - Description of further settings
117
-
118
- ### Changed
119
-
120
- - Adaptation to the existing examples
121
-
122
- ## 0.2.4 - 14.03.2024
123
-
124
- ### Bugfixes
125
-
126
- - Troubleshooting with internal module
127
-
128
- ## 0.2.3 - 09.02.2024
129
-
130
- ### Added
131
-
132
- - Demo Access Login
133
- - Documenation
134
-
135
- ### Changed
136
-
137
- - Adoption of adjustments to the UI base of infra3D Edit
138
-
139
- ### Bugfixes
140
-
141
- - Various minor adjustments
142
-
143
- ## 0.2.0 - 30.01.2024
144
-
145
- ### Added
146
-
147
- - Edit functionality
40
+ ## 1.1.0 - 09.10.2024
148
41
 
42
+ ### Bugfixes
43
+
44
+ - Bug in viewer.getRoutesOutline() when using as migrated user.
45
+ - Same default EPSG-Code (4326) when using start-position for (un)-migrated users.
46
+
47
+ ### Added
48
+
49
+ - ProjectScope is available to restrict the access inside a project accordingly.
50
+ - New concept for routes abstraction in the map, using hexagons
51
+ - viewer.getRouteLines() and viewer.getRouteHexes()
52
+ - PointCloudExport
53
+ - Support of EPSG-Code in start-position
54
+
55
+ ## 1.0.3 - 17.09.2024
56
+
57
+ ### Bugfixes
58
+
59
+ - Fixed pilegate URL for migrated users.
60
+ - Using the profiletool, added an information and reset the tool when changing the image while performing a measurement.
61
+ - Fix the bug when using jest for testing.
62
+ - Added missing bounding box parameter to viewer.getRoutes().
63
+
64
+ ## 1.0.2 - 06.08.2024
65
+
66
+ ### Bugfixes
67
+
68
+ - Fixed bug in the layer tree view. The layer tree is visible again.
69
+
70
+ ## 1.0.1 - 23.07.2024
71
+
72
+ ### Bugfixes
73
+
74
+ - Fixed a bug in the campaign change event in the viewer.
75
+
76
+ ## 1.0.0 - 17.05.2024
77
+
78
+ ### Bugfixes
79
+
80
+ - Restoration of toolbar and top bar functionality: They can now be shown and hidden smoothly.
81
+
82
+ ### Added
83
+
84
+ - Introduction of machine authentication and a new corresponding example.
85
+ - Added: Option for access token in the init function.
86
+ - Added: Refresh token for the init function.
87
+ - Typings
88
+
89
+ ### Changed
90
+
91
+ - Examples have been updated to accommodate the new authentication process.
92
+
93
+ ### Deleted
94
+
95
+ - Interactive login functions.
96
+ - Removed: Two options from the init function:
97
+ - demoAccess
98
+ - redirectPath
99
+
100
+ ## 0.2.8 - 08.04.2024
101
+
102
+ ### Added
103
+
104
+ - Integrated and documented functions
105
+ - moveToPosition
106
+ - moveToCampaign
107
+ - lookAtPosition
108
+ - getRoutes
109
+
110
+ ## 0.2.7 - 04.04.2024
111
+
112
+ ### Added
113
+
114
+ - Improved documentation
115
+ - Description of the event types
116
+ - Description of further settings
117
+
118
+ ### Changed
119
+
120
+ - Adaptation to the existing examples
121
+
122
+ ## 0.2.4 - 14.03.2024
123
+
124
+ ### Bugfixes
125
+
126
+ - Troubleshooting with internal module
127
+
128
+ ## 0.2.3 - 09.02.2024
129
+
130
+ ### Added
131
+
132
+ - Demo Access Login
133
+ - Documenation
134
+
135
+ ### Changed
136
+
137
+ - Adoption of adjustments to the UI base of infra3D Edit
138
+
139
+ ### Bugfixes
140
+
141
+ - Various minor adjustments
142
+
143
+ ## 0.2.0 - 30.01.2024
144
+
145
+ ### Added
146
+
147
+ - Edit functionality
package/infra3dapi.d.ts CHANGED
@@ -2,153 +2,202 @@ declare module "@inovitas/infra3dapi";
2
2
 
3
3
  declare type Fn = (arg: any) => void;
4
4
  declare class EventEmitter {
5
- protected _events: {
6
- [eventType: string]: Fn[];
7
- };
8
- constructor();
9
- on(eventType: string, fn: Fn): void;
10
- off(eventType: string, fn: Fn): void;
11
- fire(eventType: string, data: unknown): void;
12
- private _listens;
5
+ protected _events: {
6
+ [eventType: string]: Fn[];
7
+ };
8
+ constructor();
9
+ on(eventType: string, fn: Fn): void;
10
+ off(eventType: string, fn: Fn): void;
11
+ fire(eventType: string, data: unknown): void;
12
+ private _listens;
13
13
  }
14
14
 
15
- declare type ViewerEventType = "nodechanged" | "panorotationchanged" | "campaignschanged" | "lookazimuthchanged";
15
+ declare type ViewerEventType =
16
+ | "nodechanged"
17
+ | "panorotationchanged"
18
+ | "campaignschanged"
19
+ | "lookazimuthchanged";
16
20
 
17
21
  interface IViewer {
18
- fire<T>(type: ViewerEventType, event: T): void;
19
- off<T>(type: ViewerEventType, handler: (event: T) => void): void;
20
- on<T>(type: ViewerEventType, handler: (event: T) => void): void;
22
+ fire<T>(type: ViewerEventType, event: T): void;
23
+ off<T>(type: ViewerEventType, handler: (event: T) => void): void;
24
+ on<T>(type: ViewerEventType, handler: (event: T) => void): void;
21
25
  }
22
26
 
23
27
  interface ViewerEvent {
24
- target: IViewer;
25
- type: ViewerEventType;
28
+ target: IViewer;
29
+ type: ViewerEventType;
26
30
  }
27
31
 
28
32
  interface NodechangedEvent extends ViewerEvent {
29
- lat: number;
30
- lon: number;
31
- height: number;
32
- campaign_id: string;
33
- date: string;
34
- type: "nodechanged";
33
+ lat: number;
34
+ lon: number;
35
+ height: number;
36
+ campaign_id: string;
37
+ date: string;
38
+ type: "nodechanged";
35
39
  }
36
40
 
37
41
  interface CampaignschangedEvent extends ViewerEvent {
38
- id: number;
42
+ id: number;
39
43
 
40
- project: number;
44
+ project: number;
41
45
 
42
- description: string;
46
+ description: string;
43
47
 
44
- type: "campaignschanged";
48
+ type: "campaignschanged";
45
49
  }
46
50
 
47
51
  interface PanorotationchangedEvent extends ViewerEvent {
48
- fov: number;
52
+ fov: number;
49
53
 
50
- lat: number;
54
+ lat: number;
51
55
 
52
- lon: number;
56
+ lon: number;
53
57
 
54
- type: "panorotationchanged";
58
+ type: "panorotationchanged";
55
59
  }
56
60
 
57
61
  interface LookazimuthchangedEvent extends ViewerEvent {
58
- value: number;
62
+ value: number;
59
63
 
60
- type: "lookazimuthchanged";
64
+ type: "lookazimuthchanged";
61
65
  }
62
66
 
63
- declare class InternalViewer { }
64
- declare class GeoJSON { }
65
- declare class ApmBase { }
67
+ declare class InternalViewer {}
68
+ declare class GeoJSON {}
69
+ declare class ApmBase {}
66
70
 
67
71
  declare class Viewer extends EventEmitter implements IViewer {
68
- private _sdk_viewer;
69
- constructor(sdk_viewer: InternalViewer);
70
- moveToCampaign(campaignID: string): Promise<void>;
71
- moveToPosition(easting: number, northing: number, height?: number, maxdist?: number, epsg?: number): Promise<void>;
72
- lookAtPosition(easting: number, northing: number, height?: number, maxdist?: number, epsg?: number): Promise<void>;
73
- getRoutes(simplify?: number): Promise<GeoJSON>;
74
- attachToMeasurementTool(toolname: "lengthMeasure" | "areaMeasure", onmeasured: (value: number, geometry: number[][]) => void): void;
75
- attachToMeasurementTool(toolname: "pointMeasure", onmeasured: (value: undefined, geometry: number[]) => void): void;
76
- private _processMeasurementResult;
77
- off(type: "nodechanged", handler: (event: NodechangedEvent) => void): void;
78
- off(type: "campaignschanged", handler: (event: CampaignschangedEvent) => void): void;
79
- off(type: "panorotationchanged", handler: (event: PanorotationchangedEvent) => void): void;
80
- off(type: "lookazimuthchanged", handler: (event: LookazimuthchangedEvent) => void): void;
81
- on(type: "nodechanged", handler: (event: NodechangedEvent) => void): void;
82
- on(type: "campaignschanged", handler: (event: CampaignschangedEvent) => void): void;
83
- on(type: "panorotationchanged", handler: (event: PanorotationchangedEvent) => void): void;
84
- on(type: "lookazimuthchanged", handler: (event: LookazimuthchangedEvent) => void): void;
72
+ private _sdk_viewer;
73
+ constructor(sdk_viewer: InternalViewer);
74
+ moveToCampaign(campaignID: string): Promise<void>;
75
+ moveToPosition(
76
+ easting: number,
77
+ northing: number,
78
+ height?: number,
79
+ maxdist?: number,
80
+ epsg?: number
81
+ ): Promise<void>;
82
+ lookAtPosition(
83
+ easting: number,
84
+ northing: number,
85
+ height?: number,
86
+ maxdist?: number,
87
+ epsg?: number
88
+ ): Promise<void>;
89
+ getRoutes(simplify?: number): Promise<GeoJSON>;
90
+ attachToMeasurementTool(
91
+ toolname: "lengthMeasure" | "areaMeasure",
92
+ onmeasured: (value: number, geometry: number[][]) => void
93
+ ): void;
94
+ attachToMeasurementTool(
95
+ toolname: "pointMeasure",
96
+ onmeasured: (value: undefined, geometry: number[]) => void
97
+ ): void;
98
+ private _processMeasurementResult;
99
+ off(type: "nodechanged", handler: (event: NodechangedEvent) => void): void;
100
+ off(
101
+ type: "campaignschanged",
102
+ handler: (event: CampaignschangedEvent) => void
103
+ ): void;
104
+ off(
105
+ type: "panorotationchanged",
106
+ handler: (event: PanorotationchangedEvent) => void
107
+ ): void;
108
+ off(
109
+ type: "lookazimuthchanged",
110
+ handler: (event: LookazimuthchangedEvent) => void
111
+ ): void;
112
+ on(type: "nodechanged", handler: (event: NodechangedEvent) => void): void;
113
+ on(
114
+ type: "campaignschanged",
115
+ handler: (event: CampaignschangedEvent) => void
116
+ ): void;
117
+ on(
118
+ type: "panorotationchanged",
119
+ handler: (event: PanorotationchangedEvent) => void
120
+ ): void;
121
+ on(
122
+ type: "lookazimuthchanged",
123
+ handler: (event: LookazimuthchangedEvent) => void
124
+ ): void;
85
125
  }
86
126
 
87
127
  declare type applicationProps = {
88
- name: string;
89
- url: string;
128
+ name: string;
129
+ url: string;
90
130
  };
91
131
  declare type cardProps = {
92
- uid: string;
132
+ uid: string;
133
+ name: string;
134
+ description: string;
135
+ applications: applicationProps[];
136
+ created_by: string;
137
+ creation_date: string | Date;
138
+ tags: Array<{
93
139
  name: string;
94
- description: string;
95
- applications: applicationProps[];
96
- created_by: string;
97
- creation_date: string | Date;
98
- tags: Array<{
99
- name: string;
100
- font_color: string;
101
- background_color: string;
102
- }>;
140
+ font_color: string;
141
+ background_color: string;
142
+ }>;
103
143
  };
104
144
 
105
145
  declare class Manager extends EventEmitter {
106
- static viewinitialized: string;
107
- static viewerset: string;
108
- static tokenset: string;
109
- private _apm;
110
- private _tokens;
111
- constructor(apm: ApmBase);
112
- initViewer(options: {
113
- project_uid: string;
114
- start_position?: {
115
- easting: number;
116
- northing: number;
117
- epsg?: number;
118
- };
119
- start_campaign?: {
120
- id: string;
121
- };
122
- map_expand?: boolean;
123
- show_cockpit?: boolean;
124
- show_mapWindow?: boolean;
125
- show_toolbar?: boolean;
126
- toolbar?: string;
127
- show_topbar?: boolean;
128
- }): Promise<Viewer>;
129
- getProjects(): Promise<cardProps[]>;
130
- setViewer(viewer: InternalViewer): void;
131
- setTokens(tokens: any): void;
132
- setApmUserContext(userContext?: {
133
- id?: string;
134
- username?: string;
135
- email?: string;
136
- }): void;
146
+ static viewinitialized: string;
147
+ static viewerset: string;
148
+ static tokenset: string;
149
+ private _apm;
150
+ private _tokens;
151
+ constructor(apm: ApmBase);
152
+ initViewer(options: {
153
+ project_uid: string;
154
+ start_position?: {
155
+ easting: number;
156
+ northing: number;
157
+ epsg?: number;
158
+ };
159
+ start_campaign?: {
160
+ id: string;
161
+ };
162
+ map_expand?: boolean;
163
+ show_cockpit?: boolean;
164
+ show_mapWindow?: boolean;
165
+ show_toolbar?: boolean;
166
+ toolbar?: string;
167
+ show_topbar?: boolean;
168
+ }): Promise<Viewer>;
169
+ getProjects(): Promise<cardProps[]>;
170
+ setViewer(viewer: InternalViewer): void;
171
+ setTokens(tokens: any): void;
172
+ setApmUserContext(userContext?: {
173
+ id?: string;
174
+ username?: string;
175
+ email?: string;
176
+ }): void;
137
177
  }
138
178
 
139
179
  declare type accessTokenResponseType = {
140
- access_token: string;
141
- expires_in: number;
142
- token_type: "Bearer";
180
+ access_token: string;
181
+ expires_in: number;
182
+ token_type: "Bearer";
143
183
  };
144
184
 
145
- export declare function getAccessToken(url: string, client_id: string, client_secret: string): Promise<accessTokenResponseType>;
185
+ export declare function getAccessToken(
186
+ url: string,
187
+ client_id: string,
188
+ client_secret: string
189
+ ): Promise<accessTokenResponseType>;
146
190
 
147
- export declare function init(rootId: string, token: string, userContext?: {
191
+ export declare function init(
192
+ rootId: string,
193
+ token: string,
194
+ userContext?: {
148
195
  id?: string;
149
196
  username?: string;
150
197
  email?: string;
151
- }): Promise<Manager>;
198
+ }
199
+ ): Promise<Manager>;
152
200
  export declare function getManager(): Manager;
153
201
  export declare function getGuestAccessToken(): Promise<accessTokenResponseType>;
154
202
  export declare function refreshToken(token: string): void;
203
+