Cesium JS API
AppearanceArcGisMapServerImageryProviderArcGISTiledElevationTerrainProviderArcTypeAssociativeArrayAxisAxisAlignedBoundingBoxbarycentricCoordinatesBillboardBillboardCollectionBillboardGraphicsBillboardVisualizerbinarySearchbinarySearchComparatorBingMapsGeocoderServiceBingMapsImageryProviderBingMapsStyleBlendEquationBlendFunctionBlendingStateBlendOptionBoundingRectangleBoundingSphereBoxEmitterBoxGeometryBoxGeometryUpdaterBoxGraphicsBoxOutlineGeometrybuildModuleUrlCallbackPropertyCameraCameraEventAggregatorCameraEventTypeCartesian2Cartesian3Cartesian4CartographicCartographicGeocoderServiceCatmullRomSplineCesium3DTileCesium3DTileColorBlendModeCesium3DTileContentCesium3DTileFeatureCesium3DTilePointFeatureCesium3DTilesetCesium3DTilesetGraphicsCesium3DTilesetVisualizerCesium3DTileStyleCesium3DTilesVoxelProviderCesiumTerrainProviderCesiumWidgetCheckerboardMaterialPropertyCircleEmitterCircleGeometryCircleOutlineGeometryClassificationPrimitiveClassificationTypeClippingPlaneClippingPlaneCollectionClockClockRangeClockStepcloneCloudCollectionCloudTypeColorColorBlendModeColorGeometryInstanceAttributeColorMaterialPropertycombineComponentDatatypeCompositeEntityCollectionCompositeMaterialPropertyCompositePositionPropertyCompositePropertyCompressedTextureBufferConditionsExpressionConeEmitterConstantPositionPropertyConstantPropertyConstantSplineContextOptionsCoplanarPolygonGeometryCoplanarPolygonOutlineGeometryCornerTypeCorridorGeometryCorridorGeometryUpdaterCorridorGraphicsCorridorOutlineGeometrycreateElevationBandMaterialcreateElevationBandMaterialBandcreateElevationBandMaterialEntrycreateGuidcreateOsmBuildingscreateTangentSpaceDebugPrimitivecreateWorldImagerycreateWorldTerrainCreditCreditDisplayCubicRealPolynomialCullFaceCullingVolumeCumulusCloudCustomDataSourceCustomHeightmapTerrainProviderCustomShaderCustomShaderModeCustomShaderTranslucencyModeCylinderGeometryCylinderGeometryUpdaterCylinderGraphicsCylinderOutlineGeometryCzmlDataSourceDataSourceDataSourceClockDataSourceCollectionDataSourceDisplayDebugAppearanceDebugCameraPrimitiveDebugModelMatrixPrimitiveDefaultProxydefaultValuedefinedDepthFunctiondestroyObjectDeveloperErrorDirectionalLightDirectionUpDiscardEmptyTileImagePolicyDiscardMissingTileImagePolicyDistanceDisplayConditionDistanceDisplayConditionGeometryInstanceAttributeEasingFunctionEllipseGeometryEllipseGeometryUpdaterEllipseGraphicsEllipseOutlineGeometryEllipsoidEllipsoidGeodesicEllipsoidGeometryEllipsoidGeometryUpdaterEllipsoidGraphicsEllipsoidOutlineGeometryEllipsoidRhumbLineEllipsoidSurfaceAppearanceEllipsoidTangentPlaneEllipsoidTerrainProviderEntityEntityClusterEntityCollectionEntityViewEventEventHelperexcludesReverseAxisexportKmlexportKmlModelCallbackexportKmlResultKmlexportKmlResultKmzExpressionExtrapolationTypeFeatureDetectionFogformatErrorFrameRateMonitorFrustumGeometryFrustumOutlineGeometryFullscreenGeocoderServiceGeocodeTypeGeographicProjectionGeographicTilingSchemeGeoJsonDataSourceGeometryGeometryAttributeGeometryAttributesGeometryFactoryGeometryInstanceGeometryInstanceAttributeGeometryPipelineGeometryUpdaterGeometryVisualizergetAbsoluteUrigetBaseUrigetExtensionFromUriGetFeatureInfoFormatgetFilenameFromUrigetImagePixelsgetTimestampGlobeGlobeTranslucencyGoogleEarthEnterpriseImageryProviderGoogleEarthEnterpriseMapsProviderGoogleEarthEnterpriseMetadataGoogleEarthEnterpriseTerrainDataGoogleEarthEnterpriseTerrainProviderGpxDataSourceGregorianDateGridImageryProviderGridMaterialPropertyGroundGeometryUpdaterGroundPolylineGeometryGroundPolylinePrimitiveGroundPrimitiveHeadingPitchRangeHeadingPitchRollHeadingPitchRollValuesHeightmapEncodingHeightmapTerrainDataHeightReferenceHermitePolynomialApproximationHermiteSplineHilbertOrderHorizontalOriginI3SDataProviderI3SFeatureI3SFieldI3SGeometryI3SLayerI3SNodeImageBasedLightingImageMaterialPropertyImageryLayerImageryLayerCollectionImageryLayerFeatureInfoImageryProviderImageryTypesincludesReverseAxisIndexDatatypeIntersectIntersections2DIntersectionTestsIntervalIonIonGeocoderServiceIonImageryProviderIonResourceIonWorldImageryStyleisLeapYearIso8601JulianDateKeyboardEventModifierKmlCameraKmlDataSourceKmlFeatureDataKmlLookAtKmlTourKmlTourFlyToKmlTourWaitLabelLabelCollectionLabelGraphicsLabelStyleLabelVisualizerLagrangePolynomialApproximationLeapSecondLightLightingModelLinearApproximationLinearSplineMapboxImageryProviderMapboxStyleImageryProviderMapMode2DMapProjectionMaterialMaterialAppearanceMaterialSupportMaterialPropertyMathMatrix2Matrix3Matrix4mergeSortmergeSortComparatorMetadataClassMetadataClassPropertyMetadataComponentTypeMetadataEnumMetadataEnumValueMetadataSchemaMetadataTypeModelModelAnimationModelAnimationCollectionModelAnimationLoopModelFeatureModelGraphicsModelNodeModelVisualizerMoonMorphWeightSplineNearFarScalarNeverTileDiscardPolicyNodeTransformationPropertyobjectToQueryOccluderOpenCageGeocoderServiceOpenStreetMapImageryProviderOrientedBoundingBoxOrthographicFrustumOrthographicOffCenterFrustumPackableForInterpolationParticleParticleBurstParticleEmitterParticleSystemPathGraphicsPathVisualizerPeliasGeocoderServicePerInstanceColorAppearancePerspectiveFrustumPerspectiveOffCenterFrustumPinBuilderPixelDatatypePixelFormatPlanePlaneGeometryPlaneGeometryUpdaterPlaneGraphicsPlaneOutlineGeometryPointCloudShadingPointGraphicspointInsideTrianglePointPrimitivePointPrimitiveCollectionPointVisualizerPolygonGeometryPolygonGeometryUpdaterPolygonGraphicsPolygonHierarchyPolygonOutlineGeometryPolylinePolylineArrowMaterialPropertyPolylineCollectionPolylineColorAppearancePolylineDashMaterialPropertyPolylineGeometryPolylineGeometryUpdaterPolylineGlowMaterialPropertyPolylineGraphicsPolylineMaterialAppearancePolylineOutlineMaterialPropertyPolylineVisualizerPolylineVolumeGeometryPolylineVolumeGeometryUpdaterPolylineVolumeGraphicsPolylineVolumeOutlineGeometryPositionPropertyPositionPropertyArrayPostProcessStagePostProcessStageCollectionPostProcessStageCompositePostProcessStageLibraryPostProcessStageSampleModePrimitivePrimitiveCollectionPrimitiveTypePropertyPropertyArrayPropertyBagProxyQuadraticRealPolynomialQuantizedMeshTerrainDataQuarticRealPolynomialQuaternionQuaternionSplinequeryToObjectQueueRayreadyPromiseRectangleRectangleGeometryRectangleGeometryUpdaterRectangleGraphicsRectangleOutlineGeometryReferenceFrameReferencePropertyremoveExtensionRequestRequestErrorEventRequestSchedulerRequestStateRequestTypeResourceRuntimeErrorSampledPositionPropertySampledPropertysampleTerrainsampleTerrainMostDetailedSceneSceneModeSceneTransformsScreenSpaceCameraControllerScreenSpaceEventHandlerScreenSpaceEventTypeshaderDefinesshaderMaximumIntersectionsLengthshaderUniformsShadowMapShadowModeShowGeometryInstanceAttributeSimon1994PlanetaryPositionsSimplePolylineGeometrySingleTileImageryProviderSkyAtmosphereSkyBoxSphereEmitterSphereGeometrySphereOutlineGeometrySphericalSplineSplitDirectionStencilFunctionStencilOperationSteppedSplineStripeMaterialPropertyStripeOrientationStyleExpressionsubdivideArraySunSunLightTaskProcessorTerrainDataTerrainProviderTextureMagnificationFilterTextureMinificationFilterTextureUniformTileAvailabilityTileCoordinatesImageryProviderTileDiscardPolicyTileMapServiceImageryProviderTileProviderErrorTilingSchemeTimeDynamicImageryTimeDynamicPointCloudTimeIntervalTimeIntervalCollectionTimeIntervalCollectionPositionPropertyTimeIntervalCollectionPropertyTimeStandardTransformsTranslationRotationScaleTridiagonalSystemSolverTrustedServersUniformSpecifierUniformTypeUrlTemplateImageryProviderVaryingTypeVelocityOrientationPropertyVelocityVectorPropertyVertexFormatVerticalOriginVideoSynchronizerViewportQuadVisibilityVisualizerVoxelPrimitiveVoxelProviderVoxelShapeTypeVRTheWorldTerrainProviderWallGeometryWallGeometryUpdaterWallGraphicsWallOutlineGeometryWebGLConstantsWebGLOptionsWebMapServiceImageryProviderWebMapTileServiceImageryProviderWebMercatorProjectionWebMercatorTilingSchemeWindingOrderwriteTextToCanvasAnimationAnimationViewModelBaseLayerPickerBaseLayerPickerViewModelCesium3DTilesInspectorCesium3DTilesInspectorViewModelCesiumInspectorCesiumInspectorViewModelClockViewModelCommandcreateCommandFullscreenButtonFullscreenButtonViewModelGeocoderGeocoderViewModelHomeButtonHomeButtonViewModelInfoBoxInfoBoxViewModelNavigationHelpButtonNavigationHelpButtonViewModelPerformanceWatchdogPerformanceWatchdogViewModelProjectionPickerProjectionPickerViewModelProviderViewModelSceneModePickerSceneModePickerViewModelSelectionIndicatorSelectionIndicatorViewModelSvgPathBindingHandlerTimelineToggleButtonViewModelViewerviewerCesium3DTilesInspectorMixinviewerCesiumInspectorMixinviewerDragDropMixinviewerPerformanceWatchdogMixinviewerVoxelInspectorMixinVoxelInspectorVoxelInspectorViewModelVRButtonVRButtonViewModel

