bruce-cesium 5.0.6 → 5.0.8
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 +47 -43
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +46 -42
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/utils/drawing-utils.js +13 -7
- package/dist/lib/utils/drawing-utils.js.map +1 -1
- package/dist/lib/widgets/common/walkthrough.js +21 -16
- package/dist/lib/widgets/common/walkthrough.js.map +1 -1
- package/dist/lib/widgets/widget-cursorbar.js +25 -16
- package/dist/lib/widgets/widget-cursorbar.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/utils/drawing-utils.d.ts +1 -1
- package/package.json +1 -1
package/dist/bruce-cesium.es5.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BruceEvent, Cartes, Entity as Entity$1, Carto, Geometry, MathUtils, LRUCache, Api, Calculator, ClientFile, EntityTag, EntityType, ObjectUtils, Style, ProjectViewTile, DelayQueue, EntityLod, Bounds, ZoomControl, EntityRelationType, ENVIRONMENT, EntityHistoricData, Tileset, EntityCoords, DataLab, EntitySource, MenuItem, EntityRelation, ProgramKey, ProjectView, ProjectViewBookmark, Camera, ProjectViewLegacyTile, EntityAttachment, EntityAttachmentType, EntityAttribute, AbstractApi, Session } from 'bruce-models';
|
|
2
2
|
import * as Cesium from 'cesium';
|
|
3
|
-
import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, Entity, DistanceDisplayCondition, HorizontalOrigin, VerticalOrigin, ConstantProperty, ClassificationType, ConstantPositionProperty,
|
|
3
|
+
import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, Entity, DistanceDisplayCondition, HorizontalOrigin, VerticalOrigin, ConstantProperty, ClassificationType, ConstantPositionProperty, PolygonHierarchy, ShadowMode, PolylineGraphics, ArcType, CornerType, ColorMaterialProperty, ColorBlendMode, HeadingPitchRoll, Transforms, Model, SceneMode, Primitive, Cesium3DTileFeature, GeoJsonDataSource, Cesium3DTileColorBlendMode, HeadingPitchRange, Cesium3DTileStyle, Ion, KmlDataSource, SceneTransforms, OrthographicFrustum, EasingFunction, NearFarScalar, EllipsoidTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, IonImageryProvider, CesiumTerrainProvider, Cesium3DTileset, Matrix4, Matrix3, IonResource, CesiumInspector, defined, ClockRange, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, BoundingSphere, GeometryInstance, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, Quaternion, ScreenSpaceEventHandler, ScreenSpaceEventType, CzmlDataSource, Intersect, Fullscreen } from 'cesium';
|
|
4
4
|
|
|
5
5
|
const TIME_LAG = 300;
|
|
6
6
|
const POSITION_CHECK_TIMER = 950;
|
|
@@ -645,7 +645,7 @@ var DrawingUtils;
|
|
|
645
645
|
let cacheTimestamp = null;
|
|
646
646
|
let cachedCameraState = null;
|
|
647
647
|
let cachedPickOnlyState = null;
|
|
648
|
-
return (viewer, cursor, pickOnly = false) => {
|
|
648
|
+
return (viewer, cursor, pickOnly = false, ignoredPickOnly) => {
|
|
649
649
|
const scene = viewer.scene;
|
|
650
650
|
const camera = scene.camera;
|
|
651
651
|
// Check if we can use cached position.
|
|
@@ -686,12 +686,18 @@ var DrawingUtils;
|
|
|
686
686
|
pos3d = null;
|
|
687
687
|
const ray = scene.camera.getPickRay(cursor);
|
|
688
688
|
if (scene.pickPositionSupported) {
|
|
689
|
-
const
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
689
|
+
const pickedObjects = scene.drillPick(cursor, !(ignoredPickOnly === null || ignoredPickOnly === void 0 ? void 0 : ignoredPickOnly.length) ? 1 : ignoredPickOnly.length + 1, 3, 3);
|
|
690
|
+
for (let i = 0; i < pickedObjects.length; i++) {
|
|
691
|
+
let object = pickedObjects[i];
|
|
692
|
+
object = (object && object.id && object.id instanceof Entity ? object.id : object);
|
|
693
|
+
if (object &&
|
|
694
|
+
(!ignoredPickOnly || !ignoredPickOnly.includes(object)) &&
|
|
695
|
+
(object instanceof Cesium3DTileFeature ||
|
|
696
|
+
object instanceof Cesium3DTileset ||
|
|
697
|
+
(object instanceof Entity && object.model))) {
|
|
698
|
+
pos3d = scene.pickPosition(cursor);
|
|
699
|
+
break;
|
|
700
|
+
}
|
|
695
701
|
}
|
|
696
702
|
}
|
|
697
703
|
if (!pickOnly && !defined(pos3d)) {
|
|
@@ -26161,19 +26167,28 @@ var Walkthrough;
|
|
|
26161
26167
|
});
|
|
26162
26168
|
let lastCheck;
|
|
26163
26169
|
let currentTime = new Date();
|
|
26164
|
-
|
|
26170
|
+
const interval = setInterval(() => {
|
|
26165
26171
|
lastCheck = new Date();
|
|
26166
|
-
if (lastCheck.getTime() - currentTime.getTime()
|
|
26172
|
+
if (lastCheck.getTime() - currentTime.getTime() >= (1000 / 60)) {
|
|
26167
26173
|
doMovementTick(viewer);
|
|
26168
26174
|
currentTime = new Date();
|
|
26169
26175
|
}
|
|
26170
|
-
});
|
|
26171
|
-
|
|
26176
|
+
}, 1000 / 60);
|
|
26177
|
+
data.tickRemoval = () => {
|
|
26178
|
+
clearInterval(interval);
|
|
26179
|
+
};
|
|
26180
|
+
let keyDown = (e) => {
|
|
26172
26181
|
checkKeybind(viewer, e.key, true);
|
|
26173
|
-
}
|
|
26174
|
-
document.addEventListener("
|
|
26182
|
+
};
|
|
26183
|
+
document.addEventListener("keydown", keyDown, false);
|
|
26184
|
+
let keyUp = (e) => {
|
|
26175
26185
|
checkKeybind(viewer, e.key, false);
|
|
26176
|
-
}
|
|
26186
|
+
};
|
|
26187
|
+
document.addEventListener("keyup", keyUp, false);
|
|
26188
|
+
data.handlerKeysRemoval = () => {
|
|
26189
|
+
document.removeEventListener("keydown", keyDown);
|
|
26190
|
+
document.removeEventListener("keyup", keyUp);
|
|
26191
|
+
};
|
|
26177
26192
|
data.handlerScreenSpace.setInputAction((e) => {
|
|
26178
26193
|
data.actions.set(EAction.Looking, true);
|
|
26179
26194
|
data.mousePosCurrent = data.mousePosStart = Cartesian2.clone(e.position);
|
|
@@ -26195,17 +26210,13 @@ var Walkthrough;
|
|
|
26195
26210
|
status: false
|
|
26196
26211
|
});
|
|
26197
26212
|
if (data) {
|
|
26198
|
-
(_a = data.
|
|
26199
|
-
data.
|
|
26213
|
+
(_a = data.handlerScreenSpace) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
26214
|
+
data.handlerScreenSpace = null;
|
|
26200
26215
|
(_b = data.tickRemoval) === null || _b === void 0 ? void 0 : _b.call(data);
|
|
26201
26216
|
data.tickRemoval = null;
|
|
26202
|
-
if (data.
|
|
26203
|
-
|
|
26204
|
-
data.
|
|
26205
|
-
}
|
|
26206
|
-
if (data.keyUpHandler) {
|
|
26207
|
-
document.removeEventListener("keyup", data.keyUpHandler);
|
|
26208
|
-
data.keyUpHandler = null;
|
|
26217
|
+
if (data.handlerKeysRemoval) {
|
|
26218
|
+
data.handlerKeysRemoval();
|
|
26219
|
+
data.handlerKeysRemoval = null;
|
|
26209
26220
|
}
|
|
26210
26221
|
}
|
|
26211
26222
|
}
|
|
@@ -26880,6 +26891,10 @@ class WidgetCursorBar extends Widget.AWidget {
|
|
|
26880
26891
|
</svg>
|
|
26881
26892
|
`;
|
|
26882
26893
|
this._generateSecondaryControl("Select", ESecondaryCursor.Select, () => {
|
|
26894
|
+
if (this._walkthroughPinEventRemoval) {
|
|
26895
|
+
this._walkthroughPinEventRemoval();
|
|
26896
|
+
this._walkthroughPinEventRemoval = null;
|
|
26897
|
+
}
|
|
26883
26898
|
this._selectedSecondaryCursor = ESecondaryCursor.Select;
|
|
26884
26899
|
this._listenSelection();
|
|
26885
26900
|
}, selectSvg);
|
|
@@ -26889,6 +26904,10 @@ class WidgetCursorBar extends Widget.AWidget {
|
|
|
26889
26904
|
</svg>
|
|
26890
26905
|
`;
|
|
26891
26906
|
this._generateSecondaryControl("Pan", ESecondaryCursor.Pan, () => {
|
|
26907
|
+
if (this._walkthroughPinEventRemoval) {
|
|
26908
|
+
this._walkthroughPinEventRemoval();
|
|
26909
|
+
this._walkthroughPinEventRemoval = null;
|
|
26910
|
+
}
|
|
26892
26911
|
if (this._selectedSecondaryCursor == ESecondaryCursor.Pan) {
|
|
26893
26912
|
this._selectedSecondaryCursor = ESecondaryCursor.Select;
|
|
26894
26913
|
this._listenSelection();
|
|
@@ -26918,6 +26937,7 @@ class WidgetCursorBar extends Widget.AWidget {
|
|
|
26918
26937
|
_initWalkthroughPin() {
|
|
26919
26938
|
if (this._walkthroughPinEventRemoval) {
|
|
26920
26939
|
this._walkthroughPinEventRemoval();
|
|
26940
|
+
this._walkthroughPinEventRemoval = null;
|
|
26921
26941
|
}
|
|
26922
26942
|
let pointer;
|
|
26923
26943
|
let events = new ScreenSpaceEventHandler(this._viewer.scene.canvas);
|
|
@@ -26936,35 +26956,20 @@ class WidgetCursorBar extends Widget.AWidget {
|
|
|
26936
26956
|
}
|
|
26937
26957
|
};
|
|
26938
26958
|
let dropPosition3d;
|
|
26939
|
-
let dropPosition2d;
|
|
26940
26959
|
let dropOnTerrain = false;
|
|
26941
26960
|
events.setInputAction((e) => {
|
|
26942
26961
|
const pos2d = e.endPosition;
|
|
26943
26962
|
// First try find a position on a 'thing'.
|
|
26944
26963
|
// This lets us put our pin underground if there is something there.
|
|
26945
|
-
let pos3d = DrawingUtils.GetAccuratePosition(this._viewer, pos2d, true);
|
|
26964
|
+
let pos3d = DrawingUtils.GetAccuratePosition(this._viewer, pos2d, true, pointer ? [pointer] : null);
|
|
26946
26965
|
dropOnTerrain = false;
|
|
26947
26966
|
// Fallback to position including terrain as an option.
|
|
26948
26967
|
if (!Cartes.ValidateCartes3(pos3d)) {
|
|
26949
|
-
pos3d = DrawingUtils.GetAccuratePosition(this._viewer, pos2d, false);
|
|
26968
|
+
pos3d = DrawingUtils.GetAccuratePosition(this._viewer, pos2d, false, pointer ? [pointer] : null);
|
|
26950
26969
|
dropOnTerrain = true;
|
|
26951
26970
|
}
|
|
26952
26971
|
if (Cartes.ValidateCartes3(pos3d)) {
|
|
26953
26972
|
dropPosition3d = pos3d;
|
|
26954
|
-
dropPosition2d = pos2d;
|
|
26955
|
-
if (!pointer) {
|
|
26956
|
-
pointer = this._viewer.entities.add({
|
|
26957
|
-
position: new CallbackProperty(() => dropPosition3d, false),
|
|
26958
|
-
point: {
|
|
26959
|
-
pixelSize: 10,
|
|
26960
|
-
color: Color.fromCssColorString("#33B1FF"),
|
|
26961
|
-
outlineColor: Color.WHITE,
|
|
26962
|
-
outlineWidth: 2,
|
|
26963
|
-
heightReference: HeightReference.NONE,
|
|
26964
|
-
show: true
|
|
26965
|
-
}
|
|
26966
|
-
});
|
|
26967
|
-
}
|
|
26968
26973
|
}
|
|
26969
26974
|
}, ScreenSpaceEventType.MOUSE_MOVE);
|
|
26970
26975
|
let processing = false;
|
|
@@ -26985,7 +26990,6 @@ class WidgetCursorBar extends Widget.AWidget {
|
|
|
26985
26990
|
dropOnTerrain = true;
|
|
26986
26991
|
}
|
|
26987
26992
|
dropPosition3d = pos3d;
|
|
26988
|
-
dropPosition2d = e.position;
|
|
26989
26993
|
}
|
|
26990
26994
|
let pos3d = dropPosition3d === null || dropPosition3d === void 0 ? void 0 : dropPosition3d.clone();
|
|
26991
26995
|
if (Cartes.ValidateCartes3(pos3d)) {
|
|
@@ -29361,7 +29365,7 @@ class WidgetViewBar extends Widget.AWidget {
|
|
|
29361
29365
|
}
|
|
29362
29366
|
}
|
|
29363
29367
|
|
|
29364
|
-
const VERSION = "5.0.
|
|
29368
|
+
const VERSION = "5.0.8";
|
|
29365
29369
|
|
|
29366
29370
|
export { VERSION, CesiumViewMonitor, ViewerUtils, ViewerEventTracker, MenuItemManager, EntityRenderEngine, EntityRenderEnginePoint, EntityRenderEnginePolyline, EntityRenderEnginePolygon, EntityRenderEngineModel3d, MenuItemCreator, VisualsRegister, RenderManager, EntitiesIdsRenderManager, DataLabRenderManager, EntitiesLoadedRenderManager, EntitiesRenderManager, EntityRenderManager, TilesetCadRenderManager, TilesetArbRenderManager, TilesetEntitiesRenderManager, TilesetOsmRenderManager, TilesetPointcloudRenderManager, TilesetGooglePhotosRenderManager, DataSourceStaticKmlManager, GoogleSearchRenderManager, RelationsRenderManager, SharedGetters, CesiumParabola, EntityLabel, ViewRenderEngine, TileRenderEngine, TilesetRenderEngine, CESIUM_INSPECTOR_KEY, CESIUM_TIMELINE_KEY, ViewUtils, DrawingUtils, MeasureUtils, EntityUtils, CesiumEntityStyler, CesiumAnimatedProperty, CesiumAnimatedInOut, Draw3dPolygon, Draw3dPolyline, MeasureCreator, Walkthrough, Widget, VIEWER_BOOKMARKS_WIDGET_KEY, WidgetBookmarks, WidgetBranding, WidgetCursorBar, WidgetEmbeddedInfoView, WidgetInfoView, WidgetNavCompass$$1 as WidgetNavCompass, VIEWER_VIEW_BAR_WIDGET_KEY, WidgetViewBar, WidgetControlViewBar, WidgetControlViewBarSearch, VIEWER_LEFT_PANEL_WIDGET_KEY, VIEWER_LEFT_PANEL_CSS_VAR_LEFT, WidgetLeftPanel, WidgetLeftPanelTab, WidgetLeftPanelTabBookmarks };
|
|
29367
29371
|
//# sourceMappingURL=bruce-cesium.es5.js.map
|