bruce-cesium 1.1.6 → 1.1.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 +57 -2
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +56 -1
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/rendering/tileset-render-engine.js +56 -1
- package/dist/lib/rendering/tileset-render-engine.js.map +1 -1
- package/package.json +1 -1
package/dist/bruce-cesium.es5.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BruceEvent, Cartes, Carto, Geometry, ZoomControl, Style, EntityTag, Calculator, EntityLod, EntityType, ClientFile, DelayQueue, Entity as Entity$1, BatchedDataGetter, EntityRelationType, ObjectUtils, Tileset, EntityCoords, EntityFilterGetter, EntitySource, EntityRelation, MenuItem, ProjectView, ProjectViewBookmark, ProjectViewTile, ProjectViewLegacyTile, ProgramKey, Camera } from 'bruce-models';
|
|
2
|
-
import { Cartesian2, Cartographic, Math as Math$1,
|
|
2
|
+
import { Cartesian2, Cartographic, Math as Math$1, Color, HeightReference, Cartesian3, Entity, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, PolygonHierarchy, ShadowMode, PolylineGraphics, HeadingPitchRoll, Transforms, ColorBlendMode, Primitive, Cesium3DTileFeature, Cesium3DTileColorBlendMode, HeadingPitchRange, OrthographicFrustum, JulianDate, createWorldTerrain, EllipsoidTerrainProvider, CesiumTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, Matrix4, Cesium3DTileStyle, Cesium3DTileset, IonResource, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, ColorMaterialProperty, Rectangle, Matrix3, EasingFunction, GeometryInstance, CallbackProperty, createOsmBuildings, KmlDataSource } from 'cesium';
|
|
3
3
|
|
|
4
4
|
var TIME_LAG = 300;
|
|
5
5
|
var POSITION_CHECK_TIMER = 950;
|
|
@@ -3934,11 +3934,54 @@ var TilesetRenderEngine;
|
|
|
3934
3934
|
if (transform.scale <= 0) {
|
|
3935
3935
|
transform.scale = 0.000001;
|
|
3936
3936
|
}
|
|
3937
|
+
/**
|
|
3938
|
+
* Very cursed.
|
|
3939
|
+
*/
|
|
3937
3940
|
if (position.isLegacy) {
|
|
3938
3941
|
var legacy_1 = position.legacyProps;
|
|
3939
3942
|
if (legacy_1.usingBoundingBox == null) {
|
|
3940
3943
|
legacy_1.usingBoundingBox = true;
|
|
3941
3944
|
}
|
|
3945
|
+
var offsetPoint_1 = function (pos, distance, bearing) {
|
|
3946
|
+
// radius of earth
|
|
3947
|
+
var radius = 6371e3;
|
|
3948
|
+
var δ = distance / radius;
|
|
3949
|
+
var θ = Math$1.toRadians(bearing);
|
|
3950
|
+
var φ1 = Math$1.toRadians(pos.latitude);
|
|
3951
|
+
var λ1 = Math$1.toRadians(pos.longitude);
|
|
3952
|
+
var sinφ2 = Math.sin(φ1) * Math.cos(δ) + Math.cos(φ1) * Math.sin(δ) * Math.cos(θ);
|
|
3953
|
+
var φ2 = Math.asin(sinφ2);
|
|
3954
|
+
var y = Math.sin(θ) * Math.sin(δ) * Math.cos(φ1);
|
|
3955
|
+
var x = Math.cos(δ) - Math.sin(φ1) * sinφ2;
|
|
3956
|
+
var λ2 = λ1 + Math.atan2(y, x);
|
|
3957
|
+
var finalPos = new Cartographic(λ2, φ2, pos.height);
|
|
3958
|
+
finalPos.latitude = Math$1.toDegrees(finalPos.latitude);
|
|
3959
|
+
finalPos.longitude = Math$1.toDegrees(finalPos.longitude);
|
|
3960
|
+
return finalPos;
|
|
3961
|
+
};
|
|
3962
|
+
var getOffset = function (pos, n, e, alt) {
|
|
3963
|
+
if (n == 0 && e == 0 && alt == 0) {
|
|
3964
|
+
return new Cartesian3(0, 0, 0);
|
|
3965
|
+
}
|
|
3966
|
+
var carto = Cartographic.fromCartesian(pos);
|
|
3967
|
+
carto.latitude = Math$1.toDegrees(carto.latitude);
|
|
3968
|
+
carto.longitude = Math$1.toDegrees(carto.longitude);
|
|
3969
|
+
// North
|
|
3970
|
+
if (n != 0) {
|
|
3971
|
+
carto = offsetPoint_1(carto, Number(n), 0);
|
|
3972
|
+
}
|
|
3973
|
+
// East
|
|
3974
|
+
if (e != 0) {
|
|
3975
|
+
carto = offsetPoint_1(carto, Number(e), 90);
|
|
3976
|
+
}
|
|
3977
|
+
// Altitude
|
|
3978
|
+
carto.height += Number(alt);
|
|
3979
|
+
var finalOffset = Cartesian3.fromDegrees(carto.longitude, carto.latitude, carto.height);
|
|
3980
|
+
finalOffset.x -= pos.x;
|
|
3981
|
+
finalOffset.y -= pos.y;
|
|
3982
|
+
finalOffset.z -= pos.z;
|
|
3983
|
+
return finalOffset;
|
|
3984
|
+
};
|
|
3942
3985
|
var getCurPos3d = function () {
|
|
3943
3986
|
if (legacy_1.usingBoundingBox == false) {
|
|
3944
3987
|
return Matrix4.getTranslation(root.transform, new Cartesian3());
|
|
@@ -3954,6 +3997,12 @@ var TilesetRenderEngine;
|
|
|
3954
3997
|
if (!pos3d) {
|
|
3955
3998
|
pos3d = getCurPos3d();
|
|
3956
3999
|
}
|
|
4000
|
+
var offset = getOffset(pos3d, transform.x, transform.y, transform.z);
|
|
4001
|
+
if (Cartes.ValidateCartes3(offset)) {
|
|
4002
|
+
pos3d.x += offset.x;
|
|
4003
|
+
pos3d.y += offset.y;
|
|
4004
|
+
pos3d.z += offset.z;
|
|
4005
|
+
}
|
|
3957
4006
|
if (legacy_1.rotate) {
|
|
3958
4007
|
var hpr = HeadingPitchRoll.fromDegrees(EnsureNumber(transform.heading), EnsureNumber(transform.pitch), EnsureNumber(transform.roll), new HeadingPitchRoll());
|
|
3959
4008
|
root.transform = Transforms.headingPitchRollToFixedFrame(pos3d, hpr);
|
|
@@ -4098,6 +4147,7 @@ var TilesetRenderEngine;
|
|
|
4098
4147
|
switch (_a.label) {
|
|
4099
4148
|
case 0:
|
|
4100
4149
|
apiGetter = params.apiGetter, viewer = params.viewer, tileset = params.tileset, ionId = params.ionId;
|
|
4150
|
+
console.log("RENDER LEGACY", JSON.parse(JSON.stringify(params.tileset)));
|
|
4101
4151
|
settings = tileset === null || tileset === void 0 ? void 0 : tileset.Settings;
|
|
4102
4152
|
settings = __assign({}, settings);
|
|
4103
4153
|
visual = settings.visual;
|
|
@@ -4139,6 +4189,8 @@ var TilesetRenderEngine;
|
|
|
4139
4189
|
origin_1 = __assign({}, origin_1);
|
|
4140
4190
|
var etc_1 = settings_1.etc;
|
|
4141
4191
|
etc_1 = __assign({}, etc_1);
|
|
4192
|
+
var positionOffset = settings_1.positionOffset;
|
|
4193
|
+
positionOffset = __assign({}, positionOffset);
|
|
4142
4194
|
var rotation = settings_1.rotation;
|
|
4143
4195
|
ApplySettings({
|
|
4144
4196
|
cTileset: cTileset,
|
|
@@ -4156,7 +4208,10 @@ var TilesetRenderEngine;
|
|
|
4156
4208
|
heading: rotation.z,
|
|
4157
4209
|
pitch: rotation.x,
|
|
4158
4210
|
roll: rotation.y,
|
|
4159
|
-
scale: 1
|
|
4211
|
+
scale: 1,
|
|
4212
|
+
z: EnsureNumber(positionOffset === null || positionOffset === void 0 ? void 0 : positionOffset.altitude),
|
|
4213
|
+
x: EnsureNumber(positionOffset === null || positionOffset === void 0 ? void 0 : positionOffset.latitude),
|
|
4214
|
+
y: EnsureNumber(positionOffset === null || positionOffset === void 0 ? void 0 : positionOffset.longitude)
|
|
4160
4215
|
} : null,
|
|
4161
4216
|
location: (origin_1 === null || origin_1 === void 0 ? void 0 : origin_1.latitude) ? {
|
|
4162
4217
|
latitude: origin_1.latitude,
|