EllipsoidGraphics

EllipsoidGraphics 描述了一个椭球体,并提供了设置它的外观的属性。

示例代码

var entity = viewer.entities.add({
    position: Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
    name: 'Philadelphia',
    ellipsoid : {
        radii : new Cesium.Cartesian3(500000.0, 500000.0, 1000000.0),
        material : Cesium.Color.RED.withAlpha(0.5),
        outline : true,
        outlineColor : Cesium.Color.BLACK
    }
});

方法

init()

  • 描述:初始化一个包含默认值的 EllipsoidGraphics 实例。
  • 语法:init()
  • 返回值:无。
var ellipsoid = new Cesium.EllipsoidGraphics();
ellipsoid.init();

merge(source)

  • 描述:将传入的实例的所有属性合并到此实例中。
  • 语法:merge(source)
  • 参数:source — 一个包含要合并到此实例的属性的对象。
  • 返回值:无。
var ellipsoid1 = new Cesium.EllipsoidGraphics({
    radii: new Cesium.Cartesian3(500000.0, 500000.0, 300000.0),
    outline: true,
    outlineColor: Cesium.Color.WHITE
});

var ellipsoid2 = new Cesium.EllipsoidGraphics({
    radii: new Cesium.Cartesian3(750000.0, 750000.0, 1000000.0),
    material: Cesium.Color.RED.withAlpha(0.5),
    outline: false
});

