xy-cesium3 0.0.78 → 0.0.80
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/package.json +1 -1
- package/xy-cesium3.es.js +18 -1
- package/xy-cesium3.umd.js +10 -10
package/package.json
CHANGED
package/xy-cesium3.es.js
CHANGED
|
@@ -1684,6 +1684,20 @@ const flyToRectangle = (viewer2, rect, option) => {
|
|
|
1684
1684
|
});
|
|
1685
1685
|
});
|
|
1686
1686
|
};
|
|
1687
|
+
const flyToCoordinatesBounds = (coordinates, option) => {
|
|
1688
|
+
if (!coordinates || coordinates.length === 0) {
|
|
1689
|
+
throw new Error("\u5750\u6807\u6570\u7EC4\u4E0D\u80FD\u4E3A\u7A7A");
|
|
1690
|
+
}
|
|
1691
|
+
const lons = coordinates.map((coord) => coord[0]).filter((lon) => typeof lon === "number");
|
|
1692
|
+
const lats = coordinates.map((coord) => coord[1]).filter((lat) => typeof lat === "number");
|
|
1693
|
+
const west = Math.min(...lons);
|
|
1694
|
+
const east = Math.max(...lons);
|
|
1695
|
+
const south = Math.min(...lats);
|
|
1696
|
+
const north = Math.max(...lats);
|
|
1697
|
+
const rectangle = Cesium.Rectangle.fromDegrees(west, south, east, north);
|
|
1698
|
+
const viewer2 = getViewer();
|
|
1699
|
+
return flyToRectangle(viewer2, rectangle, option);
|
|
1700
|
+
};
|
|
1687
1701
|
const getTerrainHeight = async (viewer2, lng, lat) => {
|
|
1688
1702
|
const terrainProvider = viewer2.terrainProvider;
|
|
1689
1703
|
const positions = [Cesium.Cartographic.fromDegrees(lng, lat)];
|
|
@@ -9395,7 +9409,8 @@ class EntityDraw {
|
|
|
9395
9409
|
depthFailMaterial: new Cesium.PolylineDashMaterialProperty({
|
|
9396
9410
|
color: Cesium.Color.fromCssColorString(style$1.lineColor),
|
|
9397
9411
|
dashLength: style$1.dashLength
|
|
9398
|
-
})
|
|
9412
|
+
}),
|
|
9413
|
+
clampToGround: this.heightReference == Cesium.HeightReference.CLAMP_TO_3D_TILE
|
|
9399
9414
|
}
|
|
9400
9415
|
});
|
|
9401
9416
|
}
|
|
@@ -9403,6 +9418,7 @@ class EntityDraw {
|
|
|
9403
9418
|
this.defaultList = [];
|
|
9404
9419
|
for (let i in list) {
|
|
9405
9420
|
let item2 = list[i];
|
|
9421
|
+
console.log("addDefaultData", item2);
|
|
9406
9422
|
if (item2.type === "Point") {
|
|
9407
9423
|
let height = Number(item2[props.height]) || 0;
|
|
9408
9424
|
if (autoHeight) {
|
|
@@ -133864,6 +133880,7 @@ const mapUtils = {
|
|
|
133864
133880
|
firstFly,
|
|
133865
133881
|
flyTo,
|
|
133866
133882
|
flyToRectangle,
|
|
133883
|
+
flyToCoordinatesBounds,
|
|
133867
133884
|
flyToPoint,
|
|
133868
133885
|
setView,
|
|
133869
133886
|
gazeAngle,
|