bruce-cesium 6.6.1 → 6.6.2
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 +253 -235
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +250 -232
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/rendering/getters/entity-filter-getter.js +20 -3
- package/dist/lib/rendering/getters/entity-filter-getter.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/package.json +1 -1
package/dist/bruce-cesium.umd.js
CHANGED
|
@@ -12816,235 +12816,6 @@
|
|
|
12816
12816
|
return [id, cell];
|
|
12817
12817
|
}
|
|
12818
12818
|
|
|
12819
|
-
const DEFAULT_GROUNDED_HEIGHT = 300;
|
|
12820
|
-
const MINIMUM_VIEW_AREA_SIZE_DEGREES = 0.01;
|
|
12821
|
-
const NET_STEP_PERCENT = 5;
|
|
12822
|
-
const BORDER_STEPS = 3;
|
|
12823
|
-
function isDefined(value) {
|
|
12824
|
-
return value !== null && value !== undefined;
|
|
12825
|
-
}
|
|
12826
|
-
function netScanViewForBoundaries(viewer, center) {
|
|
12827
|
-
let maxLong = -2 * Math.PI;
|
|
12828
|
-
let minLong = 2 * Math.PI;
|
|
12829
|
-
let maxLat = -2 * Math.PI;
|
|
12830
|
-
let minLat = 2 * Math.PI;
|
|
12831
|
-
let found = 0;
|
|
12832
|
-
const updateMinMax = (lon, lat) => {
|
|
12833
|
-
if (lon < -Math.PI || lon > Math.PI || lat < -Math.PI / 2 || lat > Math.PI / 2) {
|
|
12834
|
-
return;
|
|
12835
|
-
}
|
|
12836
|
-
maxLong = Math.max(maxLong, lon);
|
|
12837
|
-
maxLat = Math.max(maxLat, lat);
|
|
12838
|
-
minLong = Math.min(minLong, lon);
|
|
12839
|
-
minLat = Math.min(minLat, lat);
|
|
12840
|
-
};
|
|
12841
|
-
const updateMinMaxForPoint = (stepX, stepY) => {
|
|
12842
|
-
const x = Math.round((viewer.container.clientWidth / 100) * (stepX * NET_STEP_PERCENT));
|
|
12843
|
-
const y = Math.round((viewer.container.clientHeight / 100) * (stepY * NET_STEP_PERCENT));
|
|
12844
|
-
const winPos = new Cesium.Cartesian2(x, y);
|
|
12845
|
-
try {
|
|
12846
|
-
const intersection = getAdjustedGroundIntersectionOfCameraRay(viewer, winPos);
|
|
12847
|
-
if (intersection) {
|
|
12848
|
-
const point = Cesium.Cartographic.fromCartesian(intersection, viewer.scene.globe.ellipsoid);
|
|
12849
|
-
updateMinMax(point.longitude, point.latitude);
|
|
12850
|
-
found++;
|
|
12851
|
-
}
|
|
12852
|
-
}
|
|
12853
|
-
catch (e) {
|
|
12854
|
-
console.error(e);
|
|
12855
|
-
}
|
|
12856
|
-
};
|
|
12857
|
-
updateMinMaxForPoint(BORDER_STEPS, BORDER_STEPS);
|
|
12858
|
-
updateMinMaxForPoint((100 / NET_STEP_PERCENT) - BORDER_STEPS, BORDER_STEPS);
|
|
12859
|
-
updateMinMaxForPoint(BORDER_STEPS, (100 / NET_STEP_PERCENT) - BORDER_STEPS);
|
|
12860
|
-
updateMinMaxForPoint((100 / NET_STEP_PERCENT) - BORDER_STEPS, (100 / NET_STEP_PERCENT) - BORDER_STEPS);
|
|
12861
|
-
updateMinMaxForPoint(BORDER_STEPS * 2, BORDER_STEPS * 2);
|
|
12862
|
-
updateMinMaxForPoint((100 / NET_STEP_PERCENT) - BORDER_STEPS * 2, BORDER_STEPS * 2);
|
|
12863
|
-
updateMinMaxForPoint(BORDER_STEPS * 2, (100 / NET_STEP_PERCENT) - BORDER_STEPS * 2);
|
|
12864
|
-
updateMinMaxForPoint((100 / NET_STEP_PERCENT) - BORDER_STEPS * 2, (100 / NET_STEP_PERCENT) - BORDER_STEPS * 2);
|
|
12865
|
-
if (center && found <= 0) {
|
|
12866
|
-
updateMinMax(Cesium.Math.toRadians(center.longitude), Cesium.Math.toRadians(center.latitude));
|
|
12867
|
-
found += 1;
|
|
12868
|
-
const size = viewer.camera.positionCartographic.height;
|
|
12869
|
-
const pitch = viewer.camera.pitch;
|
|
12870
|
-
const distance = size / Math.tan(pitch);
|
|
12871
|
-
const p1 = offsetPoint({
|
|
12872
|
-
altitude: center.altitude,
|
|
12873
|
-
latitude: center.latitude,
|
|
12874
|
-
longitude: center.longitude
|
|
12875
|
-
}, distance, 45);
|
|
12876
|
-
const p2 = offsetPoint({
|
|
12877
|
-
altitude: center.altitude,
|
|
12878
|
-
latitude: center.latitude,
|
|
12879
|
-
longitude: center.longitude
|
|
12880
|
-
}, -distance, 45);
|
|
12881
|
-
if (isDefined(p1 === null || p1 === void 0 ? void 0 : p1.latitude) && isDefined(p1 === null || p1 === void 0 ? void 0 : p1.longitude)) {
|
|
12882
|
-
updateMinMax(Cesium.Math.toRadians(p1.longitude), Cesium.Math.toRadians(p1.latitude));
|
|
12883
|
-
}
|
|
12884
|
-
if (isDefined(p2 === null || p2 === void 0 ? void 0 : p2.latitude) && isDefined(p2 === null || p2 === void 0 ? void 0 : p2.longitude)) {
|
|
12885
|
-
updateMinMax(Cesium.Math.toRadians(p2.longitude), Cesium.Math.toRadians(p2.latitude));
|
|
12886
|
-
}
|
|
12887
|
-
}
|
|
12888
|
-
if (found > 0) {
|
|
12889
|
-
return {
|
|
12890
|
-
east: maxLong,
|
|
12891
|
-
west: minLong,
|
|
12892
|
-
north: maxLat,
|
|
12893
|
-
south: minLat
|
|
12894
|
-
};
|
|
12895
|
-
}
|
|
12896
|
-
return null;
|
|
12897
|
-
}
|
|
12898
|
-
function offsetPoint(point, distance, heading) {
|
|
12899
|
-
const radius = 6371e3;
|
|
12900
|
-
const delta = distance / radius;
|
|
12901
|
-
const theta = Cesium.Math.toRadians(heading);
|
|
12902
|
-
const phi1 = Cesium.Math.toRadians(point.latitude);
|
|
12903
|
-
const lambda1 = Cesium.Math.toRadians(point.longitude);
|
|
12904
|
-
const sinPhi2 = Math.sin(phi1) * Math.cos(delta) + Math.cos(phi1) * Math.sin(delta) * Math.cos(theta);
|
|
12905
|
-
const phi2 = Math.asin(sinPhi2);
|
|
12906
|
-
const y = Math.sin(theta) * Math.sin(delta) * Math.cos(phi1);
|
|
12907
|
-
const x = Math.cos(delta) - Math.sin(phi1) * sinPhi2;
|
|
12908
|
-
const lambda2 = lambda1 + Math.atan2(y, x);
|
|
12909
|
-
return {
|
|
12910
|
-
altitude: point.altitude,
|
|
12911
|
-
latitude: Cesium.Math.toDegrees(phi2),
|
|
12912
|
-
longitude: Cesium.Math.toDegrees(lambda2)
|
|
12913
|
-
};
|
|
12914
|
-
}
|
|
12915
|
-
function offsetPos3d(pos3d, distance, heading) {
|
|
12916
|
-
const carto = Cesium.Cartographic.fromCartesian(pos3d);
|
|
12917
|
-
const newCarto = offsetPoint({
|
|
12918
|
-
altitude: carto.height,
|
|
12919
|
-
latitude: Cesium.Math.toDegrees(carto.latitude),
|
|
12920
|
-
longitude: Cesium.Math.toDegrees(carto.longitude)
|
|
12921
|
-
}, distance, heading);
|
|
12922
|
-
return Cesium.Cartesian3.fromDegrees(newCarto.longitude, newCarto.latitude, newCarto.altitude);
|
|
12923
|
-
}
|
|
12924
|
-
function getAdjustedGroundIntersectionOfCameraRay(viewer, screenPos) {
|
|
12925
|
-
const ray = viewer.camera.getPickRay(screenPos);
|
|
12926
|
-
const intersection = ray ? viewer.scene.globe.pick(ray, viewer.scene) : null;
|
|
12927
|
-
return intersection || null;
|
|
12928
|
-
}
|
|
12929
|
-
function getGroundCenterOfCameraRay(viewer, screenPos) {
|
|
12930
|
-
var _a, _b;
|
|
12931
|
-
const ray = viewer.camera.getPickRay(screenPos);
|
|
12932
|
-
const intersection = ray ? viewer.scene.globe.pick(ray, viewer.scene) : null;
|
|
12933
|
-
if (intersection) {
|
|
12934
|
-
return intersection;
|
|
12935
|
-
}
|
|
12936
|
-
const cameraHeight = viewer.camera.positionCartographic.height;
|
|
12937
|
-
if (!isNaN(cameraHeight) && isDefined(cameraHeight) && ((_b = (_a = viewer.camera) === null || _a === void 0 ? void 0 : _a.position) === null || _b === void 0 ? void 0 : _b.clone)) {
|
|
12938
|
-
const cameraPos3d = viewer.camera.position.clone();
|
|
12939
|
-
const pitch = viewer.camera.pitch;
|
|
12940
|
-
const distance = cameraHeight / Math.tan(pitch);
|
|
12941
|
-
return offsetPos3d(cameraPos3d, -distance, Cesium.Math.toDegrees(viewer.camera.heading));
|
|
12942
|
-
}
|
|
12943
|
-
return null;
|
|
12944
|
-
}
|
|
12945
|
-
(function (ViewGroundArea) {
|
|
12946
|
-
function ToBboxPolygon(bounds) {
|
|
12947
|
-
return `${bounds.west},${bounds.south} ${bounds.west},${bounds.north} ${bounds.east},${bounds.north} ${bounds.east},${bounds.south}`;
|
|
12948
|
-
}
|
|
12949
|
-
ViewGroundArea.ToBboxPolygon = ToBboxPolygon;
|
|
12950
|
-
function NormalizeBounds(bounds, altitude) {
|
|
12951
|
-
if (!bounds ||
|
|
12952
|
-
!isDefined(bounds.east) ||
|
|
12953
|
-
!isDefined(bounds.west) ||
|
|
12954
|
-
!isDefined(bounds.north) ||
|
|
12955
|
-
!isDefined(bounds.south)) {
|
|
12956
|
-
return null;
|
|
12957
|
-
}
|
|
12958
|
-
const viewRect = { ...bounds };
|
|
12959
|
-
const centerLong = (viewRect.east + viewRect.west) / 2;
|
|
12960
|
-
const centerLat = (viewRect.north + viewRect.south) / 2;
|
|
12961
|
-
viewRect.east = Math.max(viewRect.east, centerLong + (MINIMUM_VIEW_AREA_SIZE_DEGREES / 2));
|
|
12962
|
-
viewRect.west = Math.min(viewRect.west, centerLong - (MINIMUM_VIEW_AREA_SIZE_DEGREES / 2));
|
|
12963
|
-
viewRect.south = Math.min(viewRect.south, centerLat - (MINIMUM_VIEW_AREA_SIZE_DEGREES / 2));
|
|
12964
|
-
viewRect.north = Math.max(viewRect.north, centerLat + (MINIMUM_VIEW_AREA_SIZE_DEGREES / 2));
|
|
12965
|
-
if (isDefined(altitude)) {
|
|
12966
|
-
viewRect.alt = altitude;
|
|
12967
|
-
}
|
|
12968
|
-
return viewRect;
|
|
12969
|
-
}
|
|
12970
|
-
ViewGroundArea.NormalizeBounds = NormalizeBounds;
|
|
12971
|
-
async function GetViewArea(viewer) {
|
|
12972
|
-
var _a, _b;
|
|
12973
|
-
if (!viewer || viewer.isDestroyed()) {
|
|
12974
|
-
return null;
|
|
12975
|
-
}
|
|
12976
|
-
if (!viewer.container || ((_a = viewer.container.style) === null || _a === void 0 ? void 0 : _a.display) == "none") {
|
|
12977
|
-
return null;
|
|
12978
|
-
}
|
|
12979
|
-
let viewRect = null;
|
|
12980
|
-
let center = null;
|
|
12981
|
-
const camera = viewer.camera;
|
|
12982
|
-
const terrData = await exports.DrawingUtils.GetTerrainHeight({
|
|
12983
|
-
pos3d: camera.position,
|
|
12984
|
-
viewer
|
|
12985
|
-
});
|
|
12986
|
-
const cameraPosition = viewer.camera.positionCartographic;
|
|
12987
|
-
const terrHeight = terrData.error ? cameraPosition.height + DEFAULT_GROUNDED_HEIGHT : terrData.height;
|
|
12988
|
-
if (terrHeight && ((cameraPosition.height - terrHeight) < DEFAULT_GROUNDED_HEIGHT)) {
|
|
12989
|
-
viewRect = {};
|
|
12990
|
-
const viewRectRad = netScanViewForBoundaries(viewer);
|
|
12991
|
-
if (viewRectRad &&
|
|
12992
|
-
isDefined(viewRectRad.east) &&
|
|
12993
|
-
isDefined(viewRectRad.west) &&
|
|
12994
|
-
isDefined(viewRectRad.north) &&
|
|
12995
|
-
isDefined(viewRectRad.south)) {
|
|
12996
|
-
viewRect.east = Cesium.Math.toDegrees(Math.max(viewRectRad.east, cameraPosition.longitude));
|
|
12997
|
-
viewRect.west = Cesium.Math.toDegrees(Math.min(viewRectRad.west, cameraPosition.longitude));
|
|
12998
|
-
viewRect.south = Cesium.Math.toDegrees(Math.min(viewRectRad.south, cameraPosition.latitude));
|
|
12999
|
-
viewRect.north = Cesium.Math.toDegrees(Math.max(viewRectRad.north, cameraPosition.latitude));
|
|
13000
|
-
}
|
|
13001
|
-
else {
|
|
13002
|
-
viewRect.east = Cesium.Math.toDegrees(cameraPosition.longitude);
|
|
13003
|
-
viewRect.west = Cesium.Math.toDegrees(cameraPosition.longitude);
|
|
13004
|
-
viewRect.south = Cesium.Math.toDegrees(cameraPosition.latitude);
|
|
13005
|
-
viewRect.north = Cesium.Math.toDegrees(cameraPosition.latitude);
|
|
13006
|
-
}
|
|
13007
|
-
center = {
|
|
13008
|
-
altitude: camera.positionCartographic.height,
|
|
13009
|
-
latitude: Cesium.Math.toDegrees(camera.positionCartographic.latitude),
|
|
13010
|
-
longitude: Cesium.Math.toDegrees(camera.positionCartographic.longitude)
|
|
13011
|
-
};
|
|
13012
|
-
}
|
|
13013
|
-
else {
|
|
13014
|
-
const windowPosition = new Cesium.Cartesian2(viewer.container.clientWidth / 2, viewer.container.clientHeight / 2);
|
|
13015
|
-
const intersection = getGroundCenterOfCameraRay(viewer, windowPosition);
|
|
13016
|
-
let point = null;
|
|
13017
|
-
if (intersection) {
|
|
13018
|
-
point = Cesium.Cartographic.fromCartesian(intersection, viewer.scene.globe.ellipsoid);
|
|
13019
|
-
}
|
|
13020
|
-
if (point) {
|
|
13021
|
-
center = {
|
|
13022
|
-
altitude: point.height,
|
|
13023
|
-
latitude: Cesium.Math.toDegrees(point.latitude),
|
|
13024
|
-
longitude: Cesium.Math.toDegrees(point.longitude)
|
|
13025
|
-
};
|
|
13026
|
-
const viewRectRad = netScanViewForBoundaries(viewer, center);
|
|
13027
|
-
if (viewRectRad) {
|
|
13028
|
-
viewRect = {};
|
|
13029
|
-
viewRect.east = Cesium.Math.toDegrees(viewRectRad.east);
|
|
13030
|
-
viewRect.west = Cesium.Math.toDegrees(viewRectRad.west);
|
|
13031
|
-
viewRect.south = Cesium.Math.toDegrees(viewRectRad.south);
|
|
13032
|
-
viewRect.north = Cesium.Math.toDegrees(viewRectRad.north);
|
|
13033
|
-
}
|
|
13034
|
-
}
|
|
13035
|
-
}
|
|
13036
|
-
viewRect = NormalizeBounds(viewRect, (_b = viewer.scene.camera.positionCartographic) === null || _b === void 0 ? void 0 : _b.height);
|
|
13037
|
-
if (center && viewRect) {
|
|
13038
|
-
return {
|
|
13039
|
-
bounds: viewRect,
|
|
13040
|
-
target: center
|
|
13041
|
-
};
|
|
13042
|
-
}
|
|
13043
|
-
return null;
|
|
13044
|
-
}
|
|
13045
|
-
ViewGroundArea.GetViewArea = GetViewArea;
|
|
13046
|
-
})(exports.ViewGroundArea || (exports.ViewGroundArea = {}));
|
|
13047
|
-
|
|
13048
12819
|
const MAX_AREA_IN_DEGREES$1 = 90;
|
|
13049
12820
|
const MAX_RETRY_ATTEMPTS = 1;
|
|
13050
12821
|
const RETRY_DELAY_INCREMENT = 500;
|
|
@@ -13064,6 +12835,23 @@
|
|
|
13064
12835
|
}, milliseconds);
|
|
13065
12836
|
});
|
|
13066
12837
|
}
|
|
12838
|
+
function createBoundsPolygonGeometry(bounds) {
|
|
12839
|
+
const ring = [
|
|
12840
|
+
`${bounds.west},${bounds.south}`,
|
|
12841
|
+
`${bounds.west},${bounds.north}`,
|
|
12842
|
+
`${bounds.east},${bounds.north}`,
|
|
12843
|
+
`${bounds.east},${bounds.south}`,
|
|
12844
|
+
`${bounds.west},${bounds.south}`
|
|
12845
|
+
].join(" ");
|
|
12846
|
+
return {
|
|
12847
|
+
Polygon: [
|
|
12848
|
+
{
|
|
12849
|
+
Facing: BModels.Geometry.EPolygonRingType.Boundaries,
|
|
12850
|
+
LinearRing: ring
|
|
12851
|
+
}
|
|
12852
|
+
]
|
|
12853
|
+
};
|
|
12854
|
+
}
|
|
13067
12855
|
/**
|
|
13068
12856
|
* This is a batched entity getter.
|
|
13069
12857
|
* It will scan for entity records in a view-area and emit them in batches.
|
|
@@ -13365,8 +13153,9 @@
|
|
|
13365
13153
|
LogicOperator: "AND",
|
|
13366
13154
|
AttributeValue: {
|
|
13367
13155
|
AttributePath: "Bruce/Boundaries",
|
|
13368
|
-
OperandA:
|
|
13369
|
-
Operator: "intersects"
|
|
13156
|
+
OperandA: createBoundsPolygonGeometry(bounds),
|
|
13157
|
+
Operator: "intersects",
|
|
13158
|
+
ValueOption: "CONST"
|
|
13370
13159
|
},
|
|
13371
13160
|
key: "attribute"
|
|
13372
13161
|
}
|
|
@@ -15599,6 +15388,235 @@
|
|
|
15599
15388
|
DataLabRenderManager.Manager = Manager;
|
|
15600
15389
|
})(exports.DataLabRenderManager || (exports.DataLabRenderManager = {}));
|
|
15601
15390
|
|
|
15391
|
+
const DEFAULT_GROUNDED_HEIGHT = 300;
|
|
15392
|
+
const MINIMUM_VIEW_AREA_SIZE_DEGREES = 0.01;
|
|
15393
|
+
const NET_STEP_PERCENT = 5;
|
|
15394
|
+
const BORDER_STEPS = 3;
|
|
15395
|
+
function isDefined(value) {
|
|
15396
|
+
return value !== null && value !== undefined;
|
|
15397
|
+
}
|
|
15398
|
+
function netScanViewForBoundaries(viewer, center) {
|
|
15399
|
+
let maxLong = -2 * Math.PI;
|
|
15400
|
+
let minLong = 2 * Math.PI;
|
|
15401
|
+
let maxLat = -2 * Math.PI;
|
|
15402
|
+
let minLat = 2 * Math.PI;
|
|
15403
|
+
let found = 0;
|
|
15404
|
+
const updateMinMax = (lon, lat) => {
|
|
15405
|
+
if (lon < -Math.PI || lon > Math.PI || lat < -Math.PI / 2 || lat > Math.PI / 2) {
|
|
15406
|
+
return;
|
|
15407
|
+
}
|
|
15408
|
+
maxLong = Math.max(maxLong, lon);
|
|
15409
|
+
maxLat = Math.max(maxLat, lat);
|
|
15410
|
+
minLong = Math.min(minLong, lon);
|
|
15411
|
+
minLat = Math.min(minLat, lat);
|
|
15412
|
+
};
|
|
15413
|
+
const updateMinMaxForPoint = (stepX, stepY) => {
|
|
15414
|
+
const x = Math.round((viewer.container.clientWidth / 100) * (stepX * NET_STEP_PERCENT));
|
|
15415
|
+
const y = Math.round((viewer.container.clientHeight / 100) * (stepY * NET_STEP_PERCENT));
|
|
15416
|
+
const winPos = new Cesium.Cartesian2(x, y);
|
|
15417
|
+
try {
|
|
15418
|
+
const intersection = getAdjustedGroundIntersectionOfCameraRay(viewer, winPos);
|
|
15419
|
+
if (intersection) {
|
|
15420
|
+
const point = Cesium.Cartographic.fromCartesian(intersection, viewer.scene.globe.ellipsoid);
|
|
15421
|
+
updateMinMax(point.longitude, point.latitude);
|
|
15422
|
+
found++;
|
|
15423
|
+
}
|
|
15424
|
+
}
|
|
15425
|
+
catch (e) {
|
|
15426
|
+
console.error(e);
|
|
15427
|
+
}
|
|
15428
|
+
};
|
|
15429
|
+
updateMinMaxForPoint(BORDER_STEPS, BORDER_STEPS);
|
|
15430
|
+
updateMinMaxForPoint((100 / NET_STEP_PERCENT) - BORDER_STEPS, BORDER_STEPS);
|
|
15431
|
+
updateMinMaxForPoint(BORDER_STEPS, (100 / NET_STEP_PERCENT) - BORDER_STEPS);
|
|
15432
|
+
updateMinMaxForPoint((100 / NET_STEP_PERCENT) - BORDER_STEPS, (100 / NET_STEP_PERCENT) - BORDER_STEPS);
|
|
15433
|
+
updateMinMaxForPoint(BORDER_STEPS * 2, BORDER_STEPS * 2);
|
|
15434
|
+
updateMinMaxForPoint((100 / NET_STEP_PERCENT) - BORDER_STEPS * 2, BORDER_STEPS * 2);
|
|
15435
|
+
updateMinMaxForPoint(BORDER_STEPS * 2, (100 / NET_STEP_PERCENT) - BORDER_STEPS * 2);
|
|
15436
|
+
updateMinMaxForPoint((100 / NET_STEP_PERCENT) - BORDER_STEPS * 2, (100 / NET_STEP_PERCENT) - BORDER_STEPS * 2);
|
|
15437
|
+
if (center && found <= 0) {
|
|
15438
|
+
updateMinMax(Cesium.Math.toRadians(center.longitude), Cesium.Math.toRadians(center.latitude));
|
|
15439
|
+
found += 1;
|
|
15440
|
+
const size = viewer.camera.positionCartographic.height;
|
|
15441
|
+
const pitch = viewer.camera.pitch;
|
|
15442
|
+
const distance = size / Math.tan(pitch);
|
|
15443
|
+
const p1 = offsetPoint({
|
|
15444
|
+
altitude: center.altitude,
|
|
15445
|
+
latitude: center.latitude,
|
|
15446
|
+
longitude: center.longitude
|
|
15447
|
+
}, distance, 45);
|
|
15448
|
+
const p2 = offsetPoint({
|
|
15449
|
+
altitude: center.altitude,
|
|
15450
|
+
latitude: center.latitude,
|
|
15451
|
+
longitude: center.longitude
|
|
15452
|
+
}, -distance, 45);
|
|
15453
|
+
if (isDefined(p1 === null || p1 === void 0 ? void 0 : p1.latitude) && isDefined(p1 === null || p1 === void 0 ? void 0 : p1.longitude)) {
|
|
15454
|
+
updateMinMax(Cesium.Math.toRadians(p1.longitude), Cesium.Math.toRadians(p1.latitude));
|
|
15455
|
+
}
|
|
15456
|
+
if (isDefined(p2 === null || p2 === void 0 ? void 0 : p2.latitude) && isDefined(p2 === null || p2 === void 0 ? void 0 : p2.longitude)) {
|
|
15457
|
+
updateMinMax(Cesium.Math.toRadians(p2.longitude), Cesium.Math.toRadians(p2.latitude));
|
|
15458
|
+
}
|
|
15459
|
+
}
|
|
15460
|
+
if (found > 0) {
|
|
15461
|
+
return {
|
|
15462
|
+
east: maxLong,
|
|
15463
|
+
west: minLong,
|
|
15464
|
+
north: maxLat,
|
|
15465
|
+
south: minLat
|
|
15466
|
+
};
|
|
15467
|
+
}
|
|
15468
|
+
return null;
|
|
15469
|
+
}
|
|
15470
|
+
function offsetPoint(point, distance, heading) {
|
|
15471
|
+
const radius = 6371e3;
|
|
15472
|
+
const delta = distance / radius;
|
|
15473
|
+
const theta = Cesium.Math.toRadians(heading);
|
|
15474
|
+
const phi1 = Cesium.Math.toRadians(point.latitude);
|
|
15475
|
+
const lambda1 = Cesium.Math.toRadians(point.longitude);
|
|
15476
|
+
const sinPhi2 = Math.sin(phi1) * Math.cos(delta) + Math.cos(phi1) * Math.sin(delta) * Math.cos(theta);
|
|
15477
|
+
const phi2 = Math.asin(sinPhi2);
|
|
15478
|
+
const y = Math.sin(theta) * Math.sin(delta) * Math.cos(phi1);
|
|
15479
|
+
const x = Math.cos(delta) - Math.sin(phi1) * sinPhi2;
|
|
15480
|
+
const lambda2 = lambda1 + Math.atan2(y, x);
|
|
15481
|
+
return {
|
|
15482
|
+
altitude: point.altitude,
|
|
15483
|
+
latitude: Cesium.Math.toDegrees(phi2),
|
|
15484
|
+
longitude: Cesium.Math.toDegrees(lambda2)
|
|
15485
|
+
};
|
|
15486
|
+
}
|
|
15487
|
+
function offsetPos3d(pos3d, distance, heading) {
|
|
15488
|
+
const carto = Cesium.Cartographic.fromCartesian(pos3d);
|
|
15489
|
+
const newCarto = offsetPoint({
|
|
15490
|
+
altitude: carto.height,
|
|
15491
|
+
latitude: Cesium.Math.toDegrees(carto.latitude),
|
|
15492
|
+
longitude: Cesium.Math.toDegrees(carto.longitude)
|
|
15493
|
+
}, distance, heading);
|
|
15494
|
+
return Cesium.Cartesian3.fromDegrees(newCarto.longitude, newCarto.latitude, newCarto.altitude);
|
|
15495
|
+
}
|
|
15496
|
+
function getAdjustedGroundIntersectionOfCameraRay(viewer, screenPos) {
|
|
15497
|
+
const ray = viewer.camera.getPickRay(screenPos);
|
|
15498
|
+
const intersection = ray ? viewer.scene.globe.pick(ray, viewer.scene) : null;
|
|
15499
|
+
return intersection || null;
|
|
15500
|
+
}
|
|
15501
|
+
function getGroundCenterOfCameraRay(viewer, screenPos) {
|
|
15502
|
+
var _a, _b;
|
|
15503
|
+
const ray = viewer.camera.getPickRay(screenPos);
|
|
15504
|
+
const intersection = ray ? viewer.scene.globe.pick(ray, viewer.scene) : null;
|
|
15505
|
+
if (intersection) {
|
|
15506
|
+
return intersection;
|
|
15507
|
+
}
|
|
15508
|
+
const cameraHeight = viewer.camera.positionCartographic.height;
|
|
15509
|
+
if (!isNaN(cameraHeight) && isDefined(cameraHeight) && ((_b = (_a = viewer.camera) === null || _a === void 0 ? void 0 : _a.position) === null || _b === void 0 ? void 0 : _b.clone)) {
|
|
15510
|
+
const cameraPos3d = viewer.camera.position.clone();
|
|
15511
|
+
const pitch = viewer.camera.pitch;
|
|
15512
|
+
const distance = cameraHeight / Math.tan(pitch);
|
|
15513
|
+
return offsetPos3d(cameraPos3d, -distance, Cesium.Math.toDegrees(viewer.camera.heading));
|
|
15514
|
+
}
|
|
15515
|
+
return null;
|
|
15516
|
+
}
|
|
15517
|
+
(function (ViewGroundArea) {
|
|
15518
|
+
function ToBboxPolygon(bounds) {
|
|
15519
|
+
return `${bounds.west},${bounds.south} ${bounds.west},${bounds.north} ${bounds.east},${bounds.north} ${bounds.east},${bounds.south}`;
|
|
15520
|
+
}
|
|
15521
|
+
ViewGroundArea.ToBboxPolygon = ToBboxPolygon;
|
|
15522
|
+
function NormalizeBounds(bounds, altitude) {
|
|
15523
|
+
if (!bounds ||
|
|
15524
|
+
!isDefined(bounds.east) ||
|
|
15525
|
+
!isDefined(bounds.west) ||
|
|
15526
|
+
!isDefined(bounds.north) ||
|
|
15527
|
+
!isDefined(bounds.south)) {
|
|
15528
|
+
return null;
|
|
15529
|
+
}
|
|
15530
|
+
const viewRect = { ...bounds };
|
|
15531
|
+
const centerLong = (viewRect.east + viewRect.west) / 2;
|
|
15532
|
+
const centerLat = (viewRect.north + viewRect.south) / 2;
|
|
15533
|
+
viewRect.east = Math.max(viewRect.east, centerLong + (MINIMUM_VIEW_AREA_SIZE_DEGREES / 2));
|
|
15534
|
+
viewRect.west = Math.min(viewRect.west, centerLong - (MINIMUM_VIEW_AREA_SIZE_DEGREES / 2));
|
|
15535
|
+
viewRect.south = Math.min(viewRect.south, centerLat - (MINIMUM_VIEW_AREA_SIZE_DEGREES / 2));
|
|
15536
|
+
viewRect.north = Math.max(viewRect.north, centerLat + (MINIMUM_VIEW_AREA_SIZE_DEGREES / 2));
|
|
15537
|
+
if (isDefined(altitude)) {
|
|
15538
|
+
viewRect.alt = altitude;
|
|
15539
|
+
}
|
|
15540
|
+
return viewRect;
|
|
15541
|
+
}
|
|
15542
|
+
ViewGroundArea.NormalizeBounds = NormalizeBounds;
|
|
15543
|
+
async function GetViewArea(viewer) {
|
|
15544
|
+
var _a, _b;
|
|
15545
|
+
if (!viewer || viewer.isDestroyed()) {
|
|
15546
|
+
return null;
|
|
15547
|
+
}
|
|
15548
|
+
if (!viewer.container || ((_a = viewer.container.style) === null || _a === void 0 ? void 0 : _a.display) == "none") {
|
|
15549
|
+
return null;
|
|
15550
|
+
}
|
|
15551
|
+
let viewRect = null;
|
|
15552
|
+
let center = null;
|
|
15553
|
+
const camera = viewer.camera;
|
|
15554
|
+
const terrData = await exports.DrawingUtils.GetTerrainHeight({
|
|
15555
|
+
pos3d: camera.position,
|
|
15556
|
+
viewer
|
|
15557
|
+
});
|
|
15558
|
+
const cameraPosition = viewer.camera.positionCartographic;
|
|
15559
|
+
const terrHeight = terrData.error ? cameraPosition.height + DEFAULT_GROUNDED_HEIGHT : terrData.height;
|
|
15560
|
+
if (terrHeight && ((cameraPosition.height - terrHeight) < DEFAULT_GROUNDED_HEIGHT)) {
|
|
15561
|
+
viewRect = {};
|
|
15562
|
+
const viewRectRad = netScanViewForBoundaries(viewer);
|
|
15563
|
+
if (viewRectRad &&
|
|
15564
|
+
isDefined(viewRectRad.east) &&
|
|
15565
|
+
isDefined(viewRectRad.west) &&
|
|
15566
|
+
isDefined(viewRectRad.north) &&
|
|
15567
|
+
isDefined(viewRectRad.south)) {
|
|
15568
|
+
viewRect.east = Cesium.Math.toDegrees(Math.max(viewRectRad.east, cameraPosition.longitude));
|
|
15569
|
+
viewRect.west = Cesium.Math.toDegrees(Math.min(viewRectRad.west, cameraPosition.longitude));
|
|
15570
|
+
viewRect.south = Cesium.Math.toDegrees(Math.min(viewRectRad.south, cameraPosition.latitude));
|
|
15571
|
+
viewRect.north = Cesium.Math.toDegrees(Math.max(viewRectRad.north, cameraPosition.latitude));
|
|
15572
|
+
}
|
|
15573
|
+
else {
|
|
15574
|
+
viewRect.east = Cesium.Math.toDegrees(cameraPosition.longitude);
|
|
15575
|
+
viewRect.west = Cesium.Math.toDegrees(cameraPosition.longitude);
|
|
15576
|
+
viewRect.south = Cesium.Math.toDegrees(cameraPosition.latitude);
|
|
15577
|
+
viewRect.north = Cesium.Math.toDegrees(cameraPosition.latitude);
|
|
15578
|
+
}
|
|
15579
|
+
center = {
|
|
15580
|
+
altitude: camera.positionCartographic.height,
|
|
15581
|
+
latitude: Cesium.Math.toDegrees(camera.positionCartographic.latitude),
|
|
15582
|
+
longitude: Cesium.Math.toDegrees(camera.positionCartographic.longitude)
|
|
15583
|
+
};
|
|
15584
|
+
}
|
|
15585
|
+
else {
|
|
15586
|
+
const windowPosition = new Cesium.Cartesian2(viewer.container.clientWidth / 2, viewer.container.clientHeight / 2);
|
|
15587
|
+
const intersection = getGroundCenterOfCameraRay(viewer, windowPosition);
|
|
15588
|
+
let point = null;
|
|
15589
|
+
if (intersection) {
|
|
15590
|
+
point = Cesium.Cartographic.fromCartesian(intersection, viewer.scene.globe.ellipsoid);
|
|
15591
|
+
}
|
|
15592
|
+
if (point) {
|
|
15593
|
+
center = {
|
|
15594
|
+
altitude: point.height,
|
|
15595
|
+
latitude: Cesium.Math.toDegrees(point.latitude),
|
|
15596
|
+
longitude: Cesium.Math.toDegrees(point.longitude)
|
|
15597
|
+
};
|
|
15598
|
+
const viewRectRad = netScanViewForBoundaries(viewer, center);
|
|
15599
|
+
if (viewRectRad) {
|
|
15600
|
+
viewRect = {};
|
|
15601
|
+
viewRect.east = Cesium.Math.toDegrees(viewRectRad.east);
|
|
15602
|
+
viewRect.west = Cesium.Math.toDegrees(viewRectRad.west);
|
|
15603
|
+
viewRect.south = Cesium.Math.toDegrees(viewRectRad.south);
|
|
15604
|
+
viewRect.north = Cesium.Math.toDegrees(viewRectRad.north);
|
|
15605
|
+
}
|
|
15606
|
+
}
|
|
15607
|
+
}
|
|
15608
|
+
viewRect = NormalizeBounds(viewRect, (_b = viewer.scene.camera.positionCartographic) === null || _b === void 0 ? void 0 : _b.height);
|
|
15609
|
+
if (center && viewRect) {
|
|
15610
|
+
return {
|
|
15611
|
+
bounds: viewRect,
|
|
15612
|
+
target: center
|
|
15613
|
+
};
|
|
15614
|
+
}
|
|
15615
|
+
return null;
|
|
15616
|
+
}
|
|
15617
|
+
ViewGroundArea.GetViewArea = GetViewArea;
|
|
15618
|
+
})(exports.ViewGroundArea || (exports.ViewGroundArea = {}));
|
|
15619
|
+
|
|
15602
15620
|
const TIME_LAG = 300;
|
|
15603
15621
|
const POSITION_CHECK_TIMER = 950;
|
|
15604
15622
|
var ESearchStatus;
|
|
@@ -35839,7 +35857,7 @@
|
|
|
35839
35857
|
}
|
|
35840
35858
|
}
|
|
35841
35859
|
|
|
35842
|
-
const VERSION = "6.6.
|
|
35860
|
+
const VERSION = "6.6.2";
|
|
35843
35861
|
/**
|
|
35844
35862
|
* Updates the environment instance used by bruce-cesium to one specified.
|
|
35845
35863
|
* This can be used to ensure that the instance a parent is referencing is shared between bruce-cesium, bruce-models, and the parent app.
|