ellipsoid1.merge(ellipsoid2);

属性

radii : Property

  • 描述:一个 Property 实例,描述椭球体三个轴的半径大小。
  • 类型:Property
  • 默认值:new Cesium.Cartesian3(1.0, 1.0, 1.0)。
  • 示例代码:
var entity = viewer.entities.add({
    position: Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
    name: 'Philadelphia',
    ellipsoid: {
        radii: new Cesium.Cartesian3(500000.0, 500000.0, 1000000.0)
    }
});

innerRadii : Property

  • 描述:一个 Property 实例,描述对于内部的椭球体来说,三个轴的半径大小。
  • 类型:Property
  • 默认值:无。
  • 示例代码:
var entity = viewer.entities.add({
    position: Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
    name: 'Philadelphia',
    ellipsoid: {
        radii: new Cesium.Cartesian3(500000.0, 500000.0, 1000000.0),
        innerRadii: new Cesium.Cartesian3(499000.0, 499000.0, 999000.0)
    }
});

minimumClock : Property

  • 描述:一个 Property 实例,描述椭球体的外形的最小的经度值(单位:弧度)。
  • 类型:Property
  • 默认值:0.0。
  • 示例代码:
var entity = viewer.entities.add({
    position: Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
    name: 'Philadelphia',
    ellipsoid: {
        radii: new Cesium.Cartesian3(500000.0, 500000.0, 1000000.0),
        material: Cesium.Color.RED.withAlpha(0.5),
        outline: true,
        outlineColor: Cesium.Color.BLACK,
        minimumClock: Cesium.Math.toRadians(45.0)
    }
});

