bruce-cesium 0.3.6 → 0.3.7
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-cesium.es5.js +1018 -559
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +1015 -556
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +30 -30
- package/dist/lib/rendering/entity-render-engine.js +848 -848
- package/dist/lib/rendering/entity-render-engine.js.map +1 -1
- package/dist/lib/rendering/menu-item-manager.js +252 -252
- package/dist/lib/rendering/render-addons/measure-addon.js +186 -186
- package/dist/lib/rendering/render-addons/render-addon.js +2 -2
- package/dist/lib/rendering/render-helper.js +296 -279
- package/dist/lib/rendering/render-helper.js.map +1 -1
- package/dist/lib/rendering/render-managers/common/shared-getters.js +31 -31
- package/dist/lib/rendering/render-managers/entities/entities-ids-render-manager.js +146 -146
- package/dist/lib/rendering/render-managers/entities/entities-ids-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/entities/entities-loaded-render-manager.js +143 -143
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js +234 -234
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/entities/entity-render-manager.js +139 -139
- package/dist/lib/rendering/render-managers/entities/entity-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/render-manager.js +50 -50
- package/dist/lib/rendering/render-managers/tilesets/tileset-cad-render-manager.js +236 -236
- package/dist/lib/rendering/render-managers/tilesets/tileset-cad-render-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/tilesets/tileset-osm-render-manager.js +320 -320
- package/dist/lib/rendering/render-managers/tilesets/tileset-osm-render-manager.js.map +1 -1
- package/dist/lib/rendering/tile-render-engine.js +822 -542
- package/dist/lib/rendering/tile-render-engine.js.map +1 -1
- package/dist/lib/rendering/tileset-render-engine.js +499 -499
- package/dist/lib/rendering/tileset-render-engine.js.map +1 -1
- package/dist/lib/rendering/view-render-engine.js +300 -138
- package/dist/lib/rendering/view-render-engine.js.map +1 -1
- package/dist/lib/rendering/visuals-register.js +394 -394
- package/dist/lib/utils/drawing-utils.js +42 -42
- package/dist/lib/utils/entity-utils.js +99 -99
- package/dist/lib/utils/measure-utils.js +34 -34
- package/dist/lib/utils/view-utils.js +34 -34
- package/dist/lib/utils/view-utils.js.map +1 -1
- package/dist/lib/viewer/cesium-view-monitor.js +231 -231
- package/dist/lib/viewer/viewer-utils.js +85 -85
- package/dist/types/rendering/render-helper.d.ts +1 -1
- package/dist/types/rendering/tile-render-engine.d.ts +60 -44
- package/dist/types/utils/view-utils.d.ts +1 -1
- package/package.json +76 -73
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DrawingUtils = void 0;
|
|
4
|
-
var Cesium = require("cesium");
|
|
5
|
-
var DrawingUtils;
|
|
6
|
-
(function (DrawingUtils) {
|
|
7
|
-
/**
|
|
8
|
-
* Returns the point across a polyline at a given distance.
|
|
9
|
-
* If the distance exceeds the length of the line, the point will be placed at the end of the line.
|
|
10
|
-
* @param viewer
|
|
11
|
-
* @param positions
|
|
12
|
-
* @param distance
|
|
13
|
-
* @returns
|
|
14
|
-
*/
|
|
15
|
-
function PointAcrossPolyline(viewer, positions, distance) {
|
|
16
|
-
if (positions.length > 1) {
|
|
17
|
-
var currentDistance = 0;
|
|
18
|
-
for (var i = 0; i < positions.length - 1; i++) {
|
|
19
|
-
var length_1 = Cesium.Cartesian3.distance(positions[i], positions[i + 1]);
|
|
20
|
-
if (length_1 + currentDistance >= distance) {
|
|
21
|
-
var carto1 = Cesium.Cartographic.fromCartesian(positions[i]);
|
|
22
|
-
var carto2 = Cesium.Cartographic.fromCartesian(positions[i + 1]);
|
|
23
|
-
var geodesic = new Cesium.EllipsoidGeodesic(carto1, carto2, viewer.scene.globe.ellipsoid);
|
|
24
|
-
var position = geodesic.interpolateUsingSurfaceDistance(distance - currentDistance);
|
|
25
|
-
var height = (carto1.height + carto2.height) / 2;
|
|
26
|
-
return Cesium.Cartesian3.fromRadians(position.longitude, position.latitude, height);
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
currentDistance += length_1;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
else if (positions.length > 0) {
|
|
34
|
-
return positions[0];
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
return null;
|
|
38
|
-
}
|
|
39
|
-
return positions[positions.length - 1];
|
|
40
|
-
}
|
|
41
|
-
DrawingUtils.PointAcrossPolyline = PointAcrossPolyline;
|
|
42
|
-
})(DrawingUtils = exports.DrawingUtils || (exports.DrawingUtils = {}));
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DrawingUtils = void 0;
|
|
4
|
+
var Cesium = require("cesium");
|
|
5
|
+
var DrawingUtils;
|
|
6
|
+
(function (DrawingUtils) {
|
|
7
|
+
/**
|
|
8
|
+
* Returns the point across a polyline at a given distance.
|
|
9
|
+
* If the distance exceeds the length of the line, the point will be placed at the end of the line.
|
|
10
|
+
* @param viewer
|
|
11
|
+
* @param positions
|
|
12
|
+
* @param distance
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
function PointAcrossPolyline(viewer, positions, distance) {
|
|
16
|
+
if (positions.length > 1) {
|
|
17
|
+
var currentDistance = 0;
|
|
18
|
+
for (var i = 0; i < positions.length - 1; i++) {
|
|
19
|
+
var length_1 = Cesium.Cartesian3.distance(positions[i], positions[i + 1]);
|
|
20
|
+
if (length_1 + currentDistance >= distance) {
|
|
21
|
+
var carto1 = Cesium.Cartographic.fromCartesian(positions[i]);
|
|
22
|
+
var carto2 = Cesium.Cartographic.fromCartesian(positions[i + 1]);
|
|
23
|
+
var geodesic = new Cesium.EllipsoidGeodesic(carto1, carto2, viewer.scene.globe.ellipsoid);
|
|
24
|
+
var position = geodesic.interpolateUsingSurfaceDistance(distance - currentDistance);
|
|
25
|
+
var height = (carto1.height + carto2.height) / 2;
|
|
26
|
+
return Cesium.Cartesian3.fromRadians(position.longitude, position.latitude, height);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
currentDistance += length_1;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
else if (positions.length > 0) {
|
|
34
|
+
return positions[0];
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
return positions[positions.length - 1];
|
|
40
|
+
}
|
|
41
|
+
DrawingUtils.PointAcrossPolyline = PointAcrossPolyline;
|
|
42
|
+
})(DrawingUtils = exports.DrawingUtils || (exports.DrawingUtils = {}));
|
|
43
43
|
//# sourceMappingURL=drawing-utils.js.map
|
|
@@ -1,100 +1,100 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EntityUtils = void 0;
|
|
4
|
-
var bruce_models_1 = require("bruce-models");
|
|
5
|
-
var Cesium = require("cesium");
|
|
6
|
-
var drawing_utils_1 = require("./drawing-utils");
|
|
7
|
-
var measure_utils_1 = require("./measure-utils");
|
|
8
|
-
function traverseEntity(cEntity, arr) {
|
|
9
|
-
if (cEntity._parentEntity) {
|
|
10
|
-
traverseEntity(cEntity._parentEntity, arr);
|
|
11
|
-
}
|
|
12
|
-
if (cEntity._siblingGraphics) {
|
|
13
|
-
for (var i = 0; i < cEntity._siblingGraphics.length; i++) {
|
|
14
|
-
var sibling = cEntity._siblingGraphics[i];
|
|
15
|
-
traverseEntity(sibling, arr);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
arr.push(cEntity);
|
|
19
|
-
}
|
|
20
|
-
var EntityUtils;
|
|
21
|
-
(function (EntityUtils) {
|
|
22
|
-
/**
|
|
23
|
-
* Returns an entity's position.
|
|
24
|
-
* This will attempt to calculate it from multiple sources of data.
|
|
25
|
-
* @param viewer
|
|
26
|
-
* @param entity
|
|
27
|
-
* @returns
|
|
28
|
-
*/
|
|
29
|
-
function GetPos(viewer, entity) {
|
|
30
|
-
if (entity.location && bruce_models_1.Carto.ValidateCarto(entity.location)) {
|
|
31
|
-
var location_1 = entity.location;
|
|
32
|
-
return Cesium.Cartesian3.fromDegrees(location_1.longitude, location_1.latitude, location_1.altitude);
|
|
33
|
-
}
|
|
34
|
-
if (entity.geometry && typeof entity.geometry == "object") {
|
|
35
|
-
var pointStr = entity.geometry.Point;
|
|
36
|
-
if (pointStr && typeof pointStr == "string") {
|
|
37
|
-
var points = bruce_models_1.Geometry.ParsePoints(pointStr);
|
|
38
|
-
var point = points.length > 0 ? points[0] : null;
|
|
39
|
-
if (point && bruce_models_1.Carto.ValidateCarto(point)) {
|
|
40
|
-
return Cesium.Cartesian3.fromDegrees(point.longitude, point.latitude, point.altitude);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
var lineStr = entity.geometry.LineString;
|
|
44
|
-
if (lineStr && typeof lineStr == "string") {
|
|
45
|
-
var points = bruce_models_1.Geometry.ParsePoints(lineStr);
|
|
46
|
-
if (points.length > 0) {
|
|
47
|
-
var posses = points.map(function (x) { return Cesium.Cartesian3.fromDegrees(x.longitude, x.latitude, x.altitude); });
|
|
48
|
-
var length_1 = measure_utils_1.MeasureUtils.MeasurePolyline(posses);
|
|
49
|
-
if (length_1 > 0) {
|
|
50
|
-
var point = drawing_utils_1.DrawingUtils.PointAcrossPolyline(viewer, posses, length_1 / 2);
|
|
51
|
-
if (point && bruce_models_1.Cartes.ValidateCartes3(point)) {
|
|
52
|
-
return point;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
return posses[0];
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
var pRings = entity.geometry.Polygon;
|
|
61
|
-
if (pRings && typeof pRings == "object") {
|
|
62
|
-
var boundary = pRings.find(function (x) { return x.Facing == bruce_models_1.Geometry.EPolygonRingType.Boundaries; });
|
|
63
|
-
if (boundary === null || boundary === void 0 ? void 0 : boundary.LinearRing) {
|
|
64
|
-
var points = bruce_models_1.Geometry.ParsePoints(boundary.LinearRing);
|
|
65
|
-
var point = bruce_models_1.Carto.GetCenter(points);
|
|
66
|
-
if (point && bruce_models_1.Carto.ValidateCarto(point)) {
|
|
67
|
-
return Cesium.Cartesian3.fromDegrees(point.longitude, point.latitude, point.altitude);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
if (entity.boundaries) {
|
|
73
|
-
var point = {
|
|
74
|
-
latitude: (entity.boundaries.minLatitude + entity.boundaries.maxLatitude) / 2,
|
|
75
|
-
longitude: (entity.boundaries.minLongitude + entity.boundaries.maxLongitude) / 2,
|
|
76
|
-
altitude: 0
|
|
77
|
-
};
|
|
78
|
-
if (point && bruce_models_1.Carto.ValidateCarto(point)) {
|
|
79
|
-
return Cesium.Cartesian3.fromDegrees(point.longitude, point.latitude, point.altitude);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
return null;
|
|
83
|
-
}
|
|
84
|
-
EntityUtils.GetPos = GetPos;
|
|
85
|
-
/**
|
|
86
|
-
* Returns entity and any associated parent/sibling entities as a flat array.
|
|
87
|
-
* @param entity
|
|
88
|
-
*/
|
|
89
|
-
function GatherEntity(entity) {
|
|
90
|
-
if (entity instanceof Cesium.Entity) {
|
|
91
|
-
var cEntity = entity;
|
|
92
|
-
var items = [];
|
|
93
|
-
traverseEntity(cEntity, items);
|
|
94
|
-
return items;
|
|
95
|
-
}
|
|
96
|
-
return [entity];
|
|
97
|
-
}
|
|
98
|
-
EntityUtils.GatherEntity = GatherEntity;
|
|
99
|
-
})(EntityUtils = exports.EntityUtils || (exports.EntityUtils = {}));
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EntityUtils = void 0;
|
|
4
|
+
var bruce_models_1 = require("bruce-models");
|
|
5
|
+
var Cesium = require("cesium");
|
|
6
|
+
var drawing_utils_1 = require("./drawing-utils");
|
|
7
|
+
var measure_utils_1 = require("./measure-utils");
|
|
8
|
+
function traverseEntity(cEntity, arr) {
|
|
9
|
+
if (cEntity._parentEntity) {
|
|
10
|
+
traverseEntity(cEntity._parentEntity, arr);
|
|
11
|
+
}
|
|
12
|
+
if (cEntity._siblingGraphics) {
|
|
13
|
+
for (var i = 0; i < cEntity._siblingGraphics.length; i++) {
|
|
14
|
+
var sibling = cEntity._siblingGraphics[i];
|
|
15
|
+
traverseEntity(sibling, arr);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
arr.push(cEntity);
|
|
19
|
+
}
|
|
20
|
+
var EntityUtils;
|
|
21
|
+
(function (EntityUtils) {
|
|
22
|
+
/**
|
|
23
|
+
* Returns an entity's position.
|
|
24
|
+
* This will attempt to calculate it from multiple sources of data.
|
|
25
|
+
* @param viewer
|
|
26
|
+
* @param entity
|
|
27
|
+
* @returns
|
|
28
|
+
*/
|
|
29
|
+
function GetPos(viewer, entity) {
|
|
30
|
+
if (entity.location && bruce_models_1.Carto.ValidateCarto(entity.location)) {
|
|
31
|
+
var location_1 = entity.location;
|
|
32
|
+
return Cesium.Cartesian3.fromDegrees(location_1.longitude, location_1.latitude, location_1.altitude);
|
|
33
|
+
}
|
|
34
|
+
if (entity.geometry && typeof entity.geometry == "object") {
|
|
35
|
+
var pointStr = entity.geometry.Point;
|
|
36
|
+
if (pointStr && typeof pointStr == "string") {
|
|
37
|
+
var points = bruce_models_1.Geometry.ParsePoints(pointStr);
|
|
38
|
+
var point = points.length > 0 ? points[0] : null;
|
|
39
|
+
if (point && bruce_models_1.Carto.ValidateCarto(point)) {
|
|
40
|
+
return Cesium.Cartesian3.fromDegrees(point.longitude, point.latitude, point.altitude);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
var lineStr = entity.geometry.LineString;
|
|
44
|
+
if (lineStr && typeof lineStr == "string") {
|
|
45
|
+
var points = bruce_models_1.Geometry.ParsePoints(lineStr);
|
|
46
|
+
if (points.length > 0) {
|
|
47
|
+
var posses = points.map(function (x) { return Cesium.Cartesian3.fromDegrees(x.longitude, x.latitude, x.altitude); });
|
|
48
|
+
var length_1 = measure_utils_1.MeasureUtils.MeasurePolyline(posses);
|
|
49
|
+
if (length_1 > 0) {
|
|
50
|
+
var point = drawing_utils_1.DrawingUtils.PointAcrossPolyline(viewer, posses, length_1 / 2);
|
|
51
|
+
if (point && bruce_models_1.Cartes.ValidateCartes3(point)) {
|
|
52
|
+
return point;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
return posses[0];
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
var pRings = entity.geometry.Polygon;
|
|
61
|
+
if (pRings && typeof pRings == "object") {
|
|
62
|
+
var boundary = pRings.find(function (x) { return x.Facing == bruce_models_1.Geometry.EPolygonRingType.Boundaries; });
|
|
63
|
+
if (boundary === null || boundary === void 0 ? void 0 : boundary.LinearRing) {
|
|
64
|
+
var points = bruce_models_1.Geometry.ParsePoints(boundary.LinearRing);
|
|
65
|
+
var point = bruce_models_1.Carto.GetCenter(points);
|
|
66
|
+
if (point && bruce_models_1.Carto.ValidateCarto(point)) {
|
|
67
|
+
return Cesium.Cartesian3.fromDegrees(point.longitude, point.latitude, point.altitude);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
if (entity.boundaries) {
|
|
73
|
+
var point = {
|
|
74
|
+
latitude: (entity.boundaries.minLatitude + entity.boundaries.maxLatitude) / 2,
|
|
75
|
+
longitude: (entity.boundaries.minLongitude + entity.boundaries.maxLongitude) / 2,
|
|
76
|
+
altitude: 0
|
|
77
|
+
};
|
|
78
|
+
if (point && bruce_models_1.Carto.ValidateCarto(point)) {
|
|
79
|
+
return Cesium.Cartesian3.fromDegrees(point.longitude, point.latitude, point.altitude);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
EntityUtils.GetPos = GetPos;
|
|
85
|
+
/**
|
|
86
|
+
* Returns entity and any associated parent/sibling entities as a flat array.
|
|
87
|
+
* @param entity
|
|
88
|
+
*/
|
|
89
|
+
function GatherEntity(entity) {
|
|
90
|
+
if (entity instanceof Cesium.Entity) {
|
|
91
|
+
var cEntity = entity;
|
|
92
|
+
var items = [];
|
|
93
|
+
traverseEntity(cEntity, items);
|
|
94
|
+
return items;
|
|
95
|
+
}
|
|
96
|
+
return [entity];
|
|
97
|
+
}
|
|
98
|
+
EntityUtils.GatherEntity = GatherEntity;
|
|
99
|
+
})(EntityUtils = exports.EntityUtils || (exports.EntityUtils = {}));
|
|
100
100
|
//# sourceMappingURL=entity-utils.js.map
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MeasureUtils = void 0;
|
|
4
|
-
var Cesium = require("cesium");
|
|
5
|
-
var MeasureUtils;
|
|
6
|
-
(function (MeasureUtils) {
|
|
7
|
-
/**
|
|
8
|
-
* Returns the total distance in meters between an array of points.
|
|
9
|
-
* This distance is NOT following the terrain.
|
|
10
|
-
* @param posses
|
|
11
|
-
* @returns
|
|
12
|
-
*/
|
|
13
|
-
function MeasurePolyline(posses) {
|
|
14
|
-
if (posses.length < 2) {
|
|
15
|
-
return 0;
|
|
16
|
-
}
|
|
17
|
-
var totalLength = 0;
|
|
18
|
-
var pos1 = null;
|
|
19
|
-
var pos2 = null;
|
|
20
|
-
for (var i = 0; i < posses.length; i++) {
|
|
21
|
-
if (pos1 == null) {
|
|
22
|
-
pos1 = posses[i];
|
|
23
|
-
}
|
|
24
|
-
else if (pos2 == null) {
|
|
25
|
-
pos2 = posses[i];
|
|
26
|
-
totalLength += Cesium.Cartesian3.distance(pos1, pos2);
|
|
27
|
-
pos1 = pos2;
|
|
28
|
-
pos2 = null;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return totalLength;
|
|
32
|
-
}
|
|
33
|
-
MeasureUtils.MeasurePolyline = MeasurePolyline;
|
|
34
|
-
})(MeasureUtils = exports.MeasureUtils || (exports.MeasureUtils = {}));
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MeasureUtils = void 0;
|
|
4
|
+
var Cesium = require("cesium");
|
|
5
|
+
var MeasureUtils;
|
|
6
|
+
(function (MeasureUtils) {
|
|
7
|
+
/**
|
|
8
|
+
* Returns the total distance in meters between an array of points.
|
|
9
|
+
* This distance is NOT following the terrain.
|
|
10
|
+
* @param posses
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
function MeasurePolyline(posses) {
|
|
14
|
+
if (posses.length < 2) {
|
|
15
|
+
return 0;
|
|
16
|
+
}
|
|
17
|
+
var totalLength = 0;
|
|
18
|
+
var pos1 = null;
|
|
19
|
+
var pos2 = null;
|
|
20
|
+
for (var i = 0; i < posses.length; i++) {
|
|
21
|
+
if (pos1 == null) {
|
|
22
|
+
pos1 = posses[i];
|
|
23
|
+
}
|
|
24
|
+
else if (pos2 == null) {
|
|
25
|
+
pos2 = posses[i];
|
|
26
|
+
totalLength += Cesium.Cartesian3.distance(pos1, pos2);
|
|
27
|
+
pos1 = pos2;
|
|
28
|
+
pos2 = null;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return totalLength;
|
|
32
|
+
}
|
|
33
|
+
MeasureUtils.MeasurePolyline = MeasurePolyline;
|
|
34
|
+
})(MeasureUtils = exports.MeasureUtils || (exports.MeasureUtils = {}));
|
|
35
35
|
//# sourceMappingURL=measure-utils.js.map
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ViewUtils = void 0;
|
|
4
|
-
var ViewUtils;
|
|
5
|
-
(function (ViewUtils) {
|
|
6
|
-
function GatherLegacyMapTiles(viewer) {
|
|
7
|
-
var collection = viewer.imageryLayers;
|
|
8
|
-
var tiles = [];
|
|
9
|
-
for (var i = 0; i < collection.length; i++) {
|
|
10
|
-
var layer = collection.get(i);
|
|
11
|
-
if (layer._bName) {
|
|
12
|
-
tiles.push({
|
|
13
|
-
alpha: layer.alpha,
|
|
14
|
-
brightness: layer.brightness,
|
|
15
|
-
contrast: layer.contrast,
|
|
16
|
-
hue: layer.hue,
|
|
17
|
-
saturation: layer.saturation,
|
|
18
|
-
gamma: layer.gamma,
|
|
19
|
-
title: layer._bName,
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return tiles.reverse();
|
|
24
|
-
}
|
|
25
|
-
ViewUtils.GatherLegacyMapTiles = GatherLegacyMapTiles;
|
|
26
|
-
function GatherLegacyTerrainTile(viewer) {
|
|
27
|
-
var enabled = viewer.terrainProvider;
|
|
28
|
-
if (enabled === null || enabled === void 0 ? void 0 : enabled._bName) {
|
|
29
|
-
return enabled._bName;
|
|
30
|
-
}
|
|
31
|
-
return "flatterrain";
|
|
32
|
-
}
|
|
33
|
-
ViewUtils.GatherLegacyTerrainTile = GatherLegacyTerrainTile;
|
|
34
|
-
})(ViewUtils = exports.ViewUtils || (exports.ViewUtils = {}));
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ViewUtils = void 0;
|
|
4
|
+
var ViewUtils;
|
|
5
|
+
(function (ViewUtils) {
|
|
6
|
+
function GatherLegacyMapTiles(viewer) {
|
|
7
|
+
var collection = viewer.imageryLayers;
|
|
8
|
+
var tiles = [];
|
|
9
|
+
for (var i = 0; i < collection.length; i++) {
|
|
10
|
+
var layer = collection.get(i);
|
|
11
|
+
if (layer._bName) {
|
|
12
|
+
tiles.push({
|
|
13
|
+
alpha: layer.alpha,
|
|
14
|
+
brightness: layer.brightness,
|
|
15
|
+
contrast: layer.contrast,
|
|
16
|
+
hue: layer.hue,
|
|
17
|
+
saturation: layer.saturation,
|
|
18
|
+
gamma: layer.gamma,
|
|
19
|
+
title: layer._bName,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return tiles.reverse();
|
|
24
|
+
}
|
|
25
|
+
ViewUtils.GatherLegacyMapTiles = GatherLegacyMapTiles;
|
|
26
|
+
function GatherLegacyTerrainTile(viewer) {
|
|
27
|
+
var enabled = viewer.terrainProvider;
|
|
28
|
+
if (enabled === null || enabled === void 0 ? void 0 : enabled._bName) {
|
|
29
|
+
return enabled._bName;
|
|
30
|
+
}
|
|
31
|
+
return "flatterrain";
|
|
32
|
+
}
|
|
33
|
+
ViewUtils.GatherLegacyTerrainTile = GatherLegacyTerrainTile;
|
|
34
|
+
})(ViewUtils = exports.ViewUtils || (exports.ViewUtils = {}));
|
|
35
35
|
//# sourceMappingURL=view-utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view-utils.js","sourceRoot":"","sources":["../../../src/utils/view-utils.ts"],"names":[],"mappings":";;;AAIA,IAAiB,SAAS,CA4BzB;AA5BD,WAAiB,SAAS;IACtB,SAAgB,oBAAoB,CAAC,MAAqB;QACtD,IAAM,UAAU,GAAG,MAAM,CAAC,aAAa,CAAC;QACxC,IAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"view-utils.js","sourceRoot":"","sources":["../../../src/utils/view-utils.ts"],"names":[],"mappings":";;;AAIA,IAAiB,SAAS,CA4BzB;AA5BD,WAAiB,SAAS;IACtB,SAAgB,oBAAoB,CAAC,MAAqB;QACtD,IAAM,UAAU,GAAG,MAAM,CAAC,aAAa,CAAC;QACxC,IAAM,KAAK,GAA8C,EAAE,CAAC;QAC5D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACxC,IAAM,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAsC,CAAC;YACrE,IAAI,KAAK,CAAC,MAAM,EAAE;gBACd,KAAK,CAAC,IAAI,CAAC;oBACP,KAAK,EAAE,KAAK,CAAC,KAAK;oBAClB,UAAU,EAAE,KAAK,CAAC,UAAU;oBAC5B,QAAQ,EAAE,KAAK,CAAC,QAAQ;oBACxB,GAAG,EAAE,KAAK,CAAC,GAAG;oBACd,UAAU,EAAE,KAAK,CAAC,UAAU;oBAC5B,KAAK,EAAE,KAAK,CAAC,KAAK;oBAClB,KAAK,EAAE,KAAK,CAAC,MAAM;iBACtB,CAAC,CAAC;aACN;SACJ;QACD,OAAO,KAAK,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAlBe,8BAAoB,uBAkBnC,CAAA;IAED,SAAgB,uBAAuB,CAAC,MAAqB;QACzD,IAAM,OAAO,GAAG,MAAM,CAAC,eAA2D,CAAC;QACnF,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EAAE;YACjB,OAAO,OAAO,CAAC,MAAM,CAAC;SACzB;QACD,OAAO,aAAa,CAAC;IACzB,CAAC;IANe,iCAAuB,0BAMtC,CAAA;AACL,CAAC,EA5BgB,SAAS,GAAT,iBAAS,KAAT,iBAAS,QA4BzB"}
|