@cesium/engine 2.2.0 → 2.4.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/Workers/{AttributeCompression-8a5a065e.js → AttributeCompression-f9f6c717.js} +1 -1
- package/Build/Workers/{AxisAlignedBoundingBox-379015ef.js → AxisAlignedBoundingBox-4bfd84f3.js} +1 -1
- package/Build/Workers/{BoundingRectangle-57f2b24f.js → BoundingRectangle-5fd6403a.js} +1 -1
- package/Build/Workers/{BoxGeometry-ecabfc78.js → BoxGeometry-af7d05ef.js} +1 -1
- package/Build/Workers/{Color-14d1a36d.js → Color-e5bfda3f.js} +1 -1
- package/Build/Workers/{CoplanarPolygonGeometryLibrary-048c3c14.js → CoplanarPolygonGeometryLibrary-59c69b0a.js} +1 -1
- package/Build/Workers/{CorridorGeometryLibrary-520c8619.js → CorridorGeometryLibrary-63907365.js} +1 -1
- package/Build/Workers/{CylinderGeometry-119068b8.js → CylinderGeometry-dbaa1678.js} +1 -1
- package/Build/Workers/{CylinderGeometryLibrary-135b0858.js → CylinderGeometryLibrary-7bf291b4.js} +1 -1
- package/Build/Workers/{EllipseGeometry-2dfc3523.js → EllipseGeometry-6508b78b.js} +1 -1
- package/Build/Workers/{EllipseGeometryLibrary-0a1e0170.js → EllipseGeometryLibrary-21262a28.js} +1 -1
- package/Build/Workers/{EllipseOutlineGeometry-c5251669.js → EllipseOutlineGeometry-2a2510bb.js} +1 -1
- package/Build/Workers/{EllipsoidGeodesic-dcff5cbd.js → EllipsoidGeodesic-5b3623dc.js} +1 -1
- package/Build/Workers/{EllipsoidGeometry-d10a5221.js → EllipsoidGeometry-8155e3a2.js} +1 -1
- package/Build/Workers/{EllipsoidOutlineGeometry-7039a0ae.js → EllipsoidOutlineGeometry-c045678d.js} +1 -1
- package/Build/Workers/{EllipsoidRhumbLine-b672d507.js → EllipsoidRhumbLine-ef872433.js} +1 -1
- package/Build/Workers/{EllipsoidTangentPlane-857186be.js → EllipsoidTangentPlane-546c0d5e.js} +1 -1
- package/Build/Workers/{EncodedCartesian3-e8bbca36.js → EncodedCartesian3-57415c8a.js} +1 -1
- package/Build/Workers/{FrustumGeometry-400fa1b7.js → FrustumGeometry-d3ff16d0.js} +31 -3
- package/Build/Workers/{GeometryAttribute-7a2de5c6.js → GeometryAttribute-13da9466.js} +1 -1
- package/Build/Workers/{GeometryInstance-3fb607b7.js → GeometryInstance-34d9e21e.js} +1 -1
- package/Build/Workers/{GeometryPipeline-916636fa.js → GeometryPipeline-03bc5709.js} +1 -1
- package/Build/Workers/{IndexDatatype-b8f3e09d.js → IndexDatatype-2643aa47.js} +1 -1
- package/Build/Workers/{IntersectionTests-b4d02d4d.js → IntersectionTests-85350792.js} +1 -1
- package/Build/Workers/{Math-dad82b4d.js → Math-0a2ac845.js} +12 -2
- package/Build/Workers/{Matrix2-1e403d0e.js → Matrix2-e1298525.js} +1 -1
- package/Build/Workers/{Matrix3-fa806b97.js → Matrix3-41c58dde.js} +1 -1
- package/Build/Workers/{OrientedBoundingBox-96fe1752.js → OrientedBoundingBox-29fb0fcd.js} +1 -1
- package/Build/Workers/{Plane-c27e1ac6.js → Plane-4c3d403b.js} +1 -1
- package/Build/Workers/{PolygonGeometryLibrary-931f1ec6.js → PolygonGeometryLibrary-d447448d.js} +1 -1
- package/Build/Workers/PolygonPipeline-460cce4e.js +1344 -0
- package/Build/Workers/{PolylinePipeline-6d5c63e5.js → PolylinePipeline-7119eb3f.js} +1 -1
- package/Build/Workers/{PolylineVolumeGeometryLibrary-f068c1fb.js → PolylineVolumeGeometryLibrary-d25f0050.js} +1 -1
- package/Build/Workers/{PrimitivePipeline-879f996a.js → PrimitivePipeline-e648752b.js} +1 -1
- package/Build/Workers/{RectangleGeometryLibrary-2d6f36f3.js → RectangleGeometryLibrary-bb378fb6.js} +1 -1
- package/Build/Workers/{TerrainEncoding-82882059.js → TerrainEncoding-c8e029a2.js} +1 -1
- package/Build/Workers/Transforms-e2d4a55a.js +14713 -0
- package/Build/Workers/{WallGeometryLibrary-db7a64fb.js → WallGeometryLibrary-3e0819ec.js} +1 -1
- package/Build/Workers/{WebMercatorProjection-76a3fcc0.js → WebMercatorProjection-13ed1a6e.js} +1 -1
- package/Build/Workers/{arrayRemoveDuplicates-fac118a8.js → arrayRemoveDuplicates-d2061e85.js} +1 -1
- package/Build/Workers/cesiumWorkerBootstrapper.js +1 -1
- package/Build/Workers/combineGeometry.js +1 -1
- package/Build/Workers/createBoxGeometry.js +1 -1
- package/Build/Workers/createBoxOutlineGeometry.js +1 -1
- package/Build/Workers/createCircleGeometry.js +1 -1
- package/Build/Workers/createCircleOutlineGeometry.js +1 -1
- package/Build/Workers/createCoplanarPolygonGeometry.js +1 -1
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +1 -1
- package/Build/Workers/createCorridorGeometry.js +1 -1
- package/Build/Workers/createCorridorOutlineGeometry.js +1 -1
- package/Build/Workers/createCylinderGeometry.js +1 -1
- package/Build/Workers/createCylinderOutlineGeometry.js +1 -1
- package/Build/Workers/createEllipseGeometry.js +1 -1
- package/Build/Workers/createEllipseOutlineGeometry.js +1 -1
- package/Build/Workers/createEllipsoidGeometry.js +1 -1
- package/Build/Workers/createEllipsoidOutlineGeometry.js +1 -1
- package/Build/Workers/createFrustumGeometry.js +1 -1
- package/Build/Workers/createFrustumOutlineGeometry.js +1 -1
- package/Build/Workers/createGeometry.js +1 -1
- package/Build/Workers/createGroundPolylineGeometry.js +1 -1
- package/Build/Workers/createPlaneGeometry.js +1 -1
- package/Build/Workers/createPlaneOutlineGeometry.js +1 -1
- package/Build/Workers/createPolygonGeometry.js +1 -1
- package/Build/Workers/createPolygonOutlineGeometry.js +1 -1
- package/Build/Workers/createPolylineGeometry.js +1 -1
- package/Build/Workers/createPolylineVolumeGeometry.js +1 -1
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +1 -1
- package/Build/Workers/createRectangleGeometry.js +1 -1
- package/Build/Workers/createRectangleOutlineGeometry.js +1 -1
- package/Build/Workers/createSimplePolylineGeometry.js +1 -1
- package/Build/Workers/createSphereGeometry.js +1 -1
- package/Build/Workers/createSphereOutlineGeometry.js +1 -1
- package/Build/Workers/createVectorTileClampedPolylines.js +1 -1
- package/Build/Workers/createVectorTileGeometries.js +1 -1
- package/Build/Workers/createVectorTilePoints.js +1 -1
- package/Build/Workers/createVectorTilePolygons.js +1 -1
- package/Build/Workers/createVectorTilePolylines.js +1 -1
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +1 -1
- package/Build/Workers/createVerticesFromHeightmap.js +5 -8
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +1 -1
- package/Build/Workers/createWallGeometry.js +1 -1
- package/Build/Workers/createWallOutlineGeometry.js +1 -1
- package/Build/Workers/decodeDraco.js +1 -1
- package/Build/Workers/decodeI3S.js +1 -1
- package/Build/Workers/package.js +1 -1
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +1 -1
- package/Source/Core/BingMapsGeocoderService.js +19 -1
- package/Source/Core/CartographicGeocoderService.js +15 -0
- package/Source/Core/Credit.js +1 -1
- package/Source/Core/FrustumGeometry.js +3 -2
- package/Source/Core/GeocoderService.js +32 -1
- package/Source/Core/GoogleMaps.js +56 -0
- package/Source/Core/Ion.js +2 -1
- package/Source/Core/IonGeocoderService.js +17 -2
- package/Source/Core/OpenCageGeocoderService.js +18 -1
- package/Source/Core/OrthographicFrustum.js +13 -0
- package/Source/Core/PeliasGeocoderService.js +14 -1
- package/Source/Core/PerspectiveFrustum.js +14 -0
- package/Source/Core/Request.js +3 -2
- package/Source/Core/RequestScheduler.js +10 -4
- package/Source/Core/Resource.js +240 -233
- package/Source/DataSources/DataSourceDisplay.js +2 -2
- package/Source/DataSources/EntityCluster.js +126 -128
- package/Source/DataSources/ModelVisualizer.js +5 -3
- package/Source/Renderer/UniformState.js +3 -2
- package/Source/Renderer/demodernizeShader.js +5 -5
- package/Source/Scene/ArcGisBaseMapType.js +12 -0
- package/Source/Scene/ArcGisMapServerImageryProvider.js +162 -20
- package/Source/Scene/ArcGisMapService.js +84 -0
- package/Source/Scene/Camera.js +8 -7
- package/Source/Scene/Cesium3DTile.js +4 -3
- package/Source/Scene/Cesium3DTileset.js +6 -5
- package/Source/Scene/CreditDisplay.js +112 -16
- package/Source/Scene/GlobeSurfaceTileProvider.js +4 -4
- package/Source/Scene/GltfJsonLoader.js +12 -0
- package/Source/Scene/GltfLoader.js +6 -37
- package/Source/Scene/IonImageryProvider.js +11 -11
- package/Source/Scene/Model/MaterialPipelineStage.js +12 -12
- package/Source/Scene/Model/Model.js +90 -47
- package/Source/Scene/Model/UniformType.js +1 -1
- package/Source/Scene/Picking.js +3 -2
- package/Source/Scene/QuadtreePrimitive.js +3 -2
- package/Source/Scene/SceneTransforms.js +3 -2
- package/Source/Scene/ScreenSpaceCameraController.js +140 -32
- package/Source/Scene/Vector3DTilePoints.js +25 -13
- package/Source/Scene/createGooglePhotorealistic3DTileset.js +53 -0
- package/Source/Shaders/AtmosphereCommon.glsl +51 -8
- package/Source/Shaders/AtmosphereCommon.js +51 -8
- package/Source/Shaders/PostProcessStages/AmbientOcclusionGenerate.glsl +1 -1
- package/Source/Shaders/PostProcessStages/AmbientOcclusionGenerate.js +1 -1
- package/Source/Shaders/PostProcessStages/AmbientOcclusionModulate.glsl +3 -3
- package/Source/Shaders/PostProcessStages/AmbientOcclusionModulate.js +3 -3
- package/Source/Widget/CesiumWidget.js +12 -0
- package/index.d.ts +244 -17
- package/index.js +14 -10
- package/package.json +4 -4
- package/Build/Workers/PolygonPipeline-32fc92cc.js +0 -1345
- package/Build/Workers/Transforms-9052372a.js +0 -14715
|
@@ -76,14 +76,6 @@ function EntityCluster(options) {
|
|
|
76
76
|
this.show = defaultValue(options.show, true);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
function getX(point) {
|
|
80
|
-
return point.coord.x;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
function getY(point) {
|
|
84
|
-
return point.coord.y;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
79
|
function expandBoundingBox(bbox, pixelRange) {
|
|
88
80
|
bbox.x -= pixelRange;
|
|
89
81
|
bbox.y -= pixelRange;
|
|
@@ -335,153 +327,159 @@ function createDeclutterCallback(entityCluster) {
|
|
|
335
327
|
let collection;
|
|
336
328
|
let collectionIndex;
|
|
337
329
|
|
|
338
|
-
|
|
330
|
+
if (points.length > 0) {
|
|
331
|
+
const index = new KDBush(points.length, 64, Uint32Array);
|
|
332
|
+
for (let p = 0; p < points.length; ++p) {
|
|
333
|
+
index.add(points[p].coord.x, points[p].coord.y);
|
|
334
|
+
}
|
|
335
|
+
index.finish();
|
|
339
336
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
337
|
+
if (currentHeight < previousHeight) {
|
|
338
|
+
length = clusters.length;
|
|
339
|
+
for (i = 0; i < length; ++i) {
|
|
340
|
+
const cluster = clusters[i];
|
|
344
341
|
|
|
345
|
-
|
|
346
|
-
|
|
342
|
+
if (!occluder.isPointVisible(cluster.position)) {
|
|
343
|
+
continue;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
const coord = Billboard._computeScreenSpacePosition(
|
|
347
|
+
Matrix4.IDENTITY,
|
|
348
|
+
cluster.position,
|
|
349
|
+
Cartesian3.ZERO,
|
|
350
|
+
Cartesian2.ZERO,
|
|
351
|
+
scene
|
|
352
|
+
);
|
|
353
|
+
if (!defined(coord)) {
|
|
354
|
+
continue;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
const factor = 1.0 - currentHeight / previousHeight;
|
|
358
|
+
let width = (cluster.width = cluster.width * factor);
|
|
359
|
+
let height = (cluster.height = cluster.height * factor);
|
|
360
|
+
|
|
361
|
+
width = Math.max(width, cluster.minimumWidth);
|
|
362
|
+
height = Math.max(height, cluster.minimumHeight);
|
|
363
|
+
|
|
364
|
+
const minX = coord.x - width * 0.5;
|
|
365
|
+
const minY = coord.y - height * 0.5;
|
|
366
|
+
const maxX = coord.x + width;
|
|
367
|
+
const maxY = coord.y + height;
|
|
368
|
+
|
|
369
|
+
neighbors = index.range(minX, minY, maxX, maxY);
|
|
370
|
+
neighborLength = neighbors.length;
|
|
371
|
+
numPoints = 0;
|
|
372
|
+
ids = [];
|
|
373
|
+
|
|
374
|
+
for (j = 0; j < neighborLength; ++j) {
|
|
375
|
+
neighborIndex = neighbors[j];
|
|
376
|
+
neighborPoint = points[neighborIndex];
|
|
377
|
+
if (!neighborPoint.clustered) {
|
|
378
|
+
++numPoints;
|
|
379
|
+
|
|
380
|
+
collection = neighborPoint.collection;
|
|
381
|
+
collectionIndex = neighborPoint.index;
|
|
382
|
+
ids.push(collection.get(collectionIndex).id);
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
if (numPoints >= minimumClusterSize) {
|
|
387
|
+
addCluster(cluster.position, numPoints, ids, entityCluster);
|
|
388
|
+
newClusters.push(cluster);
|
|
389
|
+
|
|
390
|
+
for (j = 0; j < neighborLength; ++j) {
|
|
391
|
+
points[neighbors[j]].clustered = true;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
347
394
|
}
|
|
395
|
+
}
|
|
348
396
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
Cartesian2.ZERO,
|
|
354
|
-
scene
|
|
355
|
-
);
|
|
356
|
-
if (!defined(coord)) {
|
|
397
|
+
length = points.length;
|
|
398
|
+
for (i = 0; i < length; ++i) {
|
|
399
|
+
const point = points[i];
|
|
400
|
+
if (point.clustered) {
|
|
357
401
|
continue;
|
|
358
402
|
}
|
|
359
403
|
|
|
360
|
-
|
|
361
|
-
let width = (cluster.width = cluster.width * factor);
|
|
362
|
-
let height = (cluster.height = cluster.height * factor);
|
|
404
|
+
point.clustered = true;
|
|
363
405
|
|
|
364
|
-
|
|
365
|
-
|
|
406
|
+
collection = point.collection;
|
|
407
|
+
collectionIndex = point.index;
|
|
366
408
|
|
|
367
|
-
const
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
409
|
+
const item = collection.get(collectionIndex);
|
|
410
|
+
bbox = getBoundingBox(
|
|
411
|
+
item,
|
|
412
|
+
point.coord,
|
|
413
|
+
pixelRange,
|
|
414
|
+
entityCluster,
|
|
415
|
+
pointBoundinRectangleScratch
|
|
416
|
+
);
|
|
417
|
+
const totalBBox = BoundingRectangle.clone(
|
|
418
|
+
bbox,
|
|
419
|
+
totalBoundingRectangleScratch
|
|
420
|
+
);
|
|
371
421
|
|
|
372
|
-
neighbors = index.range(
|
|
422
|
+
neighbors = index.range(
|
|
423
|
+
bbox.x,
|
|
424
|
+
bbox.y,
|
|
425
|
+
bbox.x + bbox.width,
|
|
426
|
+
bbox.y + bbox.height
|
|
427
|
+
);
|
|
373
428
|
neighborLength = neighbors.length;
|
|
374
|
-
|
|
375
|
-
|
|
429
|
+
|
|
430
|
+
const clusterPosition = Cartesian3.clone(item.position);
|
|
431
|
+
numPoints = 1;
|
|
432
|
+
ids = [item.id];
|
|
376
433
|
|
|
377
434
|
for (j = 0; j < neighborLength; ++j) {
|
|
378
435
|
neighborIndex = neighbors[j];
|
|
379
436
|
neighborPoint = points[neighborIndex];
|
|
380
437
|
if (!neighborPoint.clustered) {
|
|
438
|
+
const neighborItem = neighborPoint.collection.get(
|
|
439
|
+
neighborPoint.index
|
|
440
|
+
);
|
|
441
|
+
const neighborBBox = getBoundingBox(
|
|
442
|
+
neighborItem,
|
|
443
|
+
neighborPoint.coord,
|
|
444
|
+
pixelRange,
|
|
445
|
+
entityCluster,
|
|
446
|
+
neighborBoundingRectangleScratch
|
|
447
|
+
);
|
|
448
|
+
|
|
449
|
+
Cartesian3.add(
|
|
450
|
+
neighborItem.position,
|
|
451
|
+
clusterPosition,
|
|
452
|
+
clusterPosition
|
|
453
|
+
);
|
|
454
|
+
|
|
455
|
+
BoundingRectangle.union(totalBBox, neighborBBox, totalBBox);
|
|
381
456
|
++numPoints;
|
|
382
457
|
|
|
383
|
-
|
|
384
|
-
collectionIndex = neighborPoint.index;
|
|
385
|
-
ids.push(collection.get(collectionIndex).id);
|
|
458
|
+
ids.push(neighborItem.id);
|
|
386
459
|
}
|
|
387
460
|
}
|
|
388
461
|
|
|
389
462
|
if (numPoints >= minimumClusterSize) {
|
|
390
|
-
|
|
391
|
-
newClusters.push(cluster);
|
|
392
|
-
|
|
393
|
-
for (j = 0; j < neighborLength; ++j) {
|
|
394
|
-
points[neighbors[j]].clustered = true;
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
length = points.length;
|
|
401
|
-
for (i = 0; i < length; ++i) {
|
|
402
|
-
const point = points[i];
|
|
403
|
-
if (point.clustered) {
|
|
404
|
-
continue;
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
point.clustered = true;
|
|
408
|
-
|
|
409
|
-
collection = point.collection;
|
|
410
|
-
collectionIndex = point.index;
|
|
411
|
-
|
|
412
|
-
const item = collection.get(collectionIndex);
|
|
413
|
-
bbox = getBoundingBox(
|
|
414
|
-
item,
|
|
415
|
-
point.coord,
|
|
416
|
-
pixelRange,
|
|
417
|
-
entityCluster,
|
|
418
|
-
pointBoundinRectangleScratch
|
|
419
|
-
);
|
|
420
|
-
const totalBBox = BoundingRectangle.clone(
|
|
421
|
-
bbox,
|
|
422
|
-
totalBoundingRectangleScratch
|
|
423
|
-
);
|
|
424
|
-
|
|
425
|
-
neighbors = index.range(
|
|
426
|
-
bbox.x,
|
|
427
|
-
bbox.y,
|
|
428
|
-
bbox.x + bbox.width,
|
|
429
|
-
bbox.y + bbox.height
|
|
430
|
-
);
|
|
431
|
-
neighborLength = neighbors.length;
|
|
432
|
-
|
|
433
|
-
const clusterPosition = Cartesian3.clone(item.position);
|
|
434
|
-
numPoints = 1;
|
|
435
|
-
ids = [item.id];
|
|
436
|
-
|
|
437
|
-
for (j = 0; j < neighborLength; ++j) {
|
|
438
|
-
neighborIndex = neighbors[j];
|
|
439
|
-
neighborPoint = points[neighborIndex];
|
|
440
|
-
if (!neighborPoint.clustered) {
|
|
441
|
-
const neighborItem = neighborPoint.collection.get(
|
|
442
|
-
neighborPoint.index
|
|
443
|
-
);
|
|
444
|
-
const neighborBBox = getBoundingBox(
|
|
445
|
-
neighborItem,
|
|
446
|
-
neighborPoint.coord,
|
|
447
|
-
pixelRange,
|
|
448
|
-
entityCluster,
|
|
449
|
-
neighborBoundingRectangleScratch
|
|
450
|
-
);
|
|
451
|
-
|
|
452
|
-
Cartesian3.add(
|
|
453
|
-
neighborItem.position,
|
|
463
|
+
const position = Cartesian3.multiplyByScalar(
|
|
454
464
|
clusterPosition,
|
|
465
|
+
1.0 / numPoints,
|
|
455
466
|
clusterPosition
|
|
456
467
|
);
|
|
468
|
+
addCluster(position, numPoints, ids, entityCluster);
|
|
469
|
+
newClusters.push({
|
|
470
|
+
position: position,
|
|
471
|
+
width: totalBBox.width,
|
|
472
|
+
height: totalBBox.height,
|
|
473
|
+
minimumWidth: bbox.width,
|
|
474
|
+
minimumHeight: bbox.height,
|
|
475
|
+
});
|
|
457
476
|
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
if (numPoints >= minimumClusterSize) {
|
|
466
|
-
const position = Cartesian3.multiplyByScalar(
|
|
467
|
-
clusterPosition,
|
|
468
|
-
1.0 / numPoints,
|
|
469
|
-
clusterPosition
|
|
470
|
-
);
|
|
471
|
-
addCluster(position, numPoints, ids, entityCluster);
|
|
472
|
-
newClusters.push({
|
|
473
|
-
position: position,
|
|
474
|
-
width: totalBBox.width,
|
|
475
|
-
height: totalBBox.height,
|
|
476
|
-
minimumWidth: bbox.width,
|
|
477
|
-
minimumHeight: bbox.height,
|
|
478
|
-
});
|
|
479
|
-
|
|
480
|
-
for (j = 0; j < neighborLength; ++j) {
|
|
481
|
-
points[neighbors[j]].clustered = true;
|
|
477
|
+
for (j = 0; j < neighborLength; ++j) {
|
|
478
|
+
points[neighbors[j]].clustered = true;
|
|
479
|
+
}
|
|
480
|
+
} else {
|
|
481
|
+
addNonClusteredItem(item, entityCluster);
|
|
482
482
|
}
|
|
483
|
-
} else {
|
|
484
|
-
addNonClusteredItem(item, entityCluster);
|
|
485
483
|
}
|
|
486
484
|
}
|
|
487
485
|
|
|
@@ -63,6 +63,7 @@ function ModelVisualizer(scene, entityCollection) {
|
|
|
63
63
|
this._entityCollection = entityCollection;
|
|
64
64
|
this._modelHash = {};
|
|
65
65
|
this._entitiesToVisualize = new AssociativeArray();
|
|
66
|
+
|
|
66
67
|
this._onCollectionChanged(entityCollection, entityCollection.values, [], []);
|
|
67
68
|
}
|
|
68
69
|
|
|
@@ -444,11 +445,12 @@ ModelVisualizer.prototype.getBoundingSphere = function (entity, result) {
|
|
|
444
445
|
|
|
445
446
|
const scene = this._scene;
|
|
446
447
|
const globe = scene.globe;
|
|
447
|
-
const ellipsoid = globe.ellipsoid;
|
|
448
|
-
const terrainProvider = globe.terrainProvider;
|
|
449
448
|
|
|
449
|
+
// cannot access a terrain provider if there is no globe; formally set to undefined
|
|
450
|
+
const terrainProvider = defined(globe) ? globe.terrainProvider : undefined;
|
|
450
451
|
const hasHeightReference = model.heightReference !== HeightReference.NONE;
|
|
451
|
-
if (hasHeightReference) {
|
|
452
|
+
if (defined(globe) && hasHeightReference) {
|
|
453
|
+
const ellipsoid = globe.ellipsoid;
|
|
452
454
|
// We cannot query the availability of the terrain provider till its ready, so the
|
|
453
455
|
// bounding sphere state will remain pending till the terrain provider is ready.
|
|
454
456
|
// ready is deprecated. This is here for backwards compatibility
|
|
@@ -1173,8 +1173,9 @@ UniformState.prototype.updateFrustum = function (frustum) {
|
|
|
1173
1173
|
this._oneOverLog2FarDepthFromNearPlusOne =
|
|
1174
1174
|
1.0 / this._log2FarDepthFromNearPlusOne;
|
|
1175
1175
|
|
|
1176
|
-
|
|
1177
|
-
|
|
1176
|
+
const offCenterFrustum = frustum.offCenterFrustum;
|
|
1177
|
+
if (defined(offCenterFrustum)) {
|
|
1178
|
+
frustum = offCenterFrustum;
|
|
1178
1179
|
}
|
|
1179
1180
|
|
|
1180
1181
|
this._frustumPlanes.x = frustum.top;
|
|
@@ -41,16 +41,16 @@ function demodernizeShader(input, isFragmentShader) {
|
|
|
41
41
|
output = output.replaceAll(/out_FragData_(\d+)/g, `gl_FragData[$1]`);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
// Replace out_FragColor with gl_FragColor.
|
|
45
|
-
output = output.replaceAll(/out_FragColor/g, `gl_FragColor`);
|
|
46
|
-
output = output.replaceAll(/out_FragColor\[(\d+)\]/g, `gl_FragColor[$1]`);
|
|
47
|
-
|
|
48
44
|
// Remove all layout declarations for out_FragColor.
|
|
49
45
|
output = output.replaceAll(
|
|
50
|
-
/layout\s+\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor
|
|
46
|
+
/layout\s+\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,
|
|
51
47
|
``
|
|
52
48
|
);
|
|
53
49
|
|
|
50
|
+
// Replace out_FragColor with gl_FragColor.
|
|
51
|
+
output = output.replaceAll(/out_FragColor/g, `gl_FragColor`);
|
|
52
|
+
output = output.replaceAll(/out_FragColor\[(\d+)\]/g, `gl_FragColor[$1]`);
|
|
53
|
+
|
|
54
54
|
if (/gl_FragDepth/.test(output)) {
|
|
55
55
|
output = `#extension GL_EXT_frag_depth : enable\n${output}`;
|
|
56
56
|
// Replace gl_FragDepth with gl_FragDepthEXT.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ArcGisBaseMapType enumerates the ArcGIS image tile layers that are supported by default.
|
|
3
|
+
*
|
|
4
|
+
* @enum {number}
|
|
5
|
+
* @see ArcGisMapServerImageryProvider
|
|
6
|
+
*/
|
|
7
|
+
const ArcGisBaseMapType = {
|
|
8
|
+
SATELLITE: 1,
|
|
9
|
+
OCEANS: 2,
|
|
10
|
+
HILLSHADE: 3,
|
|
11
|
+
};
|
|
12
|
+
export default Object.freeze(ArcGisBaseMapType);
|
|
@@ -16,9 +16,12 @@ import RuntimeError from "../Core/RuntimeError.js";
|
|
|
16
16
|
import TileProviderError from "../Core/TileProviderError.js";
|
|
17
17
|
import WebMercatorProjection from "../Core/WebMercatorProjection.js";
|
|
18
18
|
import WebMercatorTilingScheme from "../Core/WebMercatorTilingScheme.js";
|
|
19
|
+
import ArcGisMapService from "./ArcGisMapService.js";
|
|
19
20
|
import DiscardMissingTileImagePolicy from "./DiscardMissingTileImagePolicy.js";
|
|
20
21
|
import ImageryLayerFeatureInfo from "./ImageryLayerFeatureInfo.js";
|
|
21
22
|
import ImageryProvider from "./ImageryProvider.js";
|
|
23
|
+
import ArcGisBaseMapType from "./ArcGisBaseMapType.js";
|
|
24
|
+
import DeveloperError from "../Core/DeveloperError.js";
|
|
22
25
|
|
|
23
26
|
/**
|
|
24
27
|
* @typedef {object} ArcGisMapServerImageryProvider.ConstructorOptions
|
|
@@ -39,8 +42,7 @@ import ImageryProvider from "./ImageryProvider.js";
|
|
|
39
42
|
* that no tiles are discarded, construct and pass a {@link NeverTileDiscardPolicy} for this
|
|
40
43
|
* parameter.
|
|
41
44
|
* @property {boolean} [usePreCachedTilesIfAvailable=true] If true, the server's pre-cached
|
|
42
|
-
* tiles are used if they are available.
|
|
43
|
-
* 'export' service is used.
|
|
45
|
+
* tiles are used if they are available. Exporting Tiles is only supported with deprecated APIs.
|
|
44
46
|
* @property {string} [layers] A comma-separated list of the layers to show, or undefined if all layers should be shown.
|
|
45
47
|
* @property {boolean} [enablePickFeatures=true] If true, {@link ArcGisMapServerImageryProvider#pickFeatures} will invoke
|
|
46
48
|
* the Identify service on the MapServer and return the features included in the response. If false,
|
|
@@ -59,6 +61,8 @@ import ImageryProvider from "./ImageryProvider.js";
|
|
|
59
61
|
* @property {number} [tileHeight=256] The height of each tile in pixels. This parameter is ignored when accessing a tiled server.
|
|
60
62
|
* @property {number} [maximumLevel] The maximum tile level to request, or undefined if there is no maximum. This parameter is ignored when accessing
|
|
61
63
|
* a tiled server.
|
|
64
|
+
*
|
|
65
|
+
*
|
|
62
66
|
*/
|
|
63
67
|
|
|
64
68
|
/**
|
|
@@ -85,6 +89,7 @@ function ImageryProviderBuilder(options) {
|
|
|
85
89
|
credit = new Credit(credit);
|
|
86
90
|
}
|
|
87
91
|
this.credit = credit;
|
|
92
|
+
this.tileCredits = undefined;
|
|
88
93
|
this.tileDiscardPolicy = options.tileDiscardPolicy;
|
|
89
94
|
|
|
90
95
|
this.tileWidth = defaultValue(options.tileWidth, 256);
|
|
@@ -104,6 +109,7 @@ ImageryProviderBuilder.prototype.build = function (provider) {
|
|
|
104
109
|
provider._tilingScheme = this.tilingScheme;
|
|
105
110
|
provider._rectangle = this.rectangle;
|
|
106
111
|
provider._credit = this.credit;
|
|
112
|
+
provider._tileCredits = this.tileCredits;
|
|
107
113
|
provider._tileDiscardPolicy = this.tileDiscardPolicy;
|
|
108
114
|
provider._tileWidth = this.tileWidth;
|
|
109
115
|
provider._tileHeight = this.tileHeight;
|
|
@@ -221,7 +227,11 @@ function metadataSuccess(data, imageryProviderBuilder) {
|
|
|
221
227
|
}
|
|
222
228
|
|
|
223
229
|
if (defined(data.copyrightText) && data.copyrightText.length > 0) {
|
|
224
|
-
imageryProviderBuilder.credit
|
|
230
|
+
if (defined(imageryProviderBuilder.credit)) {
|
|
231
|
+
imageryProviderBuilder.tileCredits = [new Credit(data.copyrightText)];
|
|
232
|
+
} else {
|
|
233
|
+
imageryProviderBuilder.credit = new Credit(data.copyrightText);
|
|
234
|
+
}
|
|
225
235
|
}
|
|
226
236
|
}
|
|
227
237
|
|
|
@@ -255,7 +265,7 @@ async function requestMetadata(resource, imageryProviderBuilder, provider) {
|
|
|
255
265
|
});
|
|
256
266
|
|
|
257
267
|
try {
|
|
258
|
-
const data = await jsonResource.
|
|
268
|
+
const data = await jsonResource.fetchJson();
|
|
259
269
|
metadataSuccess(data, imageryProviderBuilder);
|
|
260
270
|
} catch (error) {
|
|
261
271
|
metadataFailure(resource, error, provider);
|
|
@@ -264,34 +274,49 @@ async function requestMetadata(resource, imageryProviderBuilder, provider) {
|
|
|
264
274
|
|
|
265
275
|
/**
|
|
266
276
|
* <div class="notice">
|
|
267
|
-
*
|
|
277
|
+
* This object is normally not instantiated directly, use {@link ArcGisMapServerImageryProvider.fromBasemapType} or {@link ArcGisMapServerImageryProvider.fromUrl}.
|
|
268
278
|
* </div>
|
|
269
279
|
*
|
|
270
280
|
* Provides tiled imagery hosted by an ArcGIS MapServer. By default, the server's pre-cached tiles are
|
|
271
281
|
* used, if available.
|
|
282
|
+
*
|
|
283
|
+
* <br/>
|
|
284
|
+
*
|
|
285
|
+
* An {@link https://developers.arcgis.com/documentation/mapping-apis-and-services/security| ArcGIS Access Token } is required to authenticate requests to an ArcGIS Image Tile service.
|
|
286
|
+
* To access secure ArcGIS resources, it's required to create an ArcGIS developer
|
|
287
|
+
* account or an ArcGIS online account, then implement an authentication method to obtain an access token.
|
|
272
288
|
*
|
|
273
289
|
* @alias ArcGisMapServerImageryProvider
|
|
274
290
|
* @constructor
|
|
275
291
|
*
|
|
276
292
|
* @param {ArcGisMapServerImageryProvider.ConstructorOptions} [options] Object describing initialization options
|
|
277
293
|
*
|
|
278
|
-
* @see
|
|
279
|
-
* @see
|
|
280
|
-
*
|
|
281
|
-
* @
|
|
282
|
-
*
|
|
283
|
-
*
|
|
284
|
-
*
|
|
285
|
-
*
|
|
286
|
-
*
|
|
294
|
+
* @see ArcGisMapServerImageryProvider.fromBasemapType
|
|
295
|
+
* @see ArcGisMapServerImageryProvider.fromUrl
|
|
296
|
+
*
|
|
297
|
+
* @example
|
|
298
|
+
* // Set the default access token for accessing ArcGIS Image Tile service
|
|
299
|
+
* Cesium.ArcGisMapService.defaultAccessToken = "<ArcGIS Access Token>";
|
|
300
|
+
*
|
|
301
|
+
* // Add a base layer from a default ArcGIS basemap
|
|
302
|
+
* const viewer = new Cesium.Viewer("cesiumContainer", {
|
|
303
|
+
* baseLayer: Cesium.ImageryLayer.fromProviderAsync(
|
|
304
|
+
* Cesium.ArcGisMapServerImageryProvider.fromBasemapType(
|
|
305
|
+
* Cesium.ArcGisBaseMapType.SATELLITE
|
|
306
|
+
* )
|
|
307
|
+
* ),
|
|
308
|
+
* });
|
|
287
309
|
*
|
|
288
310
|
* @example
|
|
311
|
+
* // Create an imagery provider from the url directly
|
|
289
312
|
* const esri = await Cesium.ArcGisMapServerImageryProvider.fromUrl(
|
|
290
|
-
*
|
|
291
|
-
*
|
|
313
|
+
* "https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer", {
|
|
314
|
+
* token: "<ArcGIS Access Token>"
|
|
315
|
+
* });
|
|
292
316
|
*
|
|
293
317
|
* @see {@link https://developers.arcgis.com/rest/|ArcGIS Server REST API}
|
|
294
|
-
* @see {@link
|
|
318
|
+
* @see {@link https://developers.arcgis.com/documentation/mapping-apis-and-services/security| ArcGIS Access Token }
|
|
319
|
+
|
|
295
320
|
*/
|
|
296
321
|
function ArcGisMapServerImageryProvider(options) {
|
|
297
322
|
options = defaultValue(options, defaultValue.EMPTY_OBJECT);
|
|
@@ -321,7 +346,13 @@ function ArcGisMapServerImageryProvider(options) {
|
|
|
321
346
|
this._tilingScheme.rectangle
|
|
322
347
|
);
|
|
323
348
|
this._layers = options.layers;
|
|
324
|
-
this._credit =
|
|
349
|
+
this._credit = options.credit;
|
|
350
|
+
this._tileCredits = undefined;
|
|
351
|
+
|
|
352
|
+
let credit = options.credit;
|
|
353
|
+
if (typeof credit === "string") {
|
|
354
|
+
credit = new Credit(credit);
|
|
355
|
+
}
|
|
325
356
|
|
|
326
357
|
/**
|
|
327
358
|
* Gets or sets a value indicating whether feature picking is enabled. If true, {@link ArcGisMapServerImageryProvider#pickFeatures} will
|
|
@@ -371,6 +402,117 @@ function ArcGisMapServerImageryProvider(options) {
|
|
|
371
402
|
}
|
|
372
403
|
}
|
|
373
404
|
|
|
405
|
+
/**
|
|
406
|
+
* Creates an {@link ImageryProvider} which provides tiled imagery from an ArcGIS base map.
|
|
407
|
+
* @param {ArcGisBaseMapType} style The style of the ArcGIS base map imagery. Valid options are {@link ArcGisBaseMapType.SATELLITE}, {@link ArcGisBaseMapType.OCEANS}, and {@link ArcGisBaseMapType.HILLSHADE}.
|
|
408
|
+
* @param {ArcGisMapServerImageryProvider.ConstructorOptions} [options] Object describing initialization options.
|
|
409
|
+
* @returns {Promise<ArcGisMapServerImageryProvider>} A promise that resolves to the created ArcGisMapServerImageryProvider.
|
|
410
|
+
*
|
|
411
|
+
* @example
|
|
412
|
+
* // Set the default access token for accessing ArcGIS Image Tile service
|
|
413
|
+
* Cesium.ArcGisMapService.defaultAccessToken = "<ArcGIS Access Token>";
|
|
414
|
+
*
|
|
415
|
+
* // Add a base layer from a default ArcGIS basemap
|
|
416
|
+
* const provider = await Cesium.ArcGisMapServerImageryProvider.fromBasemapType(
|
|
417
|
+
* Cesium.ArcGisBaseMapType.SATELLITE);
|
|
418
|
+
*
|
|
419
|
+
* @example
|
|
420
|
+
* // Add a base layer from a default ArcGIS Basemap
|
|
421
|
+
* const viewer = new Cesium.Viewer("cesiumContainer", {
|
|
422
|
+
* baseLayer: Cesium.ImageryLayer.fromProviderAsync(
|
|
423
|
+
* Cesium.ArcGisMapServerImageryProvider.fromBasemapType(
|
|
424
|
+
* Cesium.ArcGisBaseMapType.HILLSHADE, {
|
|
425
|
+
* token: "<ArcGIS Access Token>"
|
|
426
|
+
* }
|
|
427
|
+
* )
|
|
428
|
+
* ),
|
|
429
|
+
* });
|
|
430
|
+
*/
|
|
431
|
+
|
|
432
|
+
ArcGisMapServerImageryProvider.fromBasemapType = async function (
|
|
433
|
+
style,
|
|
434
|
+
options
|
|
435
|
+
) {
|
|
436
|
+
//>>includeStart('debug', pragmas.debug);
|
|
437
|
+
Check.defined("style", style);
|
|
438
|
+
//>>includeEnd('debug');
|
|
439
|
+
|
|
440
|
+
options = defaultValue(options, defaultValue.EMPTY_OBJECT);
|
|
441
|
+
let accessToken;
|
|
442
|
+
let server;
|
|
443
|
+
let warningCredit;
|
|
444
|
+
switch (style) {
|
|
445
|
+
case ArcGisBaseMapType.SATELLITE:
|
|
446
|
+
{
|
|
447
|
+
accessToken = defaultValue(
|
|
448
|
+
options.token,
|
|
449
|
+
ArcGisMapService.defaultAccessToken
|
|
450
|
+
);
|
|
451
|
+
server = Resource.createIfNeeded(
|
|
452
|
+
defaultValue(options.url, ArcGisMapService.defaultWorldImageryServer)
|
|
453
|
+
);
|
|
454
|
+
server.appendForwardSlash();
|
|
455
|
+
const defaultTokenCredit = ArcGisMapService.getDefaultTokenCredit(
|
|
456
|
+
accessToken
|
|
457
|
+
);
|
|
458
|
+
if (defined(defaultTokenCredit)) {
|
|
459
|
+
warningCredit = Credit.clone(defaultTokenCredit);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
break;
|
|
463
|
+
case ArcGisBaseMapType.OCEANS:
|
|
464
|
+
{
|
|
465
|
+
accessToken = defaultValue(
|
|
466
|
+
options.token,
|
|
467
|
+
ArcGisMapService.defaultAccessToken
|
|
468
|
+
);
|
|
469
|
+
server = Resource.createIfNeeded(
|
|
470
|
+
defaultValue(options.url, ArcGisMapService.defaultWorldOceanServer)
|
|
471
|
+
);
|
|
472
|
+
server.appendForwardSlash();
|
|
473
|
+
const defaultTokenCredit = ArcGisMapService.getDefaultTokenCredit(
|
|
474
|
+
accessToken
|
|
475
|
+
);
|
|
476
|
+
if (defined(defaultTokenCredit)) {
|
|
477
|
+
warningCredit = Credit.clone(defaultTokenCredit);
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
break;
|
|
481
|
+
case ArcGisBaseMapType.HILLSHADE:
|
|
482
|
+
{
|
|
483
|
+
accessToken = defaultValue(
|
|
484
|
+
options.token,
|
|
485
|
+
ArcGisMapService.defaultAccessToken
|
|
486
|
+
);
|
|
487
|
+
server = Resource.createIfNeeded(
|
|
488
|
+
defaultValue(
|
|
489
|
+
options.url,
|
|
490
|
+
ArcGisMapService.defaultWorldHillshadeServer
|
|
491
|
+
)
|
|
492
|
+
);
|
|
493
|
+
server.appendForwardSlash();
|
|
494
|
+
const defaultTokenCredit = ArcGisMapService.getDefaultTokenCredit(
|
|
495
|
+
accessToken
|
|
496
|
+
);
|
|
497
|
+
if (defined(defaultTokenCredit)) {
|
|
498
|
+
warningCredit = Credit.clone(defaultTokenCredit);
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
break;
|
|
502
|
+
default:
|
|
503
|
+
//>>includeStart('debug', pragmas.debug);
|
|
504
|
+
throw new DeveloperError(`Unsupported basemap type: ${style}`);
|
|
505
|
+
//>>includeEnd('debug');
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
return ArcGisMapServerImageryProvider.fromUrl(server, {
|
|
509
|
+
...options,
|
|
510
|
+
token: accessToken,
|
|
511
|
+
credit: warningCredit,
|
|
512
|
+
usePreCachedTilesIfAvailable: true, // ArcGIS Base Map Service Layers only support Tiled views
|
|
513
|
+
});
|
|
514
|
+
};
|
|
515
|
+
|
|
374
516
|
function buildImageResource(imageryProvider, x, y, level, request) {
|
|
375
517
|
let resource;
|
|
376
518
|
if (imageryProvider._useTiles) {
|
|
@@ -413,7 +555,6 @@ function buildImageResource(imageryProvider, x, y, level, request) {
|
|
|
413
555
|
queryParameters: query,
|
|
414
556
|
});
|
|
415
557
|
}
|
|
416
|
-
|
|
417
558
|
return resource;
|
|
418
559
|
}
|
|
419
560
|
|
|
@@ -941,7 +1082,7 @@ ArcGisMapServerImageryProvider.prototype.getTileCredits = function (
|
|
|
941
1082
|
y,
|
|
942
1083
|
level
|
|
943
1084
|
) {
|
|
944
|
-
return
|
|
1085
|
+
return this._tileCredits;
|
|
945
1086
|
};
|
|
946
1087
|
|
|
947
1088
|
/**
|
|
@@ -1078,4 +1219,5 @@ ArcGisMapServerImageryProvider.prototype.pickFeatures = function (
|
|
|
1078
1219
|
return result;
|
|
1079
1220
|
});
|
|
1080
1221
|
};
|
|
1222
|
+
ArcGisMapServerImageryProvider._metadataCache = {};
|
|
1081
1223
|
export default ArcGisMapServerImageryProvider;
|