bruce-models 3.1.4 → 3.1.6
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/bruce-models.es5.js +47 -570
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +44 -557
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/bruce-models.js +3 -5
- package/dist/lib/bruce-models.js.map +1 -1
- package/dist/lib/client-file/client-file.js.map +1 -1
- package/dist/lib/custom-form/custom-form.js.map +1 -1
- package/dist/lib/project/project-view-bookmark.js +0 -8
- package/dist/lib/project/project-view-bookmark.js.map +1 -1
- package/dist/lib/project/project-view-legacy-bookmark.js +12 -0
- package/dist/lib/project/project-view-legacy-bookmark.js.map +1 -0
- package/dist/lib/project/project-view-legacy-tile.js.map +1 -1
- package/dist/lib/project/project-view-legacy.js +12 -0
- package/dist/lib/project/project-view-legacy.js.map +1 -0
- package/dist/lib/project/project-view.js +1 -9
- package/dist/lib/project/project-view.js.map +1 -1
- package/dist/lib/user/permission.js +1 -0
- package/dist/lib/user/permission.js.map +1 -1
- package/dist/lib/util/object-utils.js +25 -6
- package/dist/lib/util/object-utils.js.map +1 -1
- package/dist/types/bruce-models.d.ts +3 -5
- package/dist/types/client-file/client-file.d.ts +5 -5
- package/dist/types/entity/entity-attachment.d.ts +1 -1
- package/dist/types/entity/entity-lod.d.ts +1 -1
- package/dist/types/entity/entity-type.d.ts +5 -5
- package/dist/types/entity/entity.d.ts +1 -1
- package/dist/types/import/imported-file.d.ts +1 -1
- package/dist/types/project/project-view-bookmark.d.ts +56 -113
- package/dist/types/project/project-view-legacy-bookmark.d.ts +62 -0
- package/dist/types/project/project-view-legacy.d.ts +49 -0
- package/dist/types/project/project-view.d.ts +30 -82
- package/dist/types/user/permission.d.ts +1 -0
- package/dist/types/util/object-utils.d.ts +2 -2
- package/package.json +1 -1
- package/dist/lib/entity/getters/batched-data-getter.js +0 -85
- package/dist/lib/entity/getters/batched-data-getter.js.map +0 -1
- package/dist/lib/entity/getters/entity-filter-getter.js +0 -321
- package/dist/lib/entity/getters/entity-filter-getter.js.map +0 -1
- package/dist/lib/entity/getters/entity-globe.js +0 -192
- package/dist/lib/entity/getters/entity-globe.js.map +0 -1
- package/dist/lib/entity/getters/view-monitor.js +0 -3
- package/dist/lib/entity/getters/view-monitor.js.map +0 -1
- package/dist/types/entity/getters/batched-data-getter.d.ts +0 -26
- package/dist/types/entity/getters/entity-filter-getter.d.ts +0 -61
- package/dist/types/entity/getters/entity-globe.d.ts +0 -21
- package/dist/types/entity/getters/view-monitor.d.ts +0 -13
|
@@ -17,7 +17,7 @@ export declare namespace ProjectViewBookmark {
|
|
|
17
17
|
function GetCacheKey(viewId: string, bookmarkId: string): string;
|
|
18
18
|
function GetListCacheKey(viewId: string): string;
|
|
19
19
|
const DEFAULT_DATA_VERSION = 1;
|
|
20
|
-
interface
|
|
20
|
+
interface IBookmark {
|
|
21
21
|
ID?: string;
|
|
22
22
|
Title?: string;
|
|
23
23
|
Note?: string;
|
|
@@ -28,126 +28,69 @@ export declare namespace ProjectViewBookmark {
|
|
|
28
28
|
"UI.SlideGroup.ID"?: number;
|
|
29
29
|
DataVersion: number;
|
|
30
30
|
DisplayOrder?: number;
|
|
31
|
-
Settings?:
|
|
31
|
+
Settings?: ISettings;
|
|
32
32
|
sections?: Section.ISection[];
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* These are the base settings expected in any bookmark data-version.
|
|
36
36
|
* The only exception is data-version = 1 which is our deprecated legacy format.
|
|
37
37
|
*/
|
|
38
|
-
interface
|
|
38
|
+
interface ISettings {
|
|
39
39
|
menuItemIds?: string[];
|
|
40
40
|
menuItemAlternations?: IDictionary<MenuItem.IItem>;
|
|
41
41
|
labelledEntityIds?: string[];
|
|
42
42
|
renderedRelations?: MenuItem.Item.IRenderedRelations[];
|
|
43
|
+
groundOcclusion?: boolean;
|
|
44
|
+
imagery?: ProjectViewTile.IBookmarkImagery[];
|
|
45
|
+
terrain?: ProjectViewTile.IBookmarkTerrain;
|
|
46
|
+
globeColor?: string;
|
|
47
|
+
globeAlpha?: number;
|
|
48
|
+
globeHidden?: boolean;
|
|
49
|
+
markup?: Markup.IMarkup;
|
|
50
|
+
shadows?: IShadows;
|
|
51
|
+
ambientOcclusion?: IAmbientOcclusion;
|
|
52
|
+
lighting?: ILighting;
|
|
53
|
+
quality?: IQuality;
|
|
54
|
+
dateTime?: string;
|
|
55
|
+
entityOpacityMap?: IDictionary<number>;
|
|
56
|
+
selectedEntityIds?: string[];
|
|
57
|
+
hiddenEntityIds?: string[];
|
|
58
|
+
isolatedEntityIds?: string[];
|
|
59
|
+
hillShades?: boolean;
|
|
60
|
+
liveEntityIds?: string[];
|
|
61
|
+
terrainWireframe?: boolean;
|
|
62
|
+
renderedEntityRelations?: string[];
|
|
43
63
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
Settings?: ISettings;
|
|
50
|
-
}
|
|
51
|
-
interface IBookmarkImagery {
|
|
52
|
-
title: string;
|
|
53
|
-
contrast: number;
|
|
54
|
-
hue: number;
|
|
55
|
-
saturation: number;
|
|
56
|
-
gamma: number;
|
|
57
|
-
brightness: number;
|
|
58
|
-
alpha: number;
|
|
59
|
-
}
|
|
60
|
-
interface ISettings extends IBaseSettings {
|
|
61
|
-
selectedItemIds?: string[];
|
|
62
|
-
order?: number;
|
|
63
|
-
hiddenEntityIds?: string[];
|
|
64
|
-
drawnRelationEntityIDs?: string[];
|
|
65
|
-
imagery?: IBookmarkImagery[];
|
|
66
|
-
terrain?: string;
|
|
67
|
-
globeColor?: string;
|
|
68
|
-
shadows?: boolean;
|
|
69
|
-
groundOcclusion?: boolean;
|
|
70
|
-
ambientOcclusion?: boolean;
|
|
71
|
-
markup?: Markup.IMarkup;
|
|
72
|
-
cameraFrustum?: Camera.EFrustum;
|
|
73
|
-
displayTimeline?: boolean;
|
|
74
|
-
timelineSettings?: any;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Lat,lon is in degrees.
|
|
78
|
-
* Altitude is meters relative to ground.
|
|
79
|
-
* Heading, pitch, roll are in radians.
|
|
80
|
-
*/
|
|
81
|
-
interface ICamera {
|
|
82
|
-
position: {
|
|
83
|
-
latitude: number;
|
|
84
|
-
longitude: number;
|
|
85
|
-
height: number;
|
|
86
|
-
};
|
|
87
|
-
heading: number;
|
|
88
|
-
pitch: number;
|
|
89
|
-
roll: number;
|
|
90
|
-
}
|
|
64
|
+
interface IShadows {
|
|
65
|
+
enabled: boolean;
|
|
66
|
+
soften: boolean;
|
|
67
|
+
pixelSize: number;
|
|
68
|
+
darkness: number;
|
|
91
69
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
liveEntityIds?: string[];
|
|
117
|
-
terrainWireframe?: boolean;
|
|
118
|
-
renderedEntityRelations?: string[];
|
|
119
|
-
}
|
|
120
|
-
interface IShadows {
|
|
121
|
-
enabled: boolean;
|
|
122
|
-
soften: boolean;
|
|
123
|
-
pixelSize: number;
|
|
124
|
-
darkness: number;
|
|
125
|
-
}
|
|
126
|
-
interface IAmbientOcclusion {
|
|
127
|
-
enabled: boolean;
|
|
128
|
-
intensity: number;
|
|
129
|
-
lengthCap: number;
|
|
130
|
-
bias: number;
|
|
131
|
-
blurStepSize: number;
|
|
132
|
-
stepSize: number;
|
|
133
|
-
}
|
|
134
|
-
interface ILighting {
|
|
135
|
-
color: string;
|
|
136
|
-
intensity: number;
|
|
137
|
-
}
|
|
138
|
-
interface IQuality {
|
|
139
|
-
fxaa: boolean;
|
|
140
|
-
}
|
|
141
|
-
interface ICamera {
|
|
142
|
-
altitude: number;
|
|
143
|
-
latitude: number;
|
|
144
|
-
longitude: number;
|
|
145
|
-
heading: number;
|
|
146
|
-
pitch: number;
|
|
147
|
-
roll: number;
|
|
148
|
-
transition?: number;
|
|
149
|
-
cameraFrustum?: Camera.EFrustum;
|
|
150
|
-
}
|
|
70
|
+
interface IAmbientOcclusion {
|
|
71
|
+
enabled: boolean;
|
|
72
|
+
intensity: number;
|
|
73
|
+
lengthCap: number;
|
|
74
|
+
bias: number;
|
|
75
|
+
blurStepSize: number;
|
|
76
|
+
stepSize: number;
|
|
77
|
+
}
|
|
78
|
+
interface ILighting {
|
|
79
|
+
color: string;
|
|
80
|
+
intensity: number;
|
|
81
|
+
}
|
|
82
|
+
interface IQuality {
|
|
83
|
+
fxaa: boolean;
|
|
84
|
+
}
|
|
85
|
+
interface ICamera {
|
|
86
|
+
altitude: number;
|
|
87
|
+
latitude: number;
|
|
88
|
+
longitude: number;
|
|
89
|
+
heading: number;
|
|
90
|
+
pitch: number;
|
|
91
|
+
roll: number;
|
|
92
|
+
transition?: number;
|
|
93
|
+
cameraFrustum?: Camera.EFrustum;
|
|
151
94
|
}
|
|
152
95
|
function Get(params: {
|
|
153
96
|
api?: BruceApi.Api;
|
|
@@ -155,7 +98,7 @@ export declare namespace ProjectViewBookmark {
|
|
|
155
98
|
bookmarkId: string;
|
|
156
99
|
req?: Api.IReqParams;
|
|
157
100
|
}): Promise<{
|
|
158
|
-
bookmark:
|
|
101
|
+
bookmark: IBookmark;
|
|
159
102
|
}>;
|
|
160
103
|
function Delete(params: {
|
|
161
104
|
api?: BruceApi.Api;
|
|
@@ -168,15 +111,15 @@ export declare namespace ProjectViewBookmark {
|
|
|
168
111
|
viewId: string;
|
|
169
112
|
req?: Api.IReqParams;
|
|
170
113
|
}): Promise<{
|
|
171
|
-
bookmarks:
|
|
114
|
+
bookmarks: IBookmark[];
|
|
172
115
|
}>;
|
|
173
116
|
function Update(params: {
|
|
174
117
|
api?: BruceApi.Api;
|
|
175
118
|
viewId: string;
|
|
176
|
-
bookmark:
|
|
119
|
+
bookmark: IBookmark;
|
|
177
120
|
req?: Api.IReqParams;
|
|
178
121
|
}): Promise<{
|
|
179
|
-
bookmark:
|
|
122
|
+
bookmark: IBookmark;
|
|
180
123
|
}>;
|
|
181
124
|
function SetOrder(params: {
|
|
182
125
|
api?: BruceApi.Api;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Camera } from "../common/camera";
|
|
2
|
+
import { UTC } from "../common/utc";
|
|
3
|
+
import { Markup } from "../markup/markup";
|
|
4
|
+
/**
|
|
5
|
+
* Deprecated Project View Bookmark record.
|
|
6
|
+
* This was used in the legacy web Navigator.
|
|
7
|
+
*/
|
|
8
|
+
export declare namespace ProjectViewLegacyBookmark {
|
|
9
|
+
const DATA_VERSION = 1;
|
|
10
|
+
interface IBookmark {
|
|
11
|
+
ID?: string;
|
|
12
|
+
Title?: string;
|
|
13
|
+
Camera?: ICamera;
|
|
14
|
+
Settings?: ISettings;
|
|
15
|
+
"Screenshot.ClientFile.ID"?: string;
|
|
16
|
+
"UI.View.ID"?: string;
|
|
17
|
+
"Created.ByUser.ID"?: string;
|
|
18
|
+
"Created.Date"?: UTC.IUTC;
|
|
19
|
+
DataVersion: number;
|
|
20
|
+
DisplayOrder?: number;
|
|
21
|
+
}
|
|
22
|
+
interface IBookmarkImagery {
|
|
23
|
+
title: string;
|
|
24
|
+
contrast: number;
|
|
25
|
+
hue: number;
|
|
26
|
+
saturation: number;
|
|
27
|
+
gamma: number;
|
|
28
|
+
brightness: number;
|
|
29
|
+
alpha: number;
|
|
30
|
+
}
|
|
31
|
+
interface ISettings {
|
|
32
|
+
selectedItemIds?: string[];
|
|
33
|
+
order?: number;
|
|
34
|
+
hiddenEntityIds?: string[];
|
|
35
|
+
drawnRelationEntityIDs?: string[];
|
|
36
|
+
imagery?: IBookmarkImagery[];
|
|
37
|
+
terrain?: string;
|
|
38
|
+
globeColor?: string;
|
|
39
|
+
shadows?: boolean;
|
|
40
|
+
groundOcclusion?: boolean;
|
|
41
|
+
ambientOcclusion?: boolean;
|
|
42
|
+
markup?: Markup.IMarkup;
|
|
43
|
+
cameraFrustum?: Camera.EFrustum;
|
|
44
|
+
displayTimeline?: boolean;
|
|
45
|
+
timelineSettings?: any;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Lat,lon is in degrees.
|
|
49
|
+
* Altitude is meters relative to ground.
|
|
50
|
+
* Heading, pitch, roll are in radians.
|
|
51
|
+
*/
|
|
52
|
+
interface ICamera {
|
|
53
|
+
position: {
|
|
54
|
+
latitude: number;
|
|
55
|
+
longitude: number;
|
|
56
|
+
height: number;
|
|
57
|
+
};
|
|
58
|
+
heading: number;
|
|
59
|
+
pitch: number;
|
|
60
|
+
roll: number;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { MenuItem } from "./menu-item";
|
|
2
|
+
import { ProjectView as PV } from "./project-view";
|
|
3
|
+
import { ProjectViewLegacyTile } from "./project-view-legacy-tile";
|
|
4
|
+
/**
|
|
5
|
+
* Deprecated Project View record.
|
|
6
|
+
* This was used in the legacy web Navigator.
|
|
7
|
+
*/
|
|
8
|
+
export declare namespace ProjectViewLegacy {
|
|
9
|
+
const DATA_VERSION = 1;
|
|
10
|
+
interface IShadowSettings {
|
|
11
|
+
IsShadowEnabled?: boolean;
|
|
12
|
+
IsShadowSoft?: boolean;
|
|
13
|
+
ShadowSampleSize?: number;
|
|
14
|
+
}
|
|
15
|
+
interface ISettings extends PV.ISettings {
|
|
16
|
+
BookmarkTransitionSpeed?: number;
|
|
17
|
+
Camera?: any;
|
|
18
|
+
CameraFrustum?: number;
|
|
19
|
+
CesiumMapSources?: ProjectViewLegacyTile.IMapSource[];
|
|
20
|
+
CesiumTerrainSources?: ProjectViewLegacyTile.ITerrainSource[];
|
|
21
|
+
ControlsSettings?: any;
|
|
22
|
+
DefaultMapTiles?: string;
|
|
23
|
+
DefaultTerrain?: string;
|
|
24
|
+
DisplayTimeline?: boolean;
|
|
25
|
+
GroundOcclusion?: boolean;
|
|
26
|
+
Extensions?: any;
|
|
27
|
+
GlobeColor?: string;
|
|
28
|
+
SelectionHighlightColor?: string;
|
|
29
|
+
LayersMenu?: MenuItem.IItem[];
|
|
30
|
+
OASettings?: any;
|
|
31
|
+
LogoImage?: any;
|
|
32
|
+
LegendImage?: any;
|
|
33
|
+
TilesetBackfaceCulling?: boolean;
|
|
34
|
+
TopPanelComponents?: string[];
|
|
35
|
+
LeftPanelComponents?: string[];
|
|
36
|
+
PostProcessFXAA?: boolean;
|
|
37
|
+
Shadows?: boolean;
|
|
38
|
+
CustomFormSettings?: any;
|
|
39
|
+
PreloadEntityTypes?: boolean;
|
|
40
|
+
ClickActions?: any;
|
|
41
|
+
Shadow?: {
|
|
42
|
+
StaticCamera?: IShadowSettings;
|
|
43
|
+
MovingCamera?: IShadowSettings;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
interface IView extends PV.IView {
|
|
47
|
+
Settings: ISettings;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -2,7 +2,6 @@ import { Api } from "../api/api";
|
|
|
2
2
|
import { BruceApi } from "../api/bruce-api";
|
|
3
3
|
import { UTC } from "../common/utc";
|
|
4
4
|
import { MenuItem } from "./menu-item";
|
|
5
|
-
import { ProjectViewLegacyTile } from "./project-view-legacy-tile";
|
|
6
5
|
import { ProjectViewTile } from "./project-view-tile";
|
|
7
6
|
import { ProjectViewBookmark } from "./project-view-bookmark";
|
|
8
7
|
import { ProjectViewSelection } from "./project-view-selection";
|
|
@@ -14,8 +13,8 @@ import { ProjectViewSelection } from "./project-view-selection";
|
|
|
14
13
|
export declare namespace ProjectView {
|
|
15
14
|
function GetCacheKey(viewId: string): string;
|
|
16
15
|
function GetListCacheKey(): string;
|
|
17
|
-
const DEFAULT_DATA_VERSION =
|
|
18
|
-
interface
|
|
16
|
+
const DEFAULT_DATA_VERSION = 2;
|
|
17
|
+
interface IView {
|
|
19
18
|
ID?: string;
|
|
20
19
|
Name: string;
|
|
21
20
|
Description?: string;
|
|
@@ -26,110 +25,59 @@ export declare namespace ProjectView {
|
|
|
26
25
|
CreatedByUIVersion?: string;
|
|
27
26
|
DataVersion: number;
|
|
28
27
|
SupportEmail?: string;
|
|
29
|
-
Settings?:
|
|
28
|
+
Settings?: ISettings;
|
|
30
29
|
IsDefault?: boolean;
|
|
31
30
|
}
|
|
32
31
|
/**
|
|
33
32
|
* These are the base settings expected in any project view data-version.
|
|
34
33
|
* The only exception is data-version = 1 which is our deprecated legacy format.
|
|
35
34
|
*/
|
|
36
|
-
interface
|
|
35
|
+
interface ISettings {
|
|
37
36
|
menuItems?: MenuItem.IItem[];
|
|
38
37
|
IsLoginRequired?: boolean;
|
|
39
38
|
IsRestricted?: boolean;
|
|
40
39
|
branding?: IBranding;
|
|
41
40
|
selection?: ProjectViewSelection.ISelection;
|
|
41
|
+
imageries?: ProjectViewTile.IViewImagery[];
|
|
42
|
+
terrains?: ProjectViewTile.IViewTerrain[];
|
|
43
|
+
defaults?: {
|
|
44
|
+
camera?: ProjectViewBookmark.ICamera;
|
|
45
|
+
settings?: ProjectViewBookmark.ISettings;
|
|
46
|
+
};
|
|
47
|
+
contact?: IContact;
|
|
48
|
+
plugins?: IPlugins;
|
|
49
|
+
selectionColor?: string;
|
|
50
|
+
present?: IPresent;
|
|
42
51
|
}
|
|
43
52
|
interface IBranding {
|
|
44
53
|
bannerFileId?: string;
|
|
45
54
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
const DATA_VERSION = 1;
|
|
49
|
-
interface IShadowSettings {
|
|
50
|
-
IsShadowEnabled?: boolean;
|
|
51
|
-
IsShadowSoft?: boolean;
|
|
52
|
-
ShadowSampleSize?: number;
|
|
53
|
-
}
|
|
54
|
-
interface ISettings extends IBaseSettings {
|
|
55
|
-
BookmarkTransitionSpeed?: number;
|
|
56
|
-
Camera?: any;
|
|
57
|
-
CameraFrustum?: number;
|
|
58
|
-
CesiumMapSources?: ProjectViewLegacyTile.IMapSource[];
|
|
59
|
-
CesiumTerrainSources?: ProjectViewLegacyTile.ITerrainSource[];
|
|
60
|
-
ControlsSettings?: any;
|
|
61
|
-
DefaultMapTiles?: string;
|
|
62
|
-
DefaultTerrain?: string;
|
|
63
|
-
DisplayTimeline?: boolean;
|
|
64
|
-
GroundOcclusion?: boolean;
|
|
65
|
-
Extensions?: any;
|
|
66
|
-
GlobeColor?: string;
|
|
67
|
-
SelectionHighlightColor?: string;
|
|
68
|
-
LayersMenu?: MenuItem.IItem[];
|
|
69
|
-
OASettings?: any;
|
|
70
|
-
LogoImage?: any;
|
|
71
|
-
LegendImage?: any;
|
|
72
|
-
TilesetBackfaceCulling?: boolean;
|
|
73
|
-
TopPanelComponents?: string[];
|
|
74
|
-
LeftPanelComponents?: string[];
|
|
75
|
-
PostProcessFXAA?: boolean;
|
|
76
|
-
Shadows?: boolean;
|
|
77
|
-
CustomFormSettings?: any;
|
|
78
|
-
PreloadEntityTypes?: boolean;
|
|
79
|
-
ClickActions?: any;
|
|
80
|
-
Shadow?: {
|
|
81
|
-
StaticCamera?: IShadowSettings;
|
|
82
|
-
MovingCamera?: IShadowSettings;
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
interface IView extends IBaseView {
|
|
86
|
-
Settings: ISettings;
|
|
87
|
-
}
|
|
55
|
+
interface IPresent {
|
|
56
|
+
bookmarkDuration?: number;
|
|
88
57
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
plugins?: IPlugins;
|
|
100
|
-
selectionColor?: string;
|
|
101
|
-
present?: IPresent;
|
|
102
|
-
}
|
|
103
|
-
interface IPresent {
|
|
104
|
-
bookmarkDuration?: number;
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Describes how to present contact information to the users.
|
|
108
|
-
*/
|
|
109
|
-
interface IContact {
|
|
110
|
-
enabled: boolean;
|
|
111
|
-
description?: string;
|
|
112
|
-
icon?: string;
|
|
113
|
-
}
|
|
114
|
-
interface IPlugins {
|
|
115
|
-
enabledIds: string[];
|
|
116
|
-
}
|
|
117
|
-
interface IView extends IBaseView {
|
|
118
|
-
Settings: ISettings;
|
|
119
|
-
}
|
|
58
|
+
/**
|
|
59
|
+
* Describes how to present contact information to the users.
|
|
60
|
+
*/
|
|
61
|
+
interface IContact {
|
|
62
|
+
enabled: boolean;
|
|
63
|
+
description?: string;
|
|
64
|
+
icon?: string;
|
|
65
|
+
}
|
|
66
|
+
interface IPlugins {
|
|
67
|
+
enabledIds: string[];
|
|
120
68
|
}
|
|
121
69
|
function Get(params: {
|
|
122
70
|
api?: BruceApi.Api;
|
|
123
71
|
viewId: string;
|
|
124
72
|
req?: Api.IReqParams;
|
|
125
73
|
}): Promise<{
|
|
126
|
-
view:
|
|
74
|
+
view: IView;
|
|
127
75
|
}>;
|
|
128
76
|
function GetList(params: {
|
|
129
77
|
api?: BruceApi.Api;
|
|
130
78
|
req?: Api.IReqParams;
|
|
131
79
|
}): Promise<{
|
|
132
|
-
views:
|
|
80
|
+
views: IView[];
|
|
133
81
|
}>;
|
|
134
82
|
function Delete(params: {
|
|
135
83
|
api?: BruceApi.Api;
|
|
@@ -138,9 +86,9 @@ export declare namespace ProjectView {
|
|
|
138
86
|
}): Promise<void>;
|
|
139
87
|
function Update(params: {
|
|
140
88
|
api?: BruceApi.Api;
|
|
141
|
-
view:
|
|
89
|
+
view: IView;
|
|
142
90
|
req?: Api.IReqParams;
|
|
143
91
|
}): Promise<{
|
|
144
|
-
view:
|
|
92
|
+
view: IView;
|
|
145
93
|
}>;
|
|
146
94
|
}
|
package/package.json
CHANGED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BatchedDataGetter = void 0;
|
|
4
|
-
const bruce_event_1 = require("../../common/bruce-event");
|
|
5
|
-
const MAX_AREA_IN_DEGREES = 90;
|
|
6
|
-
const GETTER_DELAY = 50;
|
|
7
|
-
/**
|
|
8
|
-
* This is a batched "arbitrary data" getter.
|
|
9
|
-
* You feed it an array of data, then it will emit that data in batches when the view changes.
|
|
10
|
-
*/
|
|
11
|
-
var BatchedDataGetter;
|
|
12
|
-
(function (BatchedDataGetter) {
|
|
13
|
-
class Getter {
|
|
14
|
-
get OnUpdate() {
|
|
15
|
-
if (!this.onUpdate) {
|
|
16
|
-
this.onUpdate = new bruce_event_1.BruceEvent();
|
|
17
|
-
}
|
|
18
|
-
return this.onUpdate;
|
|
19
|
-
}
|
|
20
|
-
constructor(data, viewPort, batchSize) {
|
|
21
|
-
this.viewPortRemoval = null;
|
|
22
|
-
this.viewRect = null;
|
|
23
|
-
this.viewCenter = null;
|
|
24
|
-
this.onUpdate = null;
|
|
25
|
-
this.data = data;
|
|
26
|
-
this.viewPort = viewPort;
|
|
27
|
-
this.batchSize = batchSize;
|
|
28
|
-
}
|
|
29
|
-
Start() {
|
|
30
|
-
this.viewPortRemoval = this.viewPort.Updated().Subscribe(() => {
|
|
31
|
-
this.updateViewport();
|
|
32
|
-
});
|
|
33
|
-
this.updateViewport();
|
|
34
|
-
}
|
|
35
|
-
Dispose() {
|
|
36
|
-
var _a;
|
|
37
|
-
(_a = this.viewPortRemoval) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
38
|
-
}
|
|
39
|
-
updateViewport() {
|
|
40
|
-
this.updateBounds();
|
|
41
|
-
this.startGetterLoop();
|
|
42
|
-
}
|
|
43
|
-
updateBounds() {
|
|
44
|
-
const viewRect = this.viewPort.GetBounds();
|
|
45
|
-
const poi = this.viewPort.GetTarget();
|
|
46
|
-
if (viewRect && poi) {
|
|
47
|
-
if (Math.abs(viewRect.west - viewRect.east) > MAX_AREA_IN_DEGREES) {
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
if (Math.abs(viewRect.south - viewRect.north) > MAX_AREA_IN_DEGREES) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
this.viewRect = viewRect;
|
|
54
|
-
this.viewCenter = poi;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
startGetterLoop() {
|
|
58
|
-
clearInterval(this.getterInterval);
|
|
59
|
-
if (!this.viewRect || !this.viewCenter) {
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
let index = 0;
|
|
63
|
-
const onTick = () => {
|
|
64
|
-
this.processBatch(this.data.slice(index, index + this.batchSize));
|
|
65
|
-
index += this.batchSize;
|
|
66
|
-
return index >= this.data.length;
|
|
67
|
-
};
|
|
68
|
-
if (!onTick()) {
|
|
69
|
-
this.getterInterval = setInterval(() => {
|
|
70
|
-
if (onTick()) {
|
|
71
|
-
clearInterval(this.getterInterval);
|
|
72
|
-
}
|
|
73
|
-
}, GETTER_DELAY);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
processBatch(batch) {
|
|
77
|
-
var _a;
|
|
78
|
-
if (batch.length > 0) {
|
|
79
|
-
(_a = this.onUpdate) === null || _a === void 0 ? void 0 : _a.Trigger(batch);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
BatchedDataGetter.Getter = Getter;
|
|
84
|
-
})(BatchedDataGetter = exports.BatchedDataGetter || (exports.BatchedDataGetter = {}));
|
|
85
|
-
//# sourceMappingURL=batched-data-getter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"batched-data-getter.js","sourceRoot":"","sources":["../../../../src/entity/getters/batched-data-getter.ts"],"names":[],"mappings":";;;AACA,0DAAsD;AAItD,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAC/B,MAAM,YAAY,GAAG,EAAE,CAAC;AAExB;;;GAGG;AACH,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