maximumClock : Property

  • 描述:一个 Property 实例,描述椭球体的外形的最大的经度值(单位:弧度)。
  • 类型:Property
  • 默认值:Math.PI * 2.0。
  • 示例代码:
var entity = viewer.entities.add({
    position: Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
    name: 'Philadelphia',
    ellipsoid: {
        radii: new Cesium.Cartesian3(500000.0, 500000.0, 1000000.0),
        material: Cesium.Color.RED.withAlpha(0.5),
        outline: true,
        outlineColor: Cesium.Color.BLACK,
        maximumClock: Cesium.Math.toRadians(315.0)
    }
});

minimumCone : Property

  • 描述:一个 Property 实例,描述椭球体的外形的最小的纬度值(单位:弧度)。
  • 类型:Property
  • 默认值:0.0。
  • 示例代码:
var entity = viewer.entities.add({
    position: Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
    name: 'Philadelphia',
    ellipsoid: {
        radii: new Cesium.Cartesian3(500000.0, 500000.0, 1000000.0),
        material: Cesium.Color.RED.withAlpha(0.5),
        outline: true,
        outlineColor: Cesium.Color.BLACK,
        minimumCone: Cesium.Math.toRadians(30.0)
    }
});

maximumCone : Property

  • 描述:一个 Property 实例,描述椭球体的外形的最大的纬度值(单位:弧度)。
  • 类型:Property
  • 默认值:Math.PI / 2.0。
  • 示例代码:
var entity = viewer.entities.add({
    position: Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
    name: 'Philadelphia',
    ellipsoid: {
        radii: new Cesium.Cartesian3(500000.0, 500000.0, 1000000.0),
        material: Cesium.Color.RED.withAlpha(0.5),
        outline: true,
        outlineColor: Cesium.Color.BLACK,
        maximumCone: Cesium.Math.toRadians(60.0)
    }
});

stackPartitions : Property

  • 描述:一个 Property 实例,描述椭球体的垂直面分割(沿高度方向)的数量。
  • 类型:Property
  • 默认值:32。
  • 示例代码:
