@cesium/engine 3.0.2 → 5.0.0
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/Build/ThirdParty/Workers/pako_deflate.min.js +605 -0
- package/Build/ThirdParty/Workers/pako_inflate.min.js +800 -0
- package/Build/ThirdParty/Workers/z-worker-pako.js +502 -0
- package/Build/Workers/chunk-2U6EBIRX.js +757 -0
- package/Build/Workers/chunk-2ZI7FZ3Q.js +58 -0
- package/Build/Workers/chunk-3TSHZWOZ.js +1860 -0
- package/Build/Workers/chunk-44B6FQSJ.js +684 -0
- package/Build/Workers/chunk-4AJR66C5.js +368 -0
- package/Build/Workers/chunk-4HN3N5SE.js +501 -0
- package/Build/Workers/chunk-4QGPYV3W.js +102 -0
- package/Build/Workers/chunk-4RKE4B3G.js +476 -0
- package/Build/Workers/chunk-5E3V7Y4R.js +196 -0
- package/Build/Workers/chunk-6EHT6GS3.js +163 -0
- package/Build/Workers/chunk-6I22NWKQ.js +171 -0
- package/Build/Workers/chunk-7N67FBLW.js +1054 -0
- package/Build/Workers/chunk-AQQGAFKX.js +124 -0
- package/Build/Workers/chunk-CROU4RHL.js +138 -0
- package/Build/Workers/chunk-CTJCECTX.js +258 -0
- package/Build/Workers/chunk-DWJZFZ67.js +781 -0
- package/Build/Workers/chunk-EHJQEARC.js +59 -0
- package/Build/Workers/chunk-EVLKHUAE.js +1477 -0
- package/Build/Workers/chunk-FOOYJER7.js +834 -0
- package/Build/Workers/chunk-GLCRFDOB.js +73 -0
- package/Build/Workers/chunk-GPO47TW4.js +39 -0
- package/Build/Workers/chunk-H5Q2JKIA.js +1075 -0
- package/Build/Workers/chunk-HIDSEUWS.js +2041 -0
- package/Build/Workers/chunk-HV67ARO7.js +302 -0
- package/Build/Workers/chunk-IC7G4BX2.js +421 -0
- package/Build/Workers/chunk-IQN2LMGD.js +55 -0
- package/Build/Workers/chunk-J2FHYK2Z.js +55 -0
- package/Build/Workers/chunk-K3VEWONC.js +289 -0
- package/Build/Workers/chunk-KZFXE35V.js +117 -0
- package/Build/Workers/chunk-MG2TXIO5.js +400 -0
- package/Build/Workers/chunk-MRCFDEKH.js +138 -0
- package/Build/Workers/chunk-MYDS6HBL.js +3273 -0
- package/Build/Workers/chunk-OCIX2CQ7.js +305 -0
- package/Build/Workers/chunk-P32XMW4I.js +2716 -0
- package/Build/Workers/chunk-PEVZYZBQ.js +157 -0
- package/Build/Workers/chunk-PMDLIBEQ.js +218 -0
- package/Build/Workers/chunk-QDUOGCCO.js +1009 -0
- package/Build/Workers/chunk-QUCJGBCK.js +430 -0
- package/Build/Workers/chunk-RCI7BSOM.js +452 -0
- package/Build/Workers/chunk-SVTSC7FX.js +390 -0
- package/Build/Workers/chunk-TXOGSFHZ.js +77 -0
- package/Build/Workers/chunk-TXYJOVQK.js +629 -0
- package/Build/Workers/chunk-UFIT5XDI.js +1258 -0
- package/Build/Workers/chunk-ULLMQNFQ.js +73 -0
- package/Build/Workers/chunk-UM7FIUQW.js +101 -0
- package/Build/Workers/{package.js → chunk-UMLTOPAE.js} +13 -2
- package/Build/Workers/chunk-V5S5N2IS.js +8644 -0
- package/Build/Workers/chunk-VN2IHJKM.js +513 -0
- package/Build/Workers/chunk-VWSD2XV5.js +669 -0
- package/Build/Workers/chunk-X2KIWBTW.js +100 -0
- package/Build/Workers/chunk-Y24CDOJC.js +353 -0
- package/Build/Workers/chunk-YLMDWSXO.js +44 -0
- package/Build/Workers/chunk-YNZ4DMR7.js +634 -0
- package/Build/Workers/chunk-Z2MP3UBE.js +236 -0
- package/Build/Workers/combineGeometry.js +65 -15
- package/Build/Workers/createBoxGeometry.js +55 -10
- package/Build/Workers/createBoxOutlineGeometry.js +231 -310
- package/Build/Workers/createCircleGeometry.js +185 -202
- package/Build/Workers/createCircleOutlineGeometry.js +141 -155
- package/Build/Workers/createCoplanarPolygonGeometry.js +477 -557
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +218 -230
- package/Build/Workers/createCorridorGeometry.js +1163 -1307
- package/Build/Workers/createCorridorOutlineGeometry.js +534 -569
- package/Build/Workers/createCylinderGeometry.js +57 -10
- package/Build/Workers/createCylinderOutlineGeometry.js +224 -258
- package/Build/Workers/createEllipseGeometry.js +68 -12
- package/Build/Workers/createEllipseOutlineGeometry.js +61 -12
- package/Build/Workers/createEllipsoidGeometry.js +56 -10
- package/Build/Workers/createEllipsoidOutlineGeometry.js +58 -13
- package/Build/Workers/createFrustumGeometry.js +55 -10
- package/Build/Workers/createFrustumOutlineGeometry.js +226 -243
- package/Build/Workers/createGeometry.js +143 -48
- package/Build/Workers/createGroundPolylineGeometry.js +1484 -2012
- package/Build/Workers/createPlaneGeometry.js +216 -243
- package/Build/Workers/createPlaneOutlineGeometry.js +121 -113
- package/Build/Workers/createPolygonGeometry.js +1437 -1314
- package/Build/Workers/createPolygonOutlineGeometry.js +516 -657
- package/Build/Workers/createPolylineGeometry.js +471 -547
- package/Build/Workers/createPolylineVolumeGeometry.js +354 -384
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +272 -295
- package/Build/Workers/createRectangleGeometry.js +1128 -1331
- package/Build/Workers/createRectangleOutlineGeometry.js +445 -500
- package/Build/Workers/createSimplePolylineGeometry.js +381 -440
- package/Build/Workers/createSphereGeometry.js +112 -118
- package/Build/Workers/createSphereOutlineGeometry.js +112 -121
- package/Build/Workers/createTaskProcessorWorker.js +32 -127
- package/Build/Workers/createVectorTileClampedPolylines.js +462 -505
- package/Build/Workers/createVectorTileGeometries.js +377 -436
- package/Build/Workers/createVectorTilePoints.js +110 -77
- package/Build/Workers/createVectorTilePolygons.js +369 -391
- package/Build/Workers/createVectorTilePolylines.js +252 -244
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +543 -615
- package/Build/Workers/createVerticesFromHeightmap.js +2244 -2677
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +682 -904
- package/Build/Workers/createWallGeometry.js +459 -593
- package/Build/Workers/createWallOutlineGeometry.js +324 -419
- package/Build/Workers/decodeDraco.js +327 -347
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +2530 -3567
- package/Build/Workers/decodeI3S.js +765 -970
- package/Build/Workers/transcodeKTX2.js +3351 -1473
- package/Build/Workers/transferTypedArrayTest.js +3 -4
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +748 -953
- package/LICENSE.md +0 -12
- package/Source/Core/CesiumTerrainProvider.js +1 -2
- package/Source/Core/Credit.js +7 -1
- package/Source/Core/FeatureDetection.js +9 -0
- package/Source/Core/GoogleMaps.js +1 -2
- package/Source/Core/Ion.js +1 -2
- package/Source/Core/KTX2Transcoder.js +7 -3
- package/Source/Core/PolygonGeometry.js +340 -27
- package/Source/Core/PolygonGeometryLibrary.js +302 -1
- package/Source/Core/Stereographic.js +247 -0
- package/Source/Core/TaskProcessor.js +185 -168
- package/Source/Core/Transforms.js +2 -2
- package/Source/Core/buildModuleUrl.js +6 -5
- package/Source/Core/sampleTerrain.js +43 -10
- package/Source/Core/sampleTerrainMostDetailed.js +27 -3
- package/Source/Scene/ArcGisMapService.js +1 -2
- package/Source/Scene/Billboard.js +7 -0
- package/Source/Scene/Cesium3DTilePass.js +1 -1
- package/Source/Scene/Cesium3DTileset.js +38 -81
- package/Source/Scene/CreditDisplay.js +2 -2
- package/Source/Scene/DracoLoader.js +26 -3
- package/Source/Scene/I3SDataProvider.js +0 -27
- package/Source/Scene/I3SDecoder.js +127 -0
- package/Source/Scene/I3SNode.js +32 -110
- package/Source/Scene/Implicit3DTileContent.js +13 -0
- package/Source/Scene/ImplicitTileset.js +5 -0
- package/Source/Scene/LabelCollection.js +3 -1
- package/Source/Scene/Model/I3dmLoader.js +5 -1
- package/Source/Scene/Model/Model.js +20 -23
- package/Source/Scene/OpenStreetMapImageryProvider.js +4 -1
- package/Source/Scene/PostProcessStageLibrary.js +3 -3
- package/Source/Scene/PrimitiveCollection.js +39 -0
- package/Source/Scene/Scene.js +3 -0
- package/Source/Scene/SingleTileImageryProvider.js +4 -2
- package/Source/ThirdParty/Workers/basis_transcoder.js +1 -1
- package/Source/Widget/CesiumWidget.js +2 -1
- package/Source/{WorkersES6 → Workers}/createGeometry.js +11 -12
- package/Source/{WorkersES6 → Workers}/createTaskProcessorWorker.js +43 -59
- package/Source/{WorkersES6 → Workers}/decodeDraco.js +19 -25
- package/Source/{WorkersES6 → Workers}/decodeI3S.js +18 -32
- package/Source/{WorkersES6 → Workers}/transcodeKTX2.js +19 -26
- package/Source/Workers/transferTypedArrayTest.js +0 -6
- package/index.d.ts +69 -35
- package/index.js +189 -187
- package/package.json +2 -1
- package/Build/Workers/ArcType-2d9abbbc.js +0 -37
- package/Build/Workers/AttributeCompression-f9f6c717.js +0 -716
- package/Build/Workers/AxisAlignedBoundingBox-a03420b1.js +0 -258
- package/Build/Workers/BoundingRectangle-32fa8a4a.js +0 -369
- package/Build/Workers/BoxGeometry-cd550612.js +0 -884
- package/Build/Workers/Check-6ede7e26.js +0 -290
- package/Build/Workers/Color-571a6085.js +0 -2262
- package/Build/Workers/ComponentDatatype-cf1fa08e.js +0 -341
- package/Build/Workers/CoplanarPolygonGeometryLibrary-488b1a9f.js +0 -132
- package/Build/Workers/CorridorGeometryLibrary-fc4ff147.js +0 -498
- package/Build/Workers/CylinderGeometry-bc26926d.js +0 -467
- package/Build/Workers/CylinderGeometryLibrary-7bf291b4.js +0 -63
- package/Build/Workers/EllipseGeometry-89533a10.js +0 -1304
- package/Build/Workers/EllipseGeometryLibrary-b0d7df17.js +0 -366
- package/Build/Workers/EllipseOutlineGeometry-63ff7a87.js +0 -443
- package/Build/Workers/EllipsoidGeodesic-5b3623dc.js +0 -520
- package/Build/Workers/EllipsoidGeometry-07e99d2d.js +0 -637
- package/Build/Workers/EllipsoidOutlineGeometry-ba5c7ee2.js +0 -454
- package/Build/Workers/EllipsoidRhumbLine-ef872433.js +0 -741
- package/Build/Workers/EllipsoidTangentPlane-65d41b3e.js +0 -373
- package/Build/Workers/EncodedCartesian3-57415c8a.js +0 -171
- package/Build/Workers/FrustumGeometry-4a7589ed.js +0 -2540
- package/Build/Workers/GeometryAttribute-a5b6275b.js +0 -619
- package/Build/Workers/GeometryAttributes-ad136444.js +0 -91
- package/Build/Workers/GeometryInstance-34d9e21e.js +0 -121
- package/Build/Workers/GeometryOffsetAttribute-9ad0019c.js +0 -16
- package/Build/Workers/GeometryPipeline-fa9e6ffc.js +0 -3690
- package/Build/Workers/IndexDatatype-2643aa47.js +0 -200
- package/Build/Workers/IntersectionTests-feace3da.js +0 -1836
- package/Build/Workers/Math-0a2ac845.js +0 -1340
- package/Build/Workers/Matrix2-e1298525.js +0 -7086
- package/Build/Workers/Matrix3-41c58dde.js +0 -4283
- package/Build/Workers/OrientedBoundingBox-6b94d955.js +0 -1259
- package/Build/Workers/Plane-4c3d403b.js +0 -309
- package/Build/Workers/PolygonGeometryLibrary-4ffc457d.js +0 -1074
- package/Build/Workers/PolygonPipeline-d5e66350.js +0 -1344
- package/Build/Workers/PolylinePipeline-83410f0c.js +0 -573
- package/Build/Workers/PolylineVolumeGeometryLibrary-290e7aec.js +0 -781
- package/Build/Workers/PrimitivePipeline-6081d138.js +0 -966
- package/Build/Workers/RectangleGeometryLibrary-986710d8.js +0 -280
- package/Build/Workers/RuntimeError-ef395448.js +0 -68
- package/Build/Workers/TerrainEncoding-528e1d68.js +0 -1227
- package/Build/Workers/Transforms-b527bb09.js +0 -14714
- package/Build/Workers/VertexFormat-030f11ff.js +0 -312
- package/Build/Workers/WallGeometryLibrary-faf583f8.js +0 -211
- package/Build/Workers/WebGLConstants-0b1ce7ba.js +0 -620
- package/Build/Workers/WebMercatorProjection-13ed1a6e.js +0 -151
- package/Build/Workers/arrayRemoveDuplicates-d2061e85.js +0 -129
- package/Build/Workers/cesiumWorkerBootstrapper.js +0 -1363
- package/Build/Workers/combine-d9581036.js +0 -82
- package/Build/Workers/defaultValue-fe22d8c0.js +0 -51
- package/Source/ThirdParty/Workers/draco_decoder_nodejs.js +0 -117
- package/Source/Workers/cesiumWorkerBootstrapper.js +0 -2290
- package/Source/Workers/package.json +0 -1
- /package/Source/{WorkersES6 → Workers}/combineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createBoxGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createBoxOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createCircleGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createCircleOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createCoplanarPolygonGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createCoplanarPolygonOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createCorridorGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createCorridorOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createCylinderGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createCylinderOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createEllipseGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createEllipseOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createEllipsoidGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createEllipsoidOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createFrustumGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createFrustumOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createGroundPolylineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createPlaneGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createPlaneOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createPolygonGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createPolygonOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createPolylineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createPolylineVolumeGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createPolylineVolumeOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createRectangleGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createRectangleOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createSimplePolylineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createSphereGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createSphereOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createVectorTileClampedPolylines.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createVectorTileGeometries.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createVectorTilePoints.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createVectorTilePolygons.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createVectorTilePolylines.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createVerticesFromGoogleEarthEnterpriseBuffer.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createVerticesFromHeightmap.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createVerticesFromQuantizedTerrainMesh.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createWallGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/createWallOutlineGeometry.js +0 -0
- /package/Source/{WorkersES6 → Workers}/decodeGoogleEarthEnterprisePacket.js +0 -0
- /package/Source/{WorkersES6 → Workers}/upsampleQuantizedTerrainMesh.js +0 -0
package/LICENSE.md
CHANGED
|
@@ -270,18 +270,6 @@ https://github.com/sole/tween.js
|
|
|
270
270
|
>
|
|
271
271
|
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
272
272
|
|
|
273
|
-
### RequireJS
|
|
274
|
-
|
|
275
|
-
https://github.com/jrburke/requirejs
|
|
276
|
-
|
|
277
|
-
> Copyright (c) 2010-2015, The Dojo Foundation
|
|
278
|
-
>
|
|
279
|
-
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
280
|
-
>
|
|
281
|
-
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
282
|
-
>
|
|
283
|
-
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
284
|
-
|
|
285
273
|
### topojson-client
|
|
286
274
|
|
|
287
275
|
https://github.com/topojson/topojson-client
|
|
@@ -867,8 +867,7 @@ CesiumTerrainProvider.prototype.requestTileGeometry = function (
|
|
|
867
867
|
// Optimized path for single layers
|
|
868
868
|
layerToUse = layers[0];
|
|
869
869
|
} else {
|
|
870
|
-
|
|
871
|
-
for (let i = layerCount - 1; i >= 0; --i) {
|
|
870
|
+
for (let i = 0; i < layerCount; ++i) {
|
|
872
871
|
const layer = layers[i];
|
|
873
872
|
if (
|
|
874
873
|
!defined(layer.availability) ||
|
package/Source/Core/Credit.js
CHANGED
|
@@ -138,6 +138,13 @@ Credit.prototype.equals = function (credit) {
|
|
|
138
138
|
return Credit.equals(this, credit);
|
|
139
139
|
};
|
|
140
140
|
|
|
141
|
+
/**
|
|
142
|
+
* @private
|
|
143
|
+
*/
|
|
144
|
+
Credit.prototype.isIon = function () {
|
|
145
|
+
return this.html.indexOf("ion-credit.png") !== -1;
|
|
146
|
+
};
|
|
147
|
+
|
|
141
148
|
/**
|
|
142
149
|
* @private
|
|
143
150
|
* @param attribution
|
|
@@ -148,7 +155,6 @@ Credit.getIonCredit = function (attribution) {
|
|
|
148
155
|
defined(attribution.collapsible) && !attribution.collapsible;
|
|
149
156
|
const credit = new Credit(attribution.html, showOnScreen);
|
|
150
157
|
|
|
151
|
-
credit._isIon = credit.html.indexOf("ion-credit.png") !== -1;
|
|
152
158
|
return credit;
|
|
153
159
|
};
|
|
154
160
|
|
|
@@ -426,4 +426,13 @@ FeatureDetection.supportsWebgl2 = function (scene) {
|
|
|
426
426
|
return scene.context.webgl2;
|
|
427
427
|
};
|
|
428
428
|
|
|
429
|
+
/**
|
|
430
|
+
* Detects whether the current browser supports ECMAScript modules in web workers.
|
|
431
|
+
* @returns {boolean} true if the browser supports ECMAScript modules in web workers.
|
|
432
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Worker|Worker}
|
|
433
|
+
*/
|
|
434
|
+
FeatureDetection.supportsEsmWebWorkers = function () {
|
|
435
|
+
return !isFirefox() || parseInt(firefoxVersionResult) >= 114;
|
|
436
|
+
};
|
|
437
|
+
|
|
429
438
|
export default FeatureDetection;
|
|
@@ -3,7 +3,7 @@ import defined from "./defined.js";
|
|
|
3
3
|
import Resource from "./Resource.js";
|
|
4
4
|
|
|
5
5
|
let defaultKeyCredit;
|
|
6
|
-
const defaultKey = "
|
|
6
|
+
const defaultKey = "AIzaSyA3mA091skJHiLbk3IOlHrHnZmzCoYz3-c";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Default settings for accessing the Google Maps API.
|
|
@@ -48,7 +48,6 @@ GoogleMaps.getDefaultApiKeyCredit = function (providedKey) {
|
|
|
48
48
|
with <a href="https://developers.google.com/maps/documentation/embed/get-api-key">your API key for the Google Maps Platform</a>.</b>';
|
|
49
49
|
|
|
50
50
|
defaultKeyCredit = new Credit(defaultKeyMessage, true);
|
|
51
|
-
defaultKeyCredit._isDefaultToken = true;
|
|
52
51
|
}
|
|
53
52
|
|
|
54
53
|
return defaultKeyCredit;
|
package/Source/Core/Ion.js
CHANGED
|
@@ -4,7 +4,7 @@ import Resource from "./Resource.js";
|
|
|
4
4
|
|
|
5
5
|
let defaultTokenCredit;
|
|
6
6
|
const defaultAccessToken =
|
|
7
|
-
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
|
|
7
|
+
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJhYjVkZWE2Yi05ZjlmLTQyOTAtYjFkOC0xMmFmZTYyMjhmZGIiLCJpZCI6MjU5LCJpYXQiOjE2OTYyNjgyMzN9.iKIgzd7PueqxXsUNSIhk5C6n8uiugH-Dxy9uhOdJ5Zg";
|
|
8
8
|
/**
|
|
9
9
|
* Default settings for accessing the Cesium ion API.
|
|
10
10
|
*
|
|
@@ -49,7 +49,6 @@ Ion.getDefaultTokenCredit = function (providedKey) {
|
|
|
49
49
|
You can sign up for a free ion account at <a href="https://cesium.com">https://cesium.com</a>.</b>';
|
|
50
50
|
|
|
51
51
|
defaultTokenCredit = new Credit(defaultTokenMessage, true);
|
|
52
|
-
defaultTokenCredit._isDefaultToken = true;
|
|
53
52
|
}
|
|
54
53
|
|
|
55
54
|
return defaultTokenCredit;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Check from "./Check.js";
|
|
2
2
|
import CompressedTextureBuffer from "./CompressedTextureBuffer.js";
|
|
3
3
|
import defined from "./defined.js";
|
|
4
|
+
import RuntimeError from "./RuntimeError.js";
|
|
4
5
|
import TaskProcessor from "./TaskProcessor.js";
|
|
5
6
|
|
|
6
7
|
/**
|
|
@@ -20,11 +21,14 @@ KTX2Transcoder._readyPromise = undefined;
|
|
|
20
21
|
function makeReadyPromise() {
|
|
21
22
|
const readyPromise = KTX2Transcoder._transcodeTaskProcessor
|
|
22
23
|
.initWebAssemblyModule({
|
|
23
|
-
modulePath: "ThirdParty/Workers/basis_transcoder.js",
|
|
24
24
|
wasmBinaryFile: "ThirdParty/basis_transcoder.wasm",
|
|
25
25
|
})
|
|
26
|
-
.then(function () {
|
|
27
|
-
|
|
26
|
+
.then(function (result) {
|
|
27
|
+
if (result) {
|
|
28
|
+
return KTX2Transcoder._transcodeTaskProcessor;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
throw new RuntimeError("KTX2 transcoder could not be initialized.");
|
|
28
32
|
});
|
|
29
33
|
KTX2Transcoder._readyPromise = readyPromise;
|
|
30
34
|
}
|
|
@@ -8,6 +8,7 @@ import Check from "./Check.js";
|
|
|
8
8
|
import ComponentDatatype from "./ComponentDatatype.js";
|
|
9
9
|
import defaultValue from "./defaultValue.js";
|
|
10
10
|
import defined from "./defined.js";
|
|
11
|
+
import deprecationWarning from "./deprecationWarning.js";
|
|
11
12
|
import DeveloperError from "./DeveloperError.js";
|
|
12
13
|
import Ellipsoid from "./Ellipsoid.js";
|
|
13
14
|
import EllipsoidGeodesic from "./EllipsoidGeodesic.js";
|
|
@@ -24,6 +25,7 @@ import PolygonGeometryLibrary from "./PolygonGeometryLibrary.js";
|
|
|
24
25
|
import PolygonPipeline from "./PolygonPipeline.js";
|
|
25
26
|
import Quaternion from "./Quaternion.js";
|
|
26
27
|
import Rectangle from "./Rectangle.js";
|
|
28
|
+
import Stereographic from "./Stereographic.js";
|
|
27
29
|
import VertexFormat from "./VertexFormat.js";
|
|
28
30
|
import WindingOrder from "./WindingOrder.js";
|
|
29
31
|
|
|
@@ -82,7 +84,8 @@ function computeAttributes(options) {
|
|
|
82
84
|
// PERFORMANCE_IDEA: Compute before subdivision, then just interpolate during subdivision.
|
|
83
85
|
// PERFORMANCE_IDEA: Compute with createGeometryFromPositions() for fast path when there's no holes.
|
|
84
86
|
const boundingRectangle = options.boundingRectangle;
|
|
85
|
-
const
|
|
87
|
+
const rotationAxis = options.rotationAxis;
|
|
88
|
+
const projectTo2d = options.projectTo2d;
|
|
86
89
|
const ellipsoid = options.ellipsoid;
|
|
87
90
|
const stRotation = options.stRotation;
|
|
88
91
|
const perPositionHeight = options.perPositionHeight;
|
|
@@ -122,14 +125,14 @@ function computeAttributes(options) {
|
|
|
122
125
|
let tangentRotationMatrix = tangentMatrixScratch;
|
|
123
126
|
if (stRotation !== 0.0) {
|
|
124
127
|
let rotation = Quaternion.fromAxisAngle(
|
|
125
|
-
|
|
128
|
+
rotationAxis,
|
|
126
129
|
stRotation,
|
|
127
130
|
appendTextureCoordinatesQuaternion
|
|
128
131
|
);
|
|
129
132
|
textureMatrix = Matrix3.fromQuaternion(rotation, textureMatrix);
|
|
130
133
|
|
|
131
134
|
rotation = Quaternion.fromAxisAngle(
|
|
132
|
-
|
|
135
|
+
rotationAxis,
|
|
133
136
|
-stRotation,
|
|
134
137
|
appendTextureCoordinatesQuaternion
|
|
135
138
|
);
|
|
@@ -170,10 +173,7 @@ function computeAttributes(options) {
|
|
|
170
173
|
scratchPosition
|
|
171
174
|
);
|
|
172
175
|
p = ellipsoid.scaleToGeodeticSurface(p, p);
|
|
173
|
-
const st =
|
|
174
|
-
p,
|
|
175
|
-
appendTextureCoordinatesCartesian2
|
|
176
|
-
);
|
|
176
|
+
const st = projectTo2d(p, appendTextureCoordinatesCartesian2);
|
|
177
177
|
Cartesian2.subtract(st, origin, st);
|
|
178
178
|
|
|
179
179
|
const stx = CesiumMath.clamp(st.x / boundingRectangle.width, 0, 1);
|
|
@@ -1078,6 +1078,194 @@ PolygonGeometry.unpack = function (array, startingIndex, result) {
|
|
|
1078
1078
|
return result;
|
|
1079
1079
|
};
|
|
1080
1080
|
|
|
1081
|
+
const scratchCartesian0 = new Cartesian2();
|
|
1082
|
+
const scratchCartesian1 = new Cartesian2();
|
|
1083
|
+
const scratchPolarClosest = new Stereographic();
|
|
1084
|
+
function expandRectangle(
|
|
1085
|
+
polar,
|
|
1086
|
+
lastPolar,
|
|
1087
|
+
ellipsoid,
|
|
1088
|
+
arcType,
|
|
1089
|
+
polygon,
|
|
1090
|
+
result
|
|
1091
|
+
) {
|
|
1092
|
+
const longitude = polar.longitude;
|
|
1093
|
+
const lonAdjusted =
|
|
1094
|
+
longitude >= 0.0 ? longitude : longitude + CesiumMath.TWO_PI;
|
|
1095
|
+
polygon.westOverIdl = Math.min(polygon.westOverIdl, lonAdjusted);
|
|
1096
|
+
polygon.eastOverIdl = Math.max(polygon.eastOverIdl, lonAdjusted);
|
|
1097
|
+
|
|
1098
|
+
result.west = Math.min(result.west, longitude);
|
|
1099
|
+
result.east = Math.max(result.east, longitude);
|
|
1100
|
+
|
|
1101
|
+
const latitude = polar.getLatitude(ellipsoid);
|
|
1102
|
+
let segmentLatitude = latitude;
|
|
1103
|
+
|
|
1104
|
+
result.south = Math.min(result.south, latitude);
|
|
1105
|
+
result.north = Math.max(result.north, latitude);
|
|
1106
|
+
|
|
1107
|
+
if (arcType !== ArcType.RHUMB) {
|
|
1108
|
+
// Geodesics will need to find the closest point on line. Rhumb lines will not have a latitude greater in magnitude than either of their endpoints.
|
|
1109
|
+
const segment = Cartesian2.subtract(
|
|
1110
|
+
lastPolar.position,
|
|
1111
|
+
polar.position,
|
|
1112
|
+
scratchCartesian0
|
|
1113
|
+
);
|
|
1114
|
+
const t =
|
|
1115
|
+
Cartesian2.dot(lastPolar.position, segment) /
|
|
1116
|
+
Cartesian2.dot(segment, segment);
|
|
1117
|
+
if (t > 0.0 && t < 1.0) {
|
|
1118
|
+
const projected = Cartesian2.add(
|
|
1119
|
+
lastPolar.position,
|
|
1120
|
+
Cartesian2.multiplyByScalar(segment, -t, segment),
|
|
1121
|
+
scratchCartesian1
|
|
1122
|
+
);
|
|
1123
|
+
const closestPolar = Stereographic.clone(lastPolar, scratchPolarClosest);
|
|
1124
|
+
closestPolar.position = projected;
|
|
1125
|
+
const adjustedLatitude = closestPolar.getLatitude(ellipsoid);
|
|
1126
|
+
result.south = Math.min(result.south, adjustedLatitude);
|
|
1127
|
+
result.north = Math.max(result.north, adjustedLatitude);
|
|
1128
|
+
|
|
1129
|
+
if (Math.abs(latitude) > Math.abs(adjustedLatitude)) {
|
|
1130
|
+
segmentLatitude = adjustedLatitude;
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
const direction = lastPolar.x * polar.y - polar.x * lastPolar.y;
|
|
1135
|
+
|
|
1136
|
+
// The total internal angle in either hemisphere determines if the pole is inside or outside the polygon
|
|
1137
|
+
let angle = Math.sign(direction);
|
|
1138
|
+
if (angle !== 0.0) {
|
|
1139
|
+
angle *= Cartesian2.angleBetween(lastPolar.position, polar.position);
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
if (segmentLatitude >= 0.0) {
|
|
1143
|
+
polygon.northAngle += angle;
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1146
|
+
if (segmentLatitude <= 0.0) {
|
|
1147
|
+
polygon.southAngle += angle;
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
const scratchPolar = new Stereographic();
|
|
1152
|
+
const scratchPolarPrevious = new Stereographic();
|
|
1153
|
+
const polygon = {
|
|
1154
|
+
northAngle: 0.0,
|
|
1155
|
+
southAngle: 0.0,
|
|
1156
|
+
westOverIdl: 0.0,
|
|
1157
|
+
eastOverIdl: 0.0,
|
|
1158
|
+
};
|
|
1159
|
+
|
|
1160
|
+
/**
|
|
1161
|
+
* Computes a rectangle which encloses the polygon defined by the list of positions, including cases over the international date line and the poles.
|
|
1162
|
+
*
|
|
1163
|
+
* @param {Cartesian3[]} positions A linear ring defining the outer boundary of the polygon.
|
|
1164
|
+
* @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.
|
|
1165
|
+
* @param {ArcType} [arcType=ArcType.GEODESIC] The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
|
|
1166
|
+
* @param {Rectangle} [result] An object in which to store the result.
|
|
1167
|
+
*
|
|
1168
|
+
* @returns {Rectangle} The result rectangle
|
|
1169
|
+
*/
|
|
1170
|
+
PolygonGeometry.computeRectangleFromPositions = function (
|
|
1171
|
+
positions,
|
|
1172
|
+
ellipsoid,
|
|
1173
|
+
arcType,
|
|
1174
|
+
result
|
|
1175
|
+
) {
|
|
1176
|
+
//>>includeStart('debug', pragmas.debug);
|
|
1177
|
+
Check.defined("positions", positions);
|
|
1178
|
+
//>>includeEnd('debug');
|
|
1179
|
+
|
|
1180
|
+
if (!defined(result)) {
|
|
1181
|
+
result = new Rectangle();
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
if (positions.length < 3) {
|
|
1185
|
+
return result;
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
result.west = Number.POSITIVE_INFINITY;
|
|
1189
|
+
result.east = Number.NEGATIVE_INFINITY;
|
|
1190
|
+
result.south = Number.POSITIVE_INFINITY;
|
|
1191
|
+
result.north = Number.NEGATIVE_INFINITY;
|
|
1192
|
+
|
|
1193
|
+
polygon.northAngle = 0.0;
|
|
1194
|
+
polygon.southAngle = 0.0;
|
|
1195
|
+
polygon.westOverIdl = Number.POSITIVE_INFINITY;
|
|
1196
|
+
polygon.eastOverIdl = Number.NEGATIVE_INFINITY;
|
|
1197
|
+
|
|
1198
|
+
const positionsLength = positions.length;
|
|
1199
|
+
let lastPolarPosition = Stereographic.fromCartesian(
|
|
1200
|
+
positions[0],
|
|
1201
|
+
scratchPolarPrevious
|
|
1202
|
+
);
|
|
1203
|
+
for (let i = 1; i < positionsLength; i++) {
|
|
1204
|
+
const polarPosition = Stereographic.fromCartesian(
|
|
1205
|
+
positions[i],
|
|
1206
|
+
scratchPolar
|
|
1207
|
+
);
|
|
1208
|
+
expandRectangle(
|
|
1209
|
+
polarPosition,
|
|
1210
|
+
lastPolarPosition,
|
|
1211
|
+
ellipsoid,
|
|
1212
|
+
arcType,
|
|
1213
|
+
polygon,
|
|
1214
|
+
result
|
|
1215
|
+
);
|
|
1216
|
+
|
|
1217
|
+
lastPolarPosition = Stereographic.clone(polarPosition, lastPolarPosition);
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
expandRectangle(
|
|
1221
|
+
Stereographic.fromCartesian(positions[0], scratchPolar),
|
|
1222
|
+
lastPolarPosition,
|
|
1223
|
+
ellipsoid,
|
|
1224
|
+
arcType,
|
|
1225
|
+
polygon,
|
|
1226
|
+
result
|
|
1227
|
+
);
|
|
1228
|
+
|
|
1229
|
+
if (result.east - result.west > polygon.eastOverIdl - polygon.westOverIdl) {
|
|
1230
|
+
result.west = polygon.westOverIdl;
|
|
1231
|
+
result.east = polygon.eastOverIdl;
|
|
1232
|
+
|
|
1233
|
+
if (result.east > CesiumMath.PI) {
|
|
1234
|
+
result.east = result.east - CesiumMath.TWO_PI;
|
|
1235
|
+
}
|
|
1236
|
+
if (result.west > CesiumMath.PI) {
|
|
1237
|
+
result.west = result.west - CesiumMath.TWO_PI;
|
|
1238
|
+
}
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
// If either pole is inside the polygon, adjust the rectangle so the pole is included
|
|
1242
|
+
if (
|
|
1243
|
+
CesiumMath.equalsEpsilon(
|
|
1244
|
+
Math.abs(polygon.northAngle),
|
|
1245
|
+
CesiumMath.TWO_PI,
|
|
1246
|
+
CesiumMath.EPSILON10
|
|
1247
|
+
)
|
|
1248
|
+
) {
|
|
1249
|
+
result.north = CesiumMath.PI_OVER_TWO;
|
|
1250
|
+
result.east = CesiumMath.PI;
|
|
1251
|
+
result.west = -CesiumMath.PI;
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
if (
|
|
1255
|
+
CesiumMath.equalsEpsilon(
|
|
1256
|
+
Math.abs(polygon.southAngle),
|
|
1257
|
+
CesiumMath.TWO_PI,
|
|
1258
|
+
CesiumMath.EPSILON10
|
|
1259
|
+
)
|
|
1260
|
+
) {
|
|
1261
|
+
result.south = -CesiumMath.PI_OVER_TWO;
|
|
1262
|
+
result.east = CesiumMath.PI;
|
|
1263
|
+
result.west = -CesiumMath.PI;
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
return result;
|
|
1267
|
+
};
|
|
1268
|
+
|
|
1081
1269
|
/**
|
|
1082
1270
|
* Returns the bounding rectangle given the provided options
|
|
1083
1271
|
*
|
|
@@ -1089,6 +1277,8 @@ PolygonGeometry.unpack = function (array, startingIndex, result) {
|
|
|
1089
1277
|
* @param {Rectangle} [result] An object in which to store the result.
|
|
1090
1278
|
*
|
|
1091
1279
|
* @returns {Rectangle} The result rectangle
|
|
1280
|
+
*
|
|
1281
|
+
* @deprecated
|
|
1092
1282
|
*/
|
|
1093
1283
|
PolygonGeometry.computeRectangle = function (options, result) {
|
|
1094
1284
|
//>>includeStart('debug', pragmas.debug);
|
|
@@ -1096,6 +1286,11 @@ PolygonGeometry.computeRectangle = function (options, result) {
|
|
|
1096
1286
|
Check.typeOf.object("options.polygonHierarchy", options.polygonHierarchy);
|
|
1097
1287
|
//>>includeEnd('debug');
|
|
1098
1288
|
|
|
1289
|
+
deprecationWarning(
|
|
1290
|
+
"PolygonGeometry.computeRectangle",
|
|
1291
|
+
"PolygonGeometry.computeRectangle was deprecated in CesiumJS 1.110. It will be removed in CesiumJS 1.112. Use PolygonGeometry.computeRectangleFromPositions instead."
|
|
1292
|
+
);
|
|
1293
|
+
|
|
1099
1294
|
const granularity = defaultValue(
|
|
1100
1295
|
options.granularity,
|
|
1101
1296
|
CesiumMath.RADIANS_PER_DEGREE
|
|
@@ -1121,6 +1316,127 @@ PolygonGeometry.computeRectangle = function (options, result) {
|
|
|
1121
1316
|
);
|
|
1122
1317
|
};
|
|
1123
1318
|
|
|
1319
|
+
const scratchPolarForPlane = new Stereographic();
|
|
1320
|
+
function getTangentPlane(rectangle, positions, ellipsoid) {
|
|
1321
|
+
if (rectangle.height >= CesiumMath.PI || rectangle.width >= CesiumMath.PI) {
|
|
1322
|
+
const polar = Stereographic.fromCartesian(
|
|
1323
|
+
positions[0],
|
|
1324
|
+
scratchPolarForPlane
|
|
1325
|
+
);
|
|
1326
|
+
return polar.tangentPlane;
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
// Use a local tangent plane for smaller extents
|
|
1330
|
+
return EllipsoidTangentPlane.fromPoints(positions, ellipsoid);
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
const scratchCartographicCyllindrical = new Cartographic();
|
|
1334
|
+
function createProjectTo2d(rectangle, ellipsoid) {
|
|
1335
|
+
return (positions, results) => {
|
|
1336
|
+
// If the polygon positions span a large enough extent, use a specialized projection
|
|
1337
|
+
if (rectangle.height >= CesiumMath.PI || rectangle.width >= CesiumMath.PI) {
|
|
1338
|
+
// polygons that cross the equator must use cyllindrical coordinates to correctly compute winding order.
|
|
1339
|
+
if (rectangle.south < 0 && rectangle.north > 0) {
|
|
1340
|
+
if (!defined(results)) {
|
|
1341
|
+
results = [];
|
|
1342
|
+
}
|
|
1343
|
+
|
|
1344
|
+
for (let i = 0; i < positions.length; ++i) {
|
|
1345
|
+
const cartographic = ellipsoid.cartesianToCartographic(
|
|
1346
|
+
positions[i],
|
|
1347
|
+
scratchCartographicCyllindrical
|
|
1348
|
+
);
|
|
1349
|
+
results[i] = new Cartesian2(
|
|
1350
|
+
cartographic.longitude / CesiumMath.PI,
|
|
1351
|
+
cartographic.latitude / CesiumMath.PI_OVER_TWO
|
|
1352
|
+
);
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
results.length = positions.length;
|
|
1356
|
+
return results;
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1359
|
+
return Stereographic.fromCartesianArray(positions, results);
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
// Use a local tangent plane for smaller extents
|
|
1363
|
+
const tangentPlane = EllipsoidTangentPlane.fromPoints(positions, ellipsoid);
|
|
1364
|
+
return tangentPlane.projectPointsOntoPlane(positions, results);
|
|
1365
|
+
};
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
function createProjectPositionTo2d(rectangle, outerRing, ellipsoid) {
|
|
1369
|
+
// If the polygon positions span a large enough extent, use a specialized projection
|
|
1370
|
+
if (rectangle.height >= CesiumMath.PI || rectangle.width >= CesiumMath.PI) {
|
|
1371
|
+
return (position, result) => {
|
|
1372
|
+
// polygons that cross the equator must use cyllindrical coordinates to correctly compute winding order.
|
|
1373
|
+
if (rectangle.south < 0 && rectangle.north > 0) {
|
|
1374
|
+
const cartographic = ellipsoid.cartesianToCartographic(
|
|
1375
|
+
position,
|
|
1376
|
+
scratchCartographicCyllindrical
|
|
1377
|
+
);
|
|
1378
|
+
if (!defined(result)) {
|
|
1379
|
+
result = new Cartesian2();
|
|
1380
|
+
}
|
|
1381
|
+
result.x = cartographic.longitude / CesiumMath.PI;
|
|
1382
|
+
result.y = cartographic.latitude / CesiumMath.PI_OVER_TWO;
|
|
1383
|
+
|
|
1384
|
+
return result;
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
return Stereographic.fromCartesian(position, result);
|
|
1388
|
+
};
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
const tangentPlane = EllipsoidTangentPlane.fromPoints(outerRing, ellipsoid);
|
|
1392
|
+
return (position, result) => {
|
|
1393
|
+
// Use a local tangent plane for smaller extents
|
|
1394
|
+
return tangentPlane.projectPointsOntoPlane(position, result);
|
|
1395
|
+
};
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1398
|
+
function createSplitPolygons(rectangle, ellipsoid, arcType, perPositionHeight) {
|
|
1399
|
+
return (polygons, results) => {
|
|
1400
|
+
if (
|
|
1401
|
+
!perPositionHeight &&
|
|
1402
|
+
(rectangle.height >= CesiumMath.PI_OVER_TWO ||
|
|
1403
|
+
rectangle.width >= 2 * CesiumMath.PI_OVER_THREE)
|
|
1404
|
+
) {
|
|
1405
|
+
return PolygonGeometryLibrary.splitPolygonsOnEquator(
|
|
1406
|
+
polygons,
|
|
1407
|
+
ellipsoid,
|
|
1408
|
+
arcType,
|
|
1409
|
+
results
|
|
1410
|
+
);
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
return polygons;
|
|
1414
|
+
};
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
function computeBoundingRectangle(outerRing, rectangle, ellipsoid, stRotation) {
|
|
1418
|
+
if (rectangle.height >= CesiumMath.PI || rectangle.width >= CesiumMath.PI) {
|
|
1419
|
+
return BoundingRectangle.fromRectangle(
|
|
1420
|
+
rectangle,
|
|
1421
|
+
undefined,
|
|
1422
|
+
scratchBoundingRectangle
|
|
1423
|
+
);
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
const outerPositions = outerRing;
|
|
1427
|
+
const tangentPlane = EllipsoidTangentPlane.fromPoints(
|
|
1428
|
+
outerPositions,
|
|
1429
|
+
ellipsoid
|
|
1430
|
+
);
|
|
1431
|
+
return PolygonGeometryLibrary.computeBoundingRectangle(
|
|
1432
|
+
tangentPlane.plane.normal,
|
|
1433
|
+
tangentPlane.projectPointOntoPlane.bind(tangentPlane),
|
|
1434
|
+
outerPositions,
|
|
1435
|
+
stRotation,
|
|
1436
|
+
scratchBoundingRectangle
|
|
1437
|
+
);
|
|
1438
|
+
}
|
|
1439
|
+
|
|
1124
1440
|
/**
|
|
1125
1441
|
* Computes the geometric representation of a polygon, including its vertices, indices, and a bounding sphere.
|
|
1126
1442
|
*
|
|
@@ -1141,22 +1457,19 @@ PolygonGeometry.createGeometry = function (polygonGeometry) {
|
|
|
1141
1457
|
|
|
1142
1458
|
const hasTextureCoordinates = defined(textureCoordinates);
|
|
1143
1459
|
|
|
1144
|
-
|
|
1460
|
+
const outerPositions = polygonHierarchy.positions;
|
|
1145
1461
|
if (outerPositions.length < 3) {
|
|
1146
1462
|
return;
|
|
1147
1463
|
}
|
|
1148
1464
|
|
|
1149
|
-
const
|
|
1150
|
-
outerPositions,
|
|
1151
|
-
ellipsoid
|
|
1152
|
-
);
|
|
1153
|
-
|
|
1465
|
+
const rectangle = polygonGeometry.rectangle;
|
|
1154
1466
|
const results = PolygonGeometryLibrary.polygonsFromHierarchy(
|
|
1155
1467
|
polygonHierarchy,
|
|
1156
1468
|
hasTextureCoordinates,
|
|
1157
|
-
|
|
1469
|
+
createProjectTo2d(rectangle, ellipsoid),
|
|
1158
1470
|
!perPositionHeight,
|
|
1159
|
-
ellipsoid
|
|
1471
|
+
ellipsoid,
|
|
1472
|
+
createSplitPolygons(rectangle, ellipsoid, arcType, perPositionHeight)
|
|
1160
1473
|
);
|
|
1161
1474
|
|
|
1162
1475
|
const hierarchy = results.hierarchy;
|
|
@@ -1171,7 +1484,8 @@ PolygonGeometry.createGeometry = function (polygonGeometry) {
|
|
|
1171
1484
|
textureCoordinates,
|
|
1172
1485
|
true,
|
|
1173
1486
|
dummyFunction,
|
|
1174
|
-
false
|
|
1487
|
+
false,
|
|
1488
|
+
ellipsoid
|
|
1175
1489
|
).polygons
|
|
1176
1490
|
: undefined;
|
|
1177
1491
|
|
|
@@ -1179,13 +1493,12 @@ PolygonGeometry.createGeometry = function (polygonGeometry) {
|
|
|
1179
1493
|
return;
|
|
1180
1494
|
}
|
|
1181
1495
|
|
|
1182
|
-
|
|
1183
|
-
const boundingRectangle =
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
stRotation
|
|
1188
|
-
scratchBoundingRectangle
|
|
1496
|
+
const outerRing = hierarchy[0].outerRing;
|
|
1497
|
+
const boundingRectangle = computeBoundingRectangle(
|
|
1498
|
+
outerRing,
|
|
1499
|
+
rectangle,
|
|
1500
|
+
ellipsoid,
|
|
1501
|
+
stRotation
|
|
1189
1502
|
);
|
|
1190
1503
|
|
|
1191
1504
|
const geometries = [];
|
|
@@ -1200,7 +1513,8 @@ PolygonGeometry.createGeometry = function (polygonGeometry) {
|
|
|
1200
1513
|
perPositionHeight: perPositionHeight,
|
|
1201
1514
|
vertexFormat: vertexFormat,
|
|
1202
1515
|
geometry: undefined,
|
|
1203
|
-
|
|
1516
|
+
rotationAxis: getTangentPlane(rectangle, outerRing, ellipsoid).plane.normal,
|
|
1517
|
+
projectTo2d: createProjectPositionTo2d(rectangle, outerRing, ellipsoid),
|
|
1204
1518
|
boundingRectangle: boundingRectangle,
|
|
1205
1519
|
ellipsoid: ellipsoid,
|
|
1206
1520
|
stRotation: stRotation,
|
|
@@ -1407,11 +1721,10 @@ Object.defineProperties(PolygonGeometry.prototype, {
|
|
|
1407
1721
|
get: function () {
|
|
1408
1722
|
if (!defined(this._rectangle)) {
|
|
1409
1723
|
const positions = this._polygonHierarchy.positions;
|
|
1410
|
-
this._rectangle =
|
|
1724
|
+
this._rectangle = PolygonGeometry.computeRectangleFromPositions(
|
|
1411
1725
|
positions,
|
|
1412
1726
|
this._ellipsoid,
|
|
1413
|
-
this._arcType
|
|
1414
|
-
this._granularity
|
|
1727
|
+
this._arcType
|
|
1415
1728
|
);
|
|
1416
1729
|
}
|
|
1417
1730
|
|