var entity = viewer.entities.add({
    position: Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
    name: 'Philadelphia',
    ellipsoid: {
        radii: new Cesium.Cartesian3(500000.0, 500000.0, 1000000.0),
        material: Cesium.Color.RED.withAlpha(0.5),
        outline: true,
        outlineColor: Cesium.Color.BLACK,
        stackPartitions: 16
    }
});

slicePartitions : Property

  • 描述:一个 Property 实例,描述椭球体的水平面分割(沿定义椭球体的平面)的数量。
  • 类型:Property
  • 默认值:32。
  • 示例代码:
var entity = viewer.entities.add({
    position: Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
    name: 'Philadelphia',
    ellipsoid: {
        radii: new Cesium.Cartesian3(500000.0, 500000.0, 1000000.0),
        material: Cesium.Color.RED.withAlpha(0.5),
        outline: true,
        outlineColor: Cesium.Color.BLACK,
        slicePartitions: 16
    }
});

vertexFormat : Property

  • 描述:一个 Property 实例,描述椭球体的顶点属性。
  • 类型:Property
  • 默认值:VertexFormat.POSITION_ONLY。
  • 示例代码:
var entity = viewer.entities.add({
    position: Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
    name: 'Philadelphia',
    ellipsoid: {
        radii: new Cesium.Cartesian3(500000.0, 500000.0, 1000000.0),
        material: Cesium.Color.RED.withAlpha(0.5),
        outline: true,
        outlineColor: Cesium.Color.BLACK,
        vertexFormat: Cesium.VertexFormat.POSITION_AND_NORMAL
    }
});

extrudedHeight : Property

  • 描述:一个 Property 实例,描述椭球体的外形的高度,默认为0.0。
  • 类型:Property
  • 默认值:0.0。
  • 示例代码:
var entity = viewer.entities.add({
    position: Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
    name: 'Philadelphia',
    ellipsoid: {
        radii: new Cesium.Cartesian3(500000.0, 500000.0, 1000000.0),
        material: Cesium.Color.RED.withAlpha(0.5),
        outline: true,
        outlineColor: Cesium.Color.BLACK,
        extrudedHeight: 200000.0
    }
});

fill : Property

  • 描述:一个 Property 实例,描述椭球体的外部表面是否被填充。
  • 类型:Property
  • 默认值:true。
  • 示例代码:
var entity = viewer.entities.add({
    position: Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
    name: 'Philadelphia',
    ellipsoid: {
        radii: new Cesium.Cartesian3(500000.0, 500000.0, 1000000.0),
        material: Cesium.Color.RED.withAlpha(0.5),
        outline: true,
        outlineColor: Cesium.Color.BLACK,
        fill: false
    }
});

material : MaterialProperty

  • 描述:一个 MaterialProperty 实例,描述椭球体的材质。
  • 类型:MaterialProperty
  • 默认值:new ColorMaterialProperty(Color.WHITE)。
  • 示例代码:
var entity = viewer.entities.add({
    position: Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
    name: 'Philadelphia',
    ellipsoid: {
        radii: new Cesium.Cartesian3(500000.0, 500000.0, 1000000.0),
        material : Cesium.Color.RED.withAlpha(0.5),
        outline : true,
        outlineColor : Cesium.Color.BLACK
    }
});

outline : Property

  • 描述:一个 Property 实例,描述椭球体是否显示边框。
  • 类型:Property
  • 默认值:false。
  • 示例代码:
var entity = viewer.entities.add({
    position: Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
    name: 'Philadelphia',
    ellipsoid: {
        radii: new Cesium.Cartesian3(500000.0, 500000.0, 1000000.0),
        material : Cesium.Color.RED.withAlpha(0.5),
        outline : true,
        outlineColor : Cesium.Color.BLACK
    }
});

outlineColor : Property

  • 描述:一个 Property 实例,描述椭球体的边框的颜色。
  • 类型:Property
  • 默认值:Color.WHITE。
  • 示例代码:
var entity = viewer.entities.add({
    position: Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
    name: 'Philadelphia',
    ellipsoid: {
        radii: new Cesium.Cartesian3(500000.0, 500000.0, 1000000.0),
        material : Cesium.Color.RED.withAlpha(0.5),
        outline : true,
        outlineColor : Cesium.Color.BLACK
    }
});