cesium 0.13.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.
- data/LICENSE.md +259 -0
- data/README.rdoc +90 -0
- data/Rakefile +40 -0
- data/app/assets/javascripts/Assets/Assets.profile.js +8 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_0.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_1.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_10.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_11.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_12.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_13.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_14.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_15.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_16.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_17.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_18.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_19.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_2.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_20.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_21.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_22.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_23.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_24.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_25.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_26.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_27.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_3.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_4.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_5.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_6.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_7.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_8.json +1 -0
- data/app/assets/javascripts/Assets/IAU2006_XYS/IAU2006_XYS_9.json +1 -0
- data/app/assets/javascripts/Assets/Textures/NE2_LR_LC_SR_W_DR_2048.jpg +0 -0
- data/app/assets/javascripts/Assets/Textures/SkyBox/tycho2t3_80_mx.jpg +0 -0
- data/app/assets/javascripts/Assets/Textures/SkyBox/tycho2t3_80_my.jpg +0 -0
- data/app/assets/javascripts/Assets/Textures/SkyBox/tycho2t3_80_mz.jpg +0 -0
- data/app/assets/javascripts/Assets/Textures/SkyBox/tycho2t3_80_px.jpg +0 -0
- data/app/assets/javascripts/Assets/Textures/SkyBox/tycho2t3_80_py.jpg +0 -0
- data/app/assets/javascripts/Assets/Textures/SkyBox/tycho2t3_80_pz.jpg +0 -0
- data/app/assets/javascripts/Assets/Textures/waterNormals.jpg +0 -0
- data/app/assets/javascripts/Assets/package.json +6 -0
- data/app/assets/javascripts/Cesium.js +320 -0
- data/app/assets/javascripts/Core/AnimationController.js +148 -0
- data/app/assets/javascripts/Core/AxisAlignedBoundingBox.js +243 -0
- data/app/assets/javascripts/Core/BoundingRectangle.js +364 -0
- data/app/assets/javascripts/Core/BoundingSphere.js +819 -0
- data/app/assets/javascripts/Core/BoxTessellator.js +93 -0
- data/app/assets/javascripts/Core/Cartesian2.js +762 -0
- data/app/assets/javascripts/Core/Cartesian3.js +861 -0
- data/app/assets/javascripts/Core/Cartesian4.js +762 -0
- data/app/assets/javascripts/Core/Cartographic.js +211 -0
- data/app/assets/javascripts/Core/CatmullRomSpline.js +232 -0
- data/app/assets/javascripts/Core/Clock.js +195 -0
- data/app/assets/javascripts/Core/ClockRange.js +37 -0
- data/app/assets/javascripts/Core/ClockStep.js +32 -0
- data/app/assets/javascripts/Core/Color.js +1629 -0
- data/app/assets/javascripts/Core/ComponentDatatype.js +119 -0
- data/app/assets/javascripts/Core/Core.profile.js +8 -0
- data/app/assets/javascripts/Core/CubeMapEllipsoidTessellator.js +198 -0
- data/app/assets/javascripts/Core/CubicRealPolynomial.js +251 -0
- data/app/assets/javascripts/Core/DefaultProxy.js +30 -0
- data/app/assets/javascripts/Core/DeveloperError.js +60 -0
- data/app/assets/javascripts/Core/EarthOrientationParameters.js +383 -0
- data/app/assets/javascripts/Core/EarthOrientationParametersSample.js +50 -0
- data/app/assets/javascripts/Core/Ellipsoid.js +539 -0
- data/app/assets/javascripts/Core/EllipsoidTangentPlane.js +207 -0
- data/app/assets/javascripts/Core/EllipsoidalOccluder.js +151 -0
- data/app/assets/javascripts/Core/EncodedCartesian3.js +197 -0
- data/app/assets/javascripts/Core/Enumeration.js +67 -0
- data/app/assets/javascripts/Core/Event.js +122 -0
- data/app/assets/javascripts/Core/Extent.js +383 -0
- data/app/assets/javascripts/Core/ExtentTessellator.js +384 -0
- data/app/assets/javascripts/Core/FAR.js +13 -0
- data/app/assets/javascripts/Core/FeatureDetection.js +126 -0
- data/app/assets/javascripts/Core/Fullscreen.js +235 -0
- data/app/assets/javascripts/Core/GeographicProjection.js +107 -0
- data/app/assets/javascripts/Core/HermitePolynomialApproximation.js +176 -0
- data/app/assets/javascripts/Core/HermiteSpline.js +234 -0
- data/app/assets/javascripts/Core/Iau2006XysData.js +259 -0
- data/app/assets/javascripts/Core/Iau2006XysSample.js +36 -0
- data/app/assets/javascripts/Core/IndexDatatype.js +28 -0
- data/app/assets/javascripts/Core/Intersect.js +40 -0
- data/app/assets/javascripts/Core/IntersectionTests.js +359 -0
- data/app/assets/javascripts/Core/Interval.js +27 -0
- data/app/assets/javascripts/Core/Iso8601.js +46 -0
- data/app/assets/javascripts/Core/JulianDate.js +1228 -0
- data/app/assets/javascripts/Core/KeyboardEventModifier.js +38 -0
- data/app/assets/javascripts/Core/LagrangePolynomialApproximation.js +96 -0
- data/app/assets/javascripts/Core/LeapSecond.js +158 -0
- data/app/assets/javascripts/Core/LinearApproximation.js +98 -0
- data/app/assets/javascripts/Core/Math.js +532 -0
- data/app/assets/javascripts/Core/Matrix2.js +833 -0
- data/app/assets/javascripts/Core/Matrix3.js +1099 -0
- data/app/assets/javascripts/Core/Matrix4.js +2164 -0
- data/app/assets/javascripts/Core/MeshFilters.js +568 -0
- data/app/assets/javascripts/Core/Occluder.js +474 -0
- data/app/assets/javascripts/Core/OrientationInterpolator.js +109 -0
- data/app/assets/javascripts/Core/PlaneTessellator.js +74 -0
- data/app/assets/javascripts/Core/PolygonPipeline.js +792 -0
- data/app/assets/javascripts/Core/PolylinePipeline.js +90 -0
- data/app/assets/javascripts/Core/PrimitiveType.js +80 -0
- data/app/assets/javascripts/Core/QuadraticRealPolynomial.js +146 -0
- data/app/assets/javascripts/Core/QuarticRealPolynomial.js +339 -0
- data/app/assets/javascripts/Core/Quaternion.js +947 -0
- data/app/assets/javascripts/Core/Queue.js +95 -0
- data/app/assets/javascripts/Core/Ray.js +64 -0
- data/app/assets/javascripts/Core/ReferenceFrame.js +25 -0
- data/app/assets/javascripts/Core/RequestErrorEvent.js +35 -0
- data/app/assets/javascripts/Core/RuntimeError.js +59 -0
- data/app/assets/javascripts/Core/ScreenSpaceEventHandler.js +658 -0
- data/app/assets/javascripts/Core/ScreenSpaceEventType.js +149 -0
- data/app/assets/javascripts/Core/Shapes.js +230 -0
- data/app/assets/javascripts/Core/Spherical.js +192 -0
- data/app/assets/javascripts/Core/TaskProcessor.js +131 -0
- data/app/assets/javascripts/Core/TimeConstants.js +85 -0
- data/app/assets/javascripts/Core/TimeInterval.js +305 -0
- data/app/assets/javascripts/Core/TimeIntervalCollection.js +543 -0
- data/app/assets/javascripts/Core/TimeStandard.js +31 -0
- data/app/assets/javascripts/Core/Tipsify.js +285 -0
- data/app/assets/javascripts/Core/Transforms.js +614 -0
- data/app/assets/javascripts/Core/TridiagonalSystemSolver.js +102 -0
- data/app/assets/javascripts/Core/Visibility.js +38 -0
- data/app/assets/javascripts/Core/WebMercatorProjection.js +154 -0
- data/app/assets/javascripts/Core/WindingOrder.js +40 -0
- data/app/assets/javascripts/Core/binarySearch.js +69 -0
- data/app/assets/javascripts/Core/buildModuleUrl.js +77 -0
- data/app/assets/javascripts/Core/clone.js +21 -0
- data/app/assets/javascripts/Core/combine.js +81 -0
- data/app/assets/javascripts/Core/computeSunPosition.js +116 -0
- data/app/assets/javascripts/Core/createGuid.js +25 -0
- data/app/assets/javascripts/Core/defaultValue.js +22 -0
- data/app/assets/javascripts/Core/destroyObject.js +61 -0
- data/app/assets/javascripts/Core/freezeObject.js +20 -0
- data/app/assets/javascripts/Core/getImagePixels.js +46 -0
- data/app/assets/javascripts/Core/isLeapYear.js +30 -0
- data/app/assets/javascripts/Core/jsonp.js +116 -0
- data/app/assets/javascripts/Core/loadArrayBuffer.js +76 -0
- data/app/assets/javascripts/Core/loadImage.js +85 -0
- data/app/assets/javascripts/Core/loadJson.js +54 -0
- data/app/assets/javascripts/Core/loadText.js +78 -0
- data/app/assets/javascripts/Core/loadXML.js +76 -0
- data/app/assets/javascripts/Core/package.json +6 -0
- data/app/assets/javascripts/Core/pointInsideTriangle2D.js +41 -0
- data/app/assets/javascripts/Core/requestAnimationFrame.js +61 -0
- data/app/assets/javascripts/Core/throttleRequestByServer.js +74 -0
- data/app/assets/javascripts/Core/writeTextToCanvas.js +92 -0
- data/app/assets/javascripts/DynamicScene/CompositeDynamicObjectCollection.js +254 -0
- data/app/assets/javascripts/DynamicScene/CzmlBoolean.js +57 -0
- data/app/assets/javascripts/DynamicScene/CzmlCartesian2.js +96 -0
- data/app/assets/javascripts/DynamicScene/CzmlCartesian3.js +99 -0
- data/app/assets/javascripts/DynamicScene/CzmlCartographic.js +125 -0
- data/app/assets/javascripts/DynamicScene/CzmlColor.js +127 -0
- data/app/assets/javascripts/DynamicScene/CzmlDefaults.js +135 -0
- data/app/assets/javascripts/DynamicScene/CzmlHorizontalOrigin.js +59 -0
- data/app/assets/javascripts/DynamicScene/CzmlImage.js +61 -0
- data/app/assets/javascripts/DynamicScene/CzmlLabelStyle.js +59 -0
- data/app/assets/javascripts/DynamicScene/CzmlNumber.js +82 -0
- data/app/assets/javascripts/DynamicScene/CzmlString.js +56 -0
- data/app/assets/javascripts/DynamicScene/CzmlUnitCartesian3.js +99 -0
- data/app/assets/javascripts/DynamicScene/CzmlUnitQuaternion.js +172 -0
- data/app/assets/javascripts/DynamicScene/CzmlUnitSpherical.js +98 -0
- data/app/assets/javascripts/DynamicScene/CzmlVerticalOrigin.js +59 -0
- data/app/assets/javascripts/DynamicScene/DynamicBillboard.js +245 -0
- data/app/assets/javascripts/DynamicScene/DynamicBillboardVisualizer.js +347 -0
- data/app/assets/javascripts/DynamicScene/DynamicColorMaterial.js +78 -0
- data/app/assets/javascripts/DynamicScene/DynamicCone.js +291 -0
- data/app/assets/javascripts/DynamicScene/DynamicConeVisualizer.js +350 -0
- data/app/assets/javascripts/DynamicScene/DynamicConeVisualizerUsingCustomSensor.js +389 -0
- data/app/assets/javascripts/DynamicScene/DynamicDirectionsProperty.js +163 -0
- data/app/assets/javascripts/DynamicScene/DynamicEllipsoid.js +158 -0
- data/app/assets/javascripts/DynamicScene/DynamicEllipsoidVisualizer.js +277 -0
- data/app/assets/javascripts/DynamicScene/DynamicImageMaterial.js +136 -0
- data/app/assets/javascripts/DynamicScene/DynamicLabel.js +286 -0
- data/app/assets/javascripts/DynamicScene/DynamicLabelVisualizer.js +341 -0
- data/app/assets/javascripts/DynamicScene/DynamicMaterialProperty.js +125 -0
- data/app/assets/javascripts/DynamicScene/DynamicObject.js +364 -0
- data/app/assets/javascripts/DynamicScene/DynamicObjectCollection.js +137 -0
- data/app/assets/javascripts/DynamicScene/DynamicObjectView.js +299 -0
- data/app/assets/javascripts/DynamicScene/DynamicPath.js +214 -0
- data/app/assets/javascripts/DynamicScene/DynamicPathVisualizer.js +402 -0
- data/app/assets/javascripts/DynamicScene/DynamicPoint.js +184 -0
- data/app/assets/javascripts/DynamicScene/DynamicPointVisualizer.js +323 -0
- data/app/assets/javascripts/DynamicScene/DynamicPolygon.js +138 -0
- data/app/assets/javascripts/DynamicScene/DynamicPolygonVisualizer.js +251 -0
- data/app/assets/javascripts/DynamicScene/DynamicPolyline.js +183 -0
- data/app/assets/javascripts/DynamicScene/DynamicPolylineVisualizer.js +268 -0
- data/app/assets/javascripts/DynamicScene/DynamicPositionProperty.js +525 -0
- data/app/assets/javascripts/DynamicScene/DynamicProperty.js +352 -0
- data/app/assets/javascripts/DynamicScene/DynamicPyramid.js +204 -0
- data/app/assets/javascripts/DynamicScene/DynamicPyramidVisualizer.js +302 -0
- data/app/assets/javascripts/DynamicScene/DynamicScene.profile.js +8 -0
- data/app/assets/javascripts/DynamicScene/DynamicVertexPositionsProperty.js +199 -0
- data/app/assets/javascripts/DynamicScene/ReferenceProperty.js +155 -0
- data/app/assets/javascripts/DynamicScene/VisualizerCollection.js +181 -0
- data/app/assets/javascripts/DynamicScene/package.json +6 -0
- data/app/assets/javascripts/DynamicScene/processCzml.js +77 -0
- data/app/assets/javascripts/Renderer/BlendEquation.js +52 -0
- data/app/assets/javascripts/Renderer/BlendFunction.js +158 -0
- data/app/assets/javascripts/Renderer/BlendingState.js +64 -0
- data/app/assets/javascripts/Renderer/Buffer.js +141 -0
- data/app/assets/javascripts/Renderer/BufferUsage.js +48 -0
- data/app/assets/javascripts/Renderer/ClearCommand.js +40 -0
- data/app/assets/javascripts/Renderer/CommandLists.js +42 -0
- data/app/assets/javascripts/Renderer/Context.js +2805 -0
- data/app/assets/javascripts/Renderer/CubeMap.js +358 -0
- data/app/assets/javascripts/Renderer/CubeMapFace.js +202 -0
- data/app/assets/javascripts/Renderer/CullFace.js +50 -0
- data/app/assets/javascripts/Renderer/DepthFunction.js +95 -0
- data/app/assets/javascripts/Renderer/DrawCommand.js +96 -0
- data/app/assets/javascripts/Renderer/Framebuffer.js +435 -0
- data/app/assets/javascripts/Renderer/MipmapHint.js +50 -0
- data/app/assets/javascripts/Renderer/PickFramebuffer.js +178 -0
- data/app/assets/javascripts/Renderer/PixelDatatype.js +86 -0
- data/app/assets/javascripts/Renderer/PixelFormat.js +113 -0
- data/app/assets/javascripts/Renderer/Renderbuffer.js +102 -0
- data/app/assets/javascripts/Renderer/RenderbufferFormat.js +77 -0
- data/app/assets/javascripts/Renderer/Renderer.profile.js +8 -0
- data/app/assets/javascripts/Renderer/ShaderCache.js +121 -0
- data/app/assets/javascripts/Renderer/ShaderProgram.js +2402 -0
- data/app/assets/javascripts/Renderer/StencilFunction.js +95 -0
- data/app/assets/javascripts/Renderer/StencilOperation.js +95 -0
- data/app/assets/javascripts/Renderer/Texture.js +395 -0
- data/app/assets/javascripts/Renderer/TextureAtlas.js +472 -0
- data/app/assets/javascripts/Renderer/TextureAtlasBuilder.js +133 -0
- data/app/assets/javascripts/Renderer/TextureMagnificationFilter.js +41 -0
- data/app/assets/javascripts/Renderer/TextureMinificationFilter.js +77 -0
- data/app/assets/javascripts/Renderer/TextureWrap.js +50 -0
- data/app/assets/javascripts/Renderer/UniformDatatype.js +218 -0
- data/app/assets/javascripts/Renderer/UniformState.js +799 -0
- data/app/assets/javascripts/Renderer/VertexArray.js +365 -0
- data/app/assets/javascripts/Renderer/VertexArrayFacade.js +574 -0
- data/app/assets/javascripts/Renderer/VertexLayout.js +49 -0
- data/app/assets/javascripts/Renderer/loadCubeMap.js +92 -0
- data/app/assets/javascripts/Renderer/package.json +6 -0
- data/app/assets/javascripts/Scene/AnimationCollection.js +249 -0
- data/app/assets/javascripts/Scene/ArcGisMapServerImageryProvider.js +384 -0
- data/app/assets/javascripts/Scene/Billboard.js +680 -0
- data/app/assets/javascripts/Scene/BillboardCollection.js +1209 -0
- data/app/assets/javascripts/Scene/BingMapsImageryProvider.js +460 -0
- data/app/assets/javascripts/Scene/BingMapsStyle.js +55 -0
- data/app/assets/javascripts/Scene/Camera.js +358 -0
- data/app/assets/javascripts/Scene/CameraColumbusViewMode.js +30 -0
- data/app/assets/javascripts/Scene/CameraController.js +1258 -0
- data/app/assets/javascripts/Scene/CameraEventAggregator.js +270 -0
- data/app/assets/javascripts/Scene/CameraEventType.js +53 -0
- data/app/assets/javascripts/Scene/CameraFlightPath.js +495 -0
- data/app/assets/javascripts/Scene/CentralBody.js +817 -0
- data/app/assets/javascripts/Scene/CentralBodySurface.js +1120 -0
- data/app/assets/javascripts/Scene/CentralBodySurfaceShaderSet.js +107 -0
- data/app/assets/javascripts/Scene/ComplexConicSensorVolume.js +511 -0
- data/app/assets/javascripts/Scene/CompositePrimitive.js +454 -0
- data/app/assets/javascripts/Scene/CullingVolume.js +59 -0
- data/app/assets/javascripts/Scene/CustomSensorVolume.js +440 -0
- data/app/assets/javascripts/Scene/DiscardMissingTileImagePolicy.js +134 -0
- data/app/assets/javascripts/Scene/EllipsoidPrimitive.js +412 -0
- data/app/assets/javascripts/Scene/EllipsoidTerrainProvider.js +182 -0
- data/app/assets/javascripts/Scene/FrameState.js +86 -0
- data/app/assets/javascripts/Scene/FrustumCommands.js +32 -0
- data/app/assets/javascripts/Scene/GeographicTilingScheme.js +265 -0
- data/app/assets/javascripts/Scene/HorizontalOrigin.js +39 -0
- data/app/assets/javascripts/Scene/Imagery.js +85 -0
- data/app/assets/javascripts/Scene/ImageryLayer.js +876 -0
- data/app/assets/javascripts/Scene/ImageryLayerCollection.js +403 -0
- data/app/assets/javascripts/Scene/ImageryProvider.js +185 -0
- data/app/assets/javascripts/Scene/ImageryProviderError.js +149 -0
- data/app/assets/javascripts/Scene/ImageryState.js +20 -0
- data/app/assets/javascripts/Scene/Label.js +706 -0
- data/app/assets/javascripts/Scene/LabelCollection.js +697 -0
- data/app/assets/javascripts/Scene/LabelStyle.js +39 -0
- data/app/assets/javascripts/Scene/Material.js +1177 -0
- data/app/assets/javascripts/Scene/NeverTileDiscardPolicy.js +38 -0
- data/app/assets/javascripts/Scene/OpenStreetMapImageryProvider.js +282 -0
- data/app/assets/javascripts/Scene/OrthographicFrustum.js +345 -0
- data/app/assets/javascripts/Scene/PerformanceDisplay.js +183 -0
- data/app/assets/javascripts/Scene/PerspectiveFrustum.js +239 -0
- data/app/assets/javascripts/Scene/PerspectiveOffCenterFrustum.js +394 -0
- data/app/assets/javascripts/Scene/Polygon.js +886 -0
- data/app/assets/javascripts/Scene/Polyline.js +441 -0
- data/app/assets/javascripts/Scene/PolylineCollection.js +1532 -0
- data/app/assets/javascripts/Scene/Projections.js +93 -0
- data/app/assets/javascripts/Scene/RectangularPyramidSensorVolume.js +224 -0
- data/app/assets/javascripts/Scene/Scene.js +632 -0
- data/app/assets/javascripts/Scene/Scene.profile.js +8 -0
- data/app/assets/javascripts/Scene/SceneMode.js +51 -0
- data/app/assets/javascripts/Scene/SceneTransitioner.js +776 -0
- data/app/assets/javascripts/Scene/ScreenSpaceCameraController.js +1063 -0
- data/app/assets/javascripts/Scene/SensorVolumeCollection.js +192 -0
- data/app/assets/javascripts/Scene/SingleTileImageryProvider.js +295 -0
- data/app/assets/javascripts/Scene/SkyAtmosphere.js +239 -0
- data/app/assets/javascripts/Scene/SkyBox.js +231 -0
- data/app/assets/javascripts/Scene/TerrainProvider.js +229 -0
- data/app/assets/javascripts/Scene/TexturePool.js +154 -0
- data/app/assets/javascripts/Scene/Tile.js +322 -0
- data/app/assets/javascripts/Scene/TileDiscardPolicy.js +42 -0
- data/app/assets/javascripts/Scene/TileImagery.js +36 -0
- data/app/assets/javascripts/Scene/TileLoadQueue.js +123 -0
- data/app/assets/javascripts/Scene/TileMapServiceImageryProvider.js +337 -0
- data/app/assets/javascripts/Scene/TileReplacementQueue.js +139 -0
- data/app/assets/javascripts/Scene/TileState.js +19 -0
- data/app/assets/javascripts/Scene/TilingScheme.js +213 -0
- data/app/assets/javascripts/Scene/VerticalOrigin.js +39 -0
- data/app/assets/javascripts/Scene/ViewportQuad.js +256 -0
- data/app/assets/javascripts/Scene/WebMapServiceImageryProvider.js +374 -0
- data/app/assets/javascripts/Scene/WebMercatorTilingScheme.js +291 -0
- data/app/assets/javascripts/Scene/package.json +6 -0
- data/app/assets/javascripts/Shaders/BillboardCollectionFS.glsl +30 -0
- data/app/assets/javascripts/Shaders/BillboardCollectionFS.js +31 -0
- data/app/assets/javascripts/Shaders/BillboardCollectionVS.glsl +68 -0
- data/app/assets/javascripts/Shaders/BillboardCollectionVS.js +54 -0
- data/app/assets/javascripts/Shaders/BuiltinFunctions.glsl +927 -0
- data/app/assets/javascripts/Shaders/BuiltinFunctions.js +322 -0
- data/app/assets/javascripts/Shaders/CentralBodyFS.glsl +106 -0
- data/app/assets/javascripts/Shaders/CentralBodyFS.js +82 -0
- data/app/assets/javascripts/Shaders/CentralBodyFSDepth.glsl +20 -0
- data/app/assets/javascripts/Shaders/CentralBodyFSDepth.js +22 -0
- data/app/assets/javascripts/Shaders/CentralBodyFSPole.glsl +29 -0
- data/app/assets/javascripts/Shaders/CentralBodyFSPole.js +28 -0
- data/app/assets/javascripts/Shaders/CentralBodyVS.glsl +88 -0
- data/app/assets/javascripts/Shaders/CentralBodyVS.js +69 -0
- data/app/assets/javascripts/Shaders/CentralBodyVSDepth.glsl +9 -0
- data/app/assets/javascripts/Shaders/CentralBodyVSDepth.js +13 -0
- data/app/assets/javascripts/Shaders/CentralBodyVSPole.glsl +12 -0
- data/app/assets/javascripts/Shaders/CentralBodyVSPole.js +15 -0
- data/app/assets/javascripts/Shaders/ComplexConicSensorVolumeFS.glsl +448 -0
- data/app/assets/javascripts/Shaders/ComplexConicSensorVolumeFS.js +361 -0
- data/app/assets/javascripts/Shaders/ComplexConicSensorVolumeVS.glsl +19 -0
- data/app/assets/javascripts/Shaders/ComplexConicSensorVolumeVS.js +20 -0
- data/app/assets/javascripts/Shaders/ConstructiveSolidGeometry.glsl +886 -0
- data/app/assets/javascripts/Shaders/ConstructiveSolidGeometry.js +586 -0
- data/app/assets/javascripts/Shaders/CustomSensorVolumeFS.glsl +126 -0
- data/app/assets/javascripts/Shaders/CustomSensorVolumeFS.js +95 -0
- data/app/assets/javascripts/Shaders/CustomSensorVolumeVS.glsl +14 -0
- data/app/assets/javascripts/Shaders/CustomSensorVolumeVS.js +18 -0
- data/app/assets/javascripts/Shaders/EllipsoidFS.glsl +40 -0
- data/app/assets/javascripts/Shaders/EllipsoidFS.js +38 -0
- data/app/assets/javascripts/Shaders/EllipsoidVS.glsl +26 -0
- data/app/assets/javascripts/Shaders/EllipsoidVS.js +16 -0
- data/app/assets/javascripts/Shaders/Materials/AsphaltMaterial.glsl +25 -0
- data/app/assets/javascripts/Shaders/Materials/AsphaltMaterial.js +23 -0
- data/app/assets/javascripts/Shaders/Materials/BlobMaterial.glsl +18 -0
- data/app/assets/javascripts/Shaders/Materials/BlobMaterial.js +19 -0
- data/app/assets/javascripts/Shaders/Materials/BrickMaterial.glsl +42 -0
- data/app/assets/javascripts/Shaders/Materials/BrickMaterial.js +36 -0
- data/app/assets/javascripts/Shaders/Materials/BumpMapMaterial.glsl +29 -0
- data/app/assets/javascripts/Shaders/Materials/BumpMapMaterial.js +27 -0
- data/app/assets/javascripts/Shaders/Materials/CementMaterial.glsl +19 -0
- data/app/assets/javascripts/Shaders/Materials/CementMaterial.js +20 -0
- data/app/assets/javascripts/Shaders/Materials/CheckerboardMaterial.glsl +38 -0
- data/app/assets/javascripts/Shaders/Materials/CheckerboardMaterial.js +32 -0
- data/app/assets/javascripts/Shaders/Materials/DotMaterial.glsl +17 -0
- data/app/assets/javascripts/Shaders/Materials/DotMaterial.js +18 -0
- data/app/assets/javascripts/Shaders/Materials/ErosionMaterial.glsl +23 -0
- data/app/assets/javascripts/Shaders/Materials/ErosionMaterial.js +24 -0
- data/app/assets/javascripts/Shaders/Materials/FacetMaterial.glsl +18 -0
- data/app/assets/javascripts/Shaders/Materials/FacetMaterial.js +19 -0
- data/app/assets/javascripts/Shaders/Materials/FresnelMaterial.glsl +12 -0
- data/app/assets/javascripts/Shaders/Materials/FresnelMaterial.js +15 -0
- data/app/assets/javascripts/Shaders/Materials/GrassMaterial.glsl +28 -0
- data/app/assets/javascripts/Shaders/Materials/GrassMaterial.js +26 -0
- data/app/assets/javascripts/Shaders/Materials/NormalMapMaterial.glsl +19 -0
- data/app/assets/javascripts/Shaders/Materials/NormalMapMaterial.js +21 -0
- data/app/assets/javascripts/Shaders/Materials/ReflectionMaterial.glsl +13 -0
- data/app/assets/javascripts/Shaders/Materials/ReflectionMaterial.js +16 -0
- data/app/assets/javascripts/Shaders/Materials/RefractionMaterial.glsl +14 -0
- data/app/assets/javascripts/Shaders/Materials/RefractionMaterial.js +17 -0
- data/app/assets/javascripts/Shaders/Materials/RimLightingMaterial.glsl +18 -0
- data/app/assets/javascripts/Shaders/Materials/RimLightingMaterial.js +19 -0
- data/app/assets/javascripts/Shaders/Materials/StripeMaterial.glsl +29 -0
- data/app/assets/javascripts/Shaders/Materials/StripeMaterial.js +26 -0
- data/app/assets/javascripts/Shaders/Materials/TieDyeMaterial.glsl +17 -0
- data/app/assets/javascripts/Shaders/Materials/TieDyeMaterial.js +19 -0
- data/app/assets/javascripts/Shaders/Materials/Water.glsl +91 -0
- data/app/assets/javascripts/Shaders/Materials/Water.js +60 -0
- data/app/assets/javascripts/Shaders/Materials/WoodMaterial.glsl +36 -0
- data/app/assets/javascripts/Shaders/Materials/WoodMaterial.js +31 -0
- data/app/assets/javascripts/Shaders/Noise.glsl +453 -0
- data/app/assets/javascripts/Shaders/Noise.js +242 -0
- data/app/assets/javascripts/Shaders/PolygonFS.glsl +27 -0
- data/app/assets/javascripts/Shaders/PolygonFS.js +23 -0
- data/app/assets/javascripts/Shaders/PolygonFSPick.glsl +6 -0
- data/app/assets/javascripts/Shaders/PolygonFSPick.js +11 -0
- data/app/assets/javascripts/Shaders/PolygonVS.glsl +38 -0
- data/app/assets/javascripts/Shaders/PolygonVS.js +39 -0
- data/app/assets/javascripts/Shaders/PolygonVSPick.glsl +30 -0
- data/app/assets/javascripts/Shaders/PolygonVSPick.js +32 -0
- data/app/assets/javascripts/Shaders/PolylineFS.glsl +6 -0
- data/app/assets/javascripts/Shaders/PolylineFS.js +11 -0
- data/app/assets/javascripts/Shaders/PolylineVS.glsl +34 -0
- data/app/assets/javascripts/Shaders/PolylineVS.js +35 -0
- data/app/assets/javascripts/Shaders/Ray.glsl +532 -0
- data/app/assets/javascripts/Shaders/Ray.js +357 -0
- data/app/assets/javascripts/Shaders/ReprojectWebMercatorFS.glsl +26 -0
- data/app/assets/javascripts/Shaders/ReprojectWebMercatorFS.js +22 -0
- data/app/assets/javascripts/Shaders/ReprojectWebMercatorVS.glsl +11 -0
- data/app/assets/javascripts/Shaders/ReprojectWebMercatorVS.js +14 -0
- data/app/assets/javascripts/Shaders/SensorVolume.glsl +43 -0
- data/app/assets/javascripts/Shaders/SensorVolume.js +31 -0
- data/app/assets/javascripts/Shaders/Shaders.profile.js +8 -0
- data/app/assets/javascripts/Shaders/SkyAtmosphereFS.glsl +70 -0
- data/app/assets/javascripts/Shaders/SkyAtmosphereFS.js +62 -0
- data/app/assets/javascripts/Shaders/SkyAtmosphereVS.glsl +131 -0
- data/app/assets/javascripts/Shaders/SkyAtmosphereVS.js +115 -0
- data/app/assets/javascripts/Shaders/SkyBoxFS.glsl +10 -0
- data/app/assets/javascripts/Shaders/SkyBoxFS.js +14 -0
- data/app/assets/javascripts/Shaders/SkyBoxVS.glsl +10 -0
- data/app/assets/javascripts/Shaders/SkyBoxVS.js +14 -0
- data/app/assets/javascripts/Shaders/ViewportQuadFS.glsl +16 -0
- data/app/assets/javascripts/Shaders/ViewportQuadFS.js +17 -0
- data/app/assets/javascripts/Shaders/ViewportQuadVS.glsl +10 -0
- data/app/assets/javascripts/Shaders/ViewportQuadVS.js +14 -0
- data/app/assets/javascripts/Shaders/package.json +6 -0
- data/app/assets/javascripts/ThirdParty/ThirdParty.profile.js +8 -0
- data/app/assets/javascripts/ThirdParty/Tween.js +678 -0
- data/app/assets/javascripts/ThirdParty/Uri.js +277 -0
- data/app/assets/javascripts/ThirdParty/measureText.js +197 -0
- data/app/assets/javascripts/ThirdParty/package.json +6 -0
- data/app/assets/javascripts/ThirdParty/sprintf.js +319 -0
- data/app/assets/javascripts/ThirdParty/when.js +748 -0
- data/app/assets/javascripts/Widgets/Dojo/CesiumViewerWidget.css +175 -0
- data/app/assets/javascripts/Widgets/Dojo/CesiumViewerWidget.html +52 -0
- data/app/assets/javascripts/Widgets/Dojo/CesiumViewerWidget.js +1237 -0
- data/app/assets/javascripts/Widgets/Dojo/CesiumWidget.html +4 -0
- data/app/assets/javascripts/Widgets/Dojo/CesiumWidget.js +349 -0
- data/app/assets/javascripts/Widgets/Dojo/TimelineWidget.css +1 -0
- data/app/assets/javascripts/Widgets/Dojo/TimelineWidget.js +47 -0
- data/app/assets/javascripts/Widgets/Dojo/checkForChromeFrame.js +71 -0
- data/app/assets/javascripts/Widgets/Images/Bing_Logo_51x19_White.png +0 -0
- data/app/assets/javascripts/Widgets/Images/Cesium_Logo_overlay.png +0 -0
- data/app/assets/javascripts/Widgets/Images/TimelineIcons.png +0 -0
- data/app/assets/javascripts/Widgets/Images/ajax-loader.gif +0 -0
- data/app/assets/javascripts/Widgets/Images/animationBar.png +0 -0
- data/app/assets/javascripts/Widgets/Images/viewControlBar.png +0 -0
- data/app/assets/javascripts/Widgets/Timeline.css +113 -0
- data/app/assets/javascripts/Widgets/Timeline.js +629 -0
- data/app/assets/javascripts/Widgets/TimelineHighlightRange.js +51 -0
- data/app/assets/javascripts/Widgets/TimelineTrack.js +54 -0
- data/app/assets/javascripts/Widgets/Widgets.profile.js +8 -0
- data/app/assets/javascripts/Widgets/package.json +6 -0
- data/app/assets/javascripts/Workers/Workers.profile.js +8 -0
- data/app/assets/javascripts/Workers/cesiumWorkerBootstrapper.js +2015 -0
- data/app/assets/javascripts/Workers/createTaskProcessorWorker.js +55 -0
- data/app/assets/javascripts/Workers/createVerticesFromExtent.js +24 -0
- data/app/assets/javascripts/Workers/package.json +6 -0
- data/app/assets/javascripts/copyrightHeader.js +22 -0
- data/app/assets/javascripts/main.js +10 -0
- data/app/assets/stylesheets/cesium.css +4 -0
- data/app/controllers/cesium_controller.rb +4 -0
- data/app/helpers/cesium_helper.rb +2 -0
- data/app/views/cesium/index.html.erb +3 -0
- data/config/routes.rb +3 -0
- data/lib/cesium.rb +4 -0
- data/lib/cesium/engine.rb +4 -0
- data/lib/cesium/version.rb +3 -0
- data/lib/tasks/cesium_tasks.rake +4 -0
- data/test/cesium_test.rb +7 -0
- data/test/dummy/README.rdoc +261 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/javascripts/adapters/jquery-adapter.js.coffee +4 -0
- data/test/dummy/app/assets/javascripts/app.js.coffee +11 -0
- data/test/dummy/app/assets/javascripts/application.js.coffee +73 -0
- data/test/dummy/app/assets/stylesheets/application.css +12 -0
- data/test/dummy/app/controllers/application_controller.rb +4 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +21 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +59 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +37 -0
- data/test/dummy/config/environments/production.rb +67 -0
- data/test/dummy/config/environments/test.rb +37 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +15 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/requirejs.yml +10 -0
- data/test/dummy/config/routes.rb +3 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +25 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/functional/cesium_controller_test.rb +9 -0
- data/test/integration/navigation_test.rb +10 -0
- data/test/test_helper.rb +15 -0
- data/test/unit/helpers/cesium_helper_test.rb +4 -0
- metadata +641 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/*global define*/
|
|
2
|
+
define([
|
|
3
|
+
'../Core/defaultValue',
|
|
4
|
+
'../Core/loadImage',
|
|
5
|
+
'../Core/DeveloperError',
|
|
6
|
+
'../Core/throttleRequestByServer'
|
|
7
|
+
], function(
|
|
8
|
+
defaultValue,
|
|
9
|
+
loadImage,
|
|
10
|
+
DeveloperError,
|
|
11
|
+
throttleRequestByServer) {
|
|
12
|
+
"use strict";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Provides details about an error that occurred in an {@link ImageryProvider}.
|
|
16
|
+
*
|
|
17
|
+
* @alias ImageryProviderError
|
|
18
|
+
*
|
|
19
|
+
* @param {ImageryProvider} imageryProvider The imagery provider that experienced the error.
|
|
20
|
+
* @param {String} message A message describing the error.
|
|
21
|
+
* @param {Number} [x] The X coordinate of the tile that experienced the error, or undefined if the error
|
|
22
|
+
* is not specific to a particular tile.
|
|
23
|
+
* @param {Number} [y] The Y coordinate of the tile that experienced the error, or undefined if the error
|
|
24
|
+
* is not specific to a particular tile.
|
|
25
|
+
* @param {Number} [level] The level of the tile that experienced the error, or undefined if the error
|
|
26
|
+
* is not specific to a particular tile.
|
|
27
|
+
* @param {Number} [timesRetried=0] The number of times this operation has been retried.
|
|
28
|
+
*/
|
|
29
|
+
var ImageryProviderError = function ImageryProviderError(imageryProvider, message, x, y, level, timesRetried) {
|
|
30
|
+
/**
|
|
31
|
+
* The {@link ImageryProvider} that experienced the error.
|
|
32
|
+
* @type ImageryProvider
|
|
33
|
+
*/
|
|
34
|
+
this.imageryProvider = imageryProvider;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The message describing the error.
|
|
38
|
+
* @type String
|
|
39
|
+
*/
|
|
40
|
+
this.message = message;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The X coordinate of the tile that experienced the error. If the error is not specific
|
|
44
|
+
* to a particular tile, this property will be undefined.
|
|
45
|
+
* @type Number
|
|
46
|
+
*/
|
|
47
|
+
this.x = x;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* The Y coordinate of the tile that experienced the error. If the error is not specific
|
|
51
|
+
* to a particular tile, this property will be undefined.
|
|
52
|
+
* @type Number
|
|
53
|
+
*/
|
|
54
|
+
this.y = y;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The level-of-detail of the tile that experienced the error. If the error is not specific
|
|
58
|
+
* to a particular tile, this property will be undefined.
|
|
59
|
+
* @type Number
|
|
60
|
+
*/
|
|
61
|
+
this.level = level;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* The number of times this operation has been retried.
|
|
65
|
+
* @type Number
|
|
66
|
+
*/
|
|
67
|
+
this.timesRetried = defaultValue(timesRetried, 0);
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* True if the failed operation should be retried; otherwise, false. The imagery provider
|
|
71
|
+
* will set the initial value of this property before raising the event, but any of listeners
|
|
72
|
+
* can change it. The value after the last listener is invoked will be acted upon.
|
|
73
|
+
* @type Boolean
|
|
74
|
+
*/
|
|
75
|
+
this.retry = false;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Handles an error in an {@link ImageryProvider} by raising an event if it has any listeners, or by
|
|
80
|
+
* logging the error to the console if the event has no listeners. This method also tracks the number
|
|
81
|
+
* of times the operation has been retried and will automatically retry if requested to do so by the
|
|
82
|
+
* event listeners.
|
|
83
|
+
*
|
|
84
|
+
* @methodof ImageryProviderError
|
|
85
|
+
*
|
|
86
|
+
* @param {ImageryProviderError} previousError The error instance returned by this function the last
|
|
87
|
+
* time it was called for this error, or undefined if this is the first time this error has
|
|
88
|
+
* occurred.
|
|
89
|
+
* @param {ImageryProvider} imageryProvider The imagery provider that encountered the error.
|
|
90
|
+
* @param {Event} event The event to raise to inform listeners of the error.
|
|
91
|
+
* @param {String} message The message describing the error.
|
|
92
|
+
* @param {Number} x The X coordinate of the tile that experienced the error, or undefined if the
|
|
93
|
+
* error is not specific to a particular tile.
|
|
94
|
+
* @param {Number} y The Y coordinate of the tile that experienced the error, or undefined if the
|
|
95
|
+
* error is not specific to a particular tile.
|
|
96
|
+
* @param {Number} level The level-of-detail of the tile that experienced the error, or undefined if the
|
|
97
|
+
* error is not specific to a particular tile.
|
|
98
|
+
* @param {Function} retryFunction The function to call to retry the operation. If undefined, the
|
|
99
|
+
* operation will not be retried.
|
|
100
|
+
* @returns {ImageryProviderError} The error instance that was passed to the event listeners and that
|
|
101
|
+
* should be passed to this function the next time it is called for the same error in order
|
|
102
|
+
* to track retry counts.
|
|
103
|
+
*/
|
|
104
|
+
ImageryProviderError.handleError = function(previousError, imageryProvider, event, message, x, y, level, retryFunction) {
|
|
105
|
+
var error = previousError;
|
|
106
|
+
if (typeof previousError === 'undefined') {
|
|
107
|
+
error = new ImageryProviderError(imageryProvider, message, x, y, level, 0);
|
|
108
|
+
} else {
|
|
109
|
+
error.imageryProvider = imageryProvider;
|
|
110
|
+
error.message = message;
|
|
111
|
+
error.x = x;
|
|
112
|
+
error.y = y;
|
|
113
|
+
error.level = level;
|
|
114
|
+
error.retry = false;
|
|
115
|
+
++error.timesRetried;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (event.getNumberOfListeners() > 0) {
|
|
119
|
+
event.raiseEvent(error);
|
|
120
|
+
} else {
|
|
121
|
+
/*global console*/
|
|
122
|
+
console.log('An error occurred in "' + imageryProvider.constructor.name + '":');
|
|
123
|
+
console.log(message);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (error.retry && typeof retryFunction !== 'undefined') {
|
|
127
|
+
retryFunction();
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return error;
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Handles success of an operation by resetting the retry count of a previous error, if any. This way,
|
|
135
|
+
* if the error occurs again in the future, the listeners will be informed that it has not yet been retried.
|
|
136
|
+
*
|
|
137
|
+
* @memberof ImageryProviderError
|
|
138
|
+
*
|
|
139
|
+
* @param {ImageryProviderError} previousError The previous error, or undefined if this operation has
|
|
140
|
+
* not previously resulted in an error.
|
|
141
|
+
*/
|
|
142
|
+
ImageryProviderError.handleSuccess = function(previousError) {
|
|
143
|
+
if (typeof previousError !== 'undefined') {
|
|
144
|
+
previousError.timesRetried = -1;
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
return ImageryProviderError;
|
|
149
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*global define*/
|
|
2
|
+
define(['../Core/Enumeration'], function(Enumeration) {
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @private
|
|
7
|
+
*/
|
|
8
|
+
var ImageryState = {
|
|
9
|
+
UNLOADED : new Enumeration(0, 'UNLOADED'),
|
|
10
|
+
TRANSITIONING : new Enumeration(1, 'TRANSITIONING'),
|
|
11
|
+
RECEIVED : new Enumeration(2, 'RECEIVED'),
|
|
12
|
+
TEXTURE_LOADED : new Enumeration(3, 'TEXTURE_LOADED'),
|
|
13
|
+
READY : new Enumeration(4, 'READY'),
|
|
14
|
+
FAILED : new Enumeration(5, 'FAILED'),
|
|
15
|
+
INVALID : new Enumeration(6, 'INVALID'),
|
|
16
|
+
PLACEHOLDER : new Enumeration(7, 'PLACEHOLDER')
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
return ImageryState;
|
|
20
|
+
});
|
|
@@ -0,0 +1,706 @@
|
|
|
1
|
+
/*global define*/
|
|
2
|
+
define([
|
|
3
|
+
'../Core/defaultValue',
|
|
4
|
+
'../Core/DeveloperError',
|
|
5
|
+
'../Core/Cartesian2',
|
|
6
|
+
'../Core/Cartesian3',
|
|
7
|
+
'../Core/Color',
|
|
8
|
+
'./Billboard',
|
|
9
|
+
'./LabelStyle',
|
|
10
|
+
'./HorizontalOrigin',
|
|
11
|
+
'./VerticalOrigin'
|
|
12
|
+
], function(
|
|
13
|
+
defaultValue,
|
|
14
|
+
DeveloperError,
|
|
15
|
+
Cartesian2,
|
|
16
|
+
Cartesian3,
|
|
17
|
+
Color,
|
|
18
|
+
Billboard,
|
|
19
|
+
LabelStyle,
|
|
20
|
+
HorizontalOrigin,
|
|
21
|
+
VerticalOrigin) {
|
|
22
|
+
"use strict";
|
|
23
|
+
|
|
24
|
+
var EMPTY_OBJECT = {};
|
|
25
|
+
|
|
26
|
+
function rebindAllGlyphs(label) {
|
|
27
|
+
if (!label._rebindAllGlyphs && !label._repositionAllGlyphs) {
|
|
28
|
+
// only push label if it's not already been marked dirty
|
|
29
|
+
label._labelCollection._labelsToUpdate.push(label);
|
|
30
|
+
}
|
|
31
|
+
label._rebindAllGlyphs = true;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function repositionAllGlyphs(label) {
|
|
35
|
+
if (!label._rebindAllGlyphs && !label._repositionAllGlyphs) {
|
|
36
|
+
// only push label if it's not already been marked dirty
|
|
37
|
+
label._labelCollection._labelsToUpdate.push(label);
|
|
38
|
+
}
|
|
39
|
+
label._repositionAllGlyphs = true;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* A Label draws viewport-aligned text positioned in the 3D scene. This constructor
|
|
44
|
+
* should not be used directly, instead create labels by calling {@link LabelCollection#add}.
|
|
45
|
+
*
|
|
46
|
+
* @alias Label
|
|
47
|
+
* @internalConstructor
|
|
48
|
+
*
|
|
49
|
+
* @see LabelCollection
|
|
50
|
+
* @see LabelCollection#add
|
|
51
|
+
*/
|
|
52
|
+
var Label = function(description, labelCollection) {
|
|
53
|
+
description = defaultValue(description, EMPTY_OBJECT);
|
|
54
|
+
|
|
55
|
+
this._text = defaultValue(description.text, '');
|
|
56
|
+
this._show = defaultValue(description.show, true);
|
|
57
|
+
this._font = defaultValue(description.font, '30px sans-serif');
|
|
58
|
+
this._fillColor = Color.clone(defaultValue(description.fillColor, Color.WHITE));
|
|
59
|
+
this._outlineColor = Color.clone(defaultValue(description.outlineColor, Color.BLACK));
|
|
60
|
+
this._style = defaultValue(description.style, LabelStyle.FILL);
|
|
61
|
+
this._verticalOrigin = defaultValue(description.verticalOrigin, VerticalOrigin.BOTTOM);
|
|
62
|
+
this._horizontalOrigin = defaultValue(description.horizontalOrigin, HorizontalOrigin.LEFT);
|
|
63
|
+
this._pixelOffset = Cartesian2.clone(defaultValue(description.pixelOffset, Cartesian2.ZERO));
|
|
64
|
+
this._eyeOffset = Cartesian3.clone(defaultValue(description.eyeOffset, Cartesian3.ZERO));
|
|
65
|
+
this._position = Cartesian3.clone(defaultValue(description.position, Cartesian3.ZERO));
|
|
66
|
+
this._scale = defaultValue(description.scale, 1.0);
|
|
67
|
+
|
|
68
|
+
this._labelCollection = labelCollection;
|
|
69
|
+
this._glyphs = [];
|
|
70
|
+
|
|
71
|
+
this._rebindAllGlyphs = true;
|
|
72
|
+
this._repositionAllGlyphs = true;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Returns true if this label will be shown. Call {@link Label#setShow}
|
|
77
|
+
* to hide or show a label, instead of removing it and re-adding it to the collection.
|
|
78
|
+
*
|
|
79
|
+
* @memberof Label
|
|
80
|
+
*
|
|
81
|
+
* @return {Boolean} <code>true</code> if this label will be shown; otherwise, <code>false</code>.
|
|
82
|
+
*
|
|
83
|
+
* @see Label#setShow
|
|
84
|
+
*/
|
|
85
|
+
Label.prototype.getShow = function() {
|
|
86
|
+
return this._show;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Determines if this label will be shown. Call this to hide or show a label, instead
|
|
91
|
+
* of removing it and re-adding it to the collection.
|
|
92
|
+
*
|
|
93
|
+
* @memberof Label
|
|
94
|
+
*
|
|
95
|
+
* @param {Boolean} value Indicates if this label will be shown.
|
|
96
|
+
*
|
|
97
|
+
* @exception {DeveloperError} value is required.
|
|
98
|
+
*
|
|
99
|
+
* @see Label#getShow
|
|
100
|
+
*/
|
|
101
|
+
Label.prototype.setShow = function(value) {
|
|
102
|
+
if (typeof value === 'undefined') {
|
|
103
|
+
throw new DeveloperError('value is required.');
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if (value !== this._show) {
|
|
107
|
+
this._show = value;
|
|
108
|
+
|
|
109
|
+
var glyphs = this._glyphs;
|
|
110
|
+
for ( var i = 0, len = glyphs.length; i < len; i++) {
|
|
111
|
+
var glyph = glyphs[i];
|
|
112
|
+
if (typeof glyph.billboard !== 'undefined') {
|
|
113
|
+
glyph.billboard.setShow(value);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Returns the Cartesian position of this label.
|
|
121
|
+
*
|
|
122
|
+
* @memberof Label
|
|
123
|
+
*
|
|
124
|
+
* @return {Cartesian3} The Cartesian position of this label.
|
|
125
|
+
*
|
|
126
|
+
* @see Label#setPosition
|
|
127
|
+
*/
|
|
128
|
+
Label.prototype.getPosition = function() {
|
|
129
|
+
return this._position;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Sets the Cartesian position of this label.
|
|
134
|
+
* <br /><br />
|
|
135
|
+
* As shown in the examples, <code>value</code> can be either a {@link Cartesian3}
|
|
136
|
+
* or an object literal with <code>x</code>, <code>y</code>, and <code>z</code> properties.
|
|
137
|
+
* A copy of <code>value</code> is made, so changing it after calling <code>setPosition</code>
|
|
138
|
+
* does not affect the label's position; an explicit call to <code>setPosition</code> is required.
|
|
139
|
+
*
|
|
140
|
+
* @memberof Label
|
|
141
|
+
*
|
|
142
|
+
* @param {Cartesian3} value The Cartesian position.
|
|
143
|
+
*
|
|
144
|
+
* @exception {DeveloperError} value is required.
|
|
145
|
+
*
|
|
146
|
+
* @see Label#getPosition
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* // Example 1. Set a label's position using a Cartesian3.
|
|
150
|
+
* l.setPosition(new Cartesian3(1.0, 2.0, 3.0));
|
|
151
|
+
*
|
|
152
|
+
* //////////////////////////////////////////////////////////////////
|
|
153
|
+
*
|
|
154
|
+
* // Example 2. Set a label's position using an object literal.
|
|
155
|
+
* l.setPosition({
|
|
156
|
+
* x : 1.0,
|
|
157
|
+
* y : 2.0,
|
|
158
|
+
* z : 3.0
|
|
159
|
+
* });
|
|
160
|
+
*/
|
|
161
|
+
Label.prototype.setPosition = function(value) {
|
|
162
|
+
if (typeof value === 'undefined') {
|
|
163
|
+
throw new DeveloperError('value is required.');
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
var position = this._position;
|
|
167
|
+
if (!Cartesian3.equals(position, value)) {
|
|
168
|
+
Cartesian3.clone(value, position);
|
|
169
|
+
|
|
170
|
+
var glyphs = this._glyphs;
|
|
171
|
+
for ( var i = 0, len = glyphs.length; i < len; i++) {
|
|
172
|
+
var glyph = glyphs[i];
|
|
173
|
+
if (typeof glyph.billboard !== 'undefined') {
|
|
174
|
+
glyph.billboard.setPosition(value);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Gets the text of this label.
|
|
182
|
+
*
|
|
183
|
+
* @memberof Label
|
|
184
|
+
*
|
|
185
|
+
* @see Label#setText
|
|
186
|
+
*/
|
|
187
|
+
Label.prototype.getText = function() {
|
|
188
|
+
return this._text;
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Sets the text of this label.
|
|
193
|
+
*
|
|
194
|
+
* @memberof Label
|
|
195
|
+
*
|
|
196
|
+
* @param {String} value The text.
|
|
197
|
+
*
|
|
198
|
+
* @exception {DeveloperError} value is required.
|
|
199
|
+
*
|
|
200
|
+
* @see Label#getText
|
|
201
|
+
*/
|
|
202
|
+
Label.prototype.setText = function(value) {
|
|
203
|
+
if (typeof value === 'undefined') {
|
|
204
|
+
throw new DeveloperError('value is required.');
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
if (value !== this._text) {
|
|
208
|
+
this._text = value;
|
|
209
|
+
rebindAllGlyphs(this);
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Gets the font used to draw this label. Fonts are specified using the same syntax as the CSS 'font' property.
|
|
215
|
+
*
|
|
216
|
+
* @memberof Label
|
|
217
|
+
*
|
|
218
|
+
* @see Label#setFont
|
|
219
|
+
* @see <a href='http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#text-styles'>HTML canvas 2D context text styles</a>
|
|
220
|
+
*/
|
|
221
|
+
Label.prototype.getFont = function() {
|
|
222
|
+
return this._font;
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Sets the font used to draw this label. Fonts are specified using the same syntax as the CSS 'font' property.
|
|
227
|
+
*
|
|
228
|
+
* @memberof Label
|
|
229
|
+
*
|
|
230
|
+
* @param {String} value The font.
|
|
231
|
+
*
|
|
232
|
+
* @exception {DeveloperError} value is required.
|
|
233
|
+
*
|
|
234
|
+
* @see Label#getFont
|
|
235
|
+
* @see Label#setFillColor
|
|
236
|
+
* @see Label#setOutlineColor
|
|
237
|
+
* @see <a href='http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#text-styles'>HTML canvas 2D context text styles</a>
|
|
238
|
+
*/
|
|
239
|
+
Label.prototype.setFont = function(value) {
|
|
240
|
+
if (typeof value === 'undefined') {
|
|
241
|
+
throw new DeveloperError('value is required.');
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
if (this._font !== value) {
|
|
245
|
+
this._font = value;
|
|
246
|
+
rebindAllGlyphs(this);
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Gets the fill color of this label.
|
|
252
|
+
*
|
|
253
|
+
* @memberof Label
|
|
254
|
+
*
|
|
255
|
+
* @see Label#setFillColor
|
|
256
|
+
* @see <a href='http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#fill-and-stroke-styles'>HTML canvas 2D context fill and stroke styles</a>
|
|
257
|
+
*/
|
|
258
|
+
Label.prototype.getFillColor = function() {
|
|
259
|
+
return this._fillColor;
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Sets the fill color of this label.
|
|
264
|
+
*
|
|
265
|
+
* @memberof Label
|
|
266
|
+
*
|
|
267
|
+
* @param {Color} value The fill color.
|
|
268
|
+
*
|
|
269
|
+
* @exception {DeveloperError} value is required.
|
|
270
|
+
*
|
|
271
|
+
* @see Label#getFillColor
|
|
272
|
+
* @see Label#setOutlineColor
|
|
273
|
+
* @see Label#setFont
|
|
274
|
+
* @see <a href='http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#fill-and-stroke-styles'>HTML canvas 2D context fill and stroke styles</a>
|
|
275
|
+
*/
|
|
276
|
+
Label.prototype.setFillColor = function(value) {
|
|
277
|
+
if (typeof value === 'undefined') {
|
|
278
|
+
throw new DeveloperError('value is required.');
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
var fillColor = this._fillColor;
|
|
282
|
+
if (!Color.equals(fillColor, value)) {
|
|
283
|
+
Color.clone(value, fillColor);
|
|
284
|
+
rebindAllGlyphs(this);
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Gets the outline color of this label.
|
|
290
|
+
*
|
|
291
|
+
* @memberof Label
|
|
292
|
+
*
|
|
293
|
+
* @see Label#setOutlineColor
|
|
294
|
+
* @see <a href='http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#fill-and-stroke-styles'>HTML canvas 2D context fill and stroke styles</a>
|
|
295
|
+
*/
|
|
296
|
+
Label.prototype.getOutlineColor = function() {
|
|
297
|
+
return this._outlineColor;
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* Sets the outline color of this label.
|
|
302
|
+
*
|
|
303
|
+
* @memberof Label
|
|
304
|
+
*
|
|
305
|
+
* @param {Color} value The fill color.
|
|
306
|
+
*
|
|
307
|
+
* @exception {DeveloperError} value is required.
|
|
308
|
+
*
|
|
309
|
+
* @see Label#getOutlineColor
|
|
310
|
+
* @see Label#setFillColor
|
|
311
|
+
* @see Label#setFont
|
|
312
|
+
* @see <a href='http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#fill-and-stroke-styles'>HTML canvas 2D context fill and stroke styles</a>
|
|
313
|
+
*/
|
|
314
|
+
Label.prototype.setOutlineColor = function(value) {
|
|
315
|
+
if (typeof value === 'undefined') {
|
|
316
|
+
throw new DeveloperError('value is required.');
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
var outlineColor = this._outlineColor;
|
|
320
|
+
if (!Color.equals(outlineColor, value)) {
|
|
321
|
+
Color.clone(value, outlineColor);
|
|
322
|
+
rebindAllGlyphs(this);
|
|
323
|
+
}
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* Gets the style of this label.
|
|
328
|
+
*
|
|
329
|
+
* @memberof Label
|
|
330
|
+
*
|
|
331
|
+
* @see Label#setStyle
|
|
332
|
+
*/
|
|
333
|
+
Label.prototype.getStyle = function() {
|
|
334
|
+
return this._style;
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Sets the style of this label.
|
|
339
|
+
*
|
|
340
|
+
* @memberof Label
|
|
341
|
+
*
|
|
342
|
+
* @param {LabelStyle} value The style.
|
|
343
|
+
*
|
|
344
|
+
* @exception {DeveloperError} value is required.
|
|
345
|
+
*
|
|
346
|
+
* @see Label#getStyle
|
|
347
|
+
* @see Label#setOutlineColor
|
|
348
|
+
* @see Label#setFillColor
|
|
349
|
+
*/
|
|
350
|
+
Label.prototype.setStyle = function(value) {
|
|
351
|
+
if (typeof value === 'undefined') {
|
|
352
|
+
throw new DeveloperError('value is required.');
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
if (this._style !== value) {
|
|
356
|
+
this._style = value;
|
|
357
|
+
rebindAllGlyphs(this);
|
|
358
|
+
}
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* Returns the pixel offset from the origin of this label.
|
|
363
|
+
*
|
|
364
|
+
* @memberof Label
|
|
365
|
+
*
|
|
366
|
+
* @return {Cartesian2} The pixel offset of this label.
|
|
367
|
+
*
|
|
368
|
+
* @see Label#setPixelOffset
|
|
369
|
+
*/
|
|
370
|
+
Label.prototype.getPixelOffset = function() {
|
|
371
|
+
return this._pixelOffset;
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Sets the pixel offset in screen space from the origin of this label. This is commonly used
|
|
376
|
+
* to align multiple labels and billboards at the same position, e.g., an image and text. The
|
|
377
|
+
* screen space origin is the bottom, left corner of the canvas; <code>x</code> increases from
|
|
378
|
+
* left to right, and <code>y</code> increases from bottom to top.
|
|
379
|
+
* <br /><br />
|
|
380
|
+
* <code>value</code> can be either a {@link Cartesian2} or an object literal with
|
|
381
|
+
* <code>x</code> and <code>y</code> properties. A copy of <code>value</code> is made, so
|
|
382
|
+
* changing it after calling <code>setPixelOffset</code> does not affect the label's pixel
|
|
383
|
+
* offset; an explicit call to <code>setPixelOffset</code> is required.
|
|
384
|
+
* <br /><br />
|
|
385
|
+
* <div align='center'>
|
|
386
|
+
* <table border='0' cellpadding='5'><tr>
|
|
387
|
+
* <td align='center'><code>default</code><br/><img src='images/Label.setPixelOffset.default.png' width='250' height='188' /></td>
|
|
388
|
+
* <td align='center'><code>l.setPixelOffset({ x : 25, y : -75 });</code><br/><img src='images/Label.setPixelOffset.x50y-25.png' width='250' height='188' /></td>
|
|
389
|
+
* </tr></table>
|
|
390
|
+
* The label's origin is indicated by the yellow point.
|
|
391
|
+
* </div>
|
|
392
|
+
*
|
|
393
|
+
* @memberof Label
|
|
394
|
+
*
|
|
395
|
+
* @param {Cartesian2} value The 2D Cartesian pixel offset.
|
|
396
|
+
*
|
|
397
|
+
* @exception {DeveloperError} value is required.
|
|
398
|
+
*
|
|
399
|
+
* @see Label#getPixelOffset
|
|
400
|
+
* @see Billboard#setPixelOffset
|
|
401
|
+
*/
|
|
402
|
+
Label.prototype.setPixelOffset = function(value) {
|
|
403
|
+
if (typeof value === 'undefined') {
|
|
404
|
+
throw new DeveloperError('value is required.');
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
var pixelOffset = this._pixelOffset;
|
|
408
|
+
if (!Cartesian2.equals(pixelOffset, value)) {
|
|
409
|
+
Cartesian2.clone(value, pixelOffset);
|
|
410
|
+
repositionAllGlyphs(this);
|
|
411
|
+
}
|
|
412
|
+
};
|
|
413
|
+
|
|
414
|
+
/**
|
|
415
|
+
* Returns the 3D Cartesian offset applied to this label in eye coordinates.
|
|
416
|
+
*
|
|
417
|
+
* @memberof Label
|
|
418
|
+
*
|
|
419
|
+
* @return {Cartesian3} The 3D Cartesian offset applied to this label in eye coordinates.
|
|
420
|
+
*
|
|
421
|
+
* @see Label#setEyeOffset
|
|
422
|
+
*/
|
|
423
|
+
Label.prototype.getEyeOffset = function() {
|
|
424
|
+
return this._eyeOffset;
|
|
425
|
+
};
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* Sets the 3D Cartesian offset applied to this label in eye coordinates. Eye coordinates is a left-handed
|
|
429
|
+
* coordinate system, where <code>x</code> points towards the viewer's right, <code>y</code> points up, and
|
|
430
|
+
* <code>z</code> points into the screen. Eye coordinates use the same scale as world and model coordinates,
|
|
431
|
+
* which is typically meters.
|
|
432
|
+
* <br /><br />
|
|
433
|
+
* An eye offset is commonly used to arrange multiple label or objects at the same position, e.g., to
|
|
434
|
+
* arrange a label above its corresponding 3D model.
|
|
435
|
+
* <br /><br />
|
|
436
|
+
* <code>value</code> can be either a {@link Cartesian3} or an object literal with <code>x</code>,
|
|
437
|
+
* <code>y</code>, and <code>z</code> properties. A copy of <code>value</code> is made, so changing it after
|
|
438
|
+
* calling <code>setEyeOffset</code> does not affect the label's eye offset; an explicit call to
|
|
439
|
+
* <code>setEyeOffset</code> is required.
|
|
440
|
+
* <br /><br />
|
|
441
|
+
* Below, the label is positioned at the center of the Earth but an eye offset makes it always
|
|
442
|
+
* appear on top of the Earth regardless of the viewer's or Earth's orientation.
|
|
443
|
+
* <br /><br />
|
|
444
|
+
* <div align='center'>
|
|
445
|
+
* <table border='0' cellpadding='5'><tr>
|
|
446
|
+
* <td align='center'><img src='images/Billboard.setEyeOffset.one.png' width='250' height='188' /></td>
|
|
447
|
+
* <td align='center'><img src='images/Billboard.setEyeOffset.two.png' width='250' height='188' /></td>
|
|
448
|
+
* </tr></table>
|
|
449
|
+
* <code>l.setEyeOffset({ x : 0.0, y : 8000000.0, z : 0.0 });</code><br /><br />
|
|
450
|
+
* </div>
|
|
451
|
+
*
|
|
452
|
+
* @memberof Label
|
|
453
|
+
*
|
|
454
|
+
* @param {Cartesian3} value The 3D Cartesian offset in eye coordinates.
|
|
455
|
+
*
|
|
456
|
+
* @exception {DeveloperError} value is required.
|
|
457
|
+
*
|
|
458
|
+
* @see Label#getEyeOffset
|
|
459
|
+
*/
|
|
460
|
+
Label.prototype.setEyeOffset = function(value) {
|
|
461
|
+
if (typeof value === 'undefined') {
|
|
462
|
+
throw new DeveloperError('value is required.');
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
var eyeOffset = this._eyeOffset;
|
|
466
|
+
if (!Cartesian3.equals(eyeOffset, value)) {
|
|
467
|
+
Cartesian3.clone(value, eyeOffset);
|
|
468
|
+
|
|
469
|
+
var glyphs = this._glyphs;
|
|
470
|
+
for ( var i = 0, len = glyphs.length; i < len; i++) {
|
|
471
|
+
var glyph = glyphs[i];
|
|
472
|
+
if (typeof glyph.billboard !== 'undefined') {
|
|
473
|
+
glyph.billboard.setEyeOffset(value);
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* Returns the horizontal origin of this label.
|
|
481
|
+
*
|
|
482
|
+
* @memberof Label
|
|
483
|
+
*
|
|
484
|
+
* @return {HorizontalOrigin} The horizontal origin of this label.
|
|
485
|
+
*
|
|
486
|
+
* @see Label#setHorizontalOrigin
|
|
487
|
+
*/
|
|
488
|
+
Label.prototype.getHorizontalOrigin = function() {
|
|
489
|
+
return this._horizontalOrigin;
|
|
490
|
+
};
|
|
491
|
+
|
|
492
|
+
/**
|
|
493
|
+
* Sets the horizontal origin of this label, which determines if the label is drawn
|
|
494
|
+
* to the left, center, or right of its position.
|
|
495
|
+
* <br /><br />
|
|
496
|
+
* <div align='center'>
|
|
497
|
+
* <img src='images/Billboard.setHorizontalOrigin.png' width='400' height='300' /><br />
|
|
498
|
+
* </div>
|
|
499
|
+
*
|
|
500
|
+
* @memberof Label
|
|
501
|
+
*
|
|
502
|
+
* @param {HorizontalOrigin} value The horizontal origin.
|
|
503
|
+
*
|
|
504
|
+
* @exception {DeveloperError} value is required.
|
|
505
|
+
*
|
|
506
|
+
* @see Label#getHorizontalOrigin
|
|
507
|
+
* @see Label#setVerticalOrigin
|
|
508
|
+
*
|
|
509
|
+
* @example
|
|
510
|
+
* // Use a top, right origin
|
|
511
|
+
* l.setHorizontalOrigin(HorizontalOrigin.RIGHT);
|
|
512
|
+
* l.setVerticalOrigin(VerticalOrigin.TOP);
|
|
513
|
+
*/
|
|
514
|
+
Label.prototype.setHorizontalOrigin = function(value) {
|
|
515
|
+
if (typeof value === 'undefined') {
|
|
516
|
+
throw new DeveloperError('value is required.');
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
if (this._horizontalOrigin !== value) {
|
|
520
|
+
this._horizontalOrigin = value;
|
|
521
|
+
repositionAllGlyphs(this);
|
|
522
|
+
}
|
|
523
|
+
};
|
|
524
|
+
|
|
525
|
+
/**
|
|
526
|
+
* Returns the vertical origin of this label.
|
|
527
|
+
*
|
|
528
|
+
* @memberof Label
|
|
529
|
+
*
|
|
530
|
+
* @return {VerticalOrigin} The vertical origin of this label.
|
|
531
|
+
*
|
|
532
|
+
* @see Label#setVerticalOrigin
|
|
533
|
+
*/
|
|
534
|
+
Label.prototype.getVerticalOrigin = function() {
|
|
535
|
+
return this._verticalOrigin;
|
|
536
|
+
};
|
|
537
|
+
|
|
538
|
+
/**
|
|
539
|
+
* Sets the vertical origin of this label, which determines if the label is
|
|
540
|
+
* to the above, below, or at the center of its position.
|
|
541
|
+
* <br /><br />
|
|
542
|
+
* <div align='center'>
|
|
543
|
+
* <img src='images/Billboard.setVerticalOrigin.png' width='400' height='300' /><br />
|
|
544
|
+
* </div>
|
|
545
|
+
*
|
|
546
|
+
* @memberof Label
|
|
547
|
+
*
|
|
548
|
+
* @param {VerticalOrigin} value The vertical origin.
|
|
549
|
+
*
|
|
550
|
+
* @exception {DeveloperError} value is required.
|
|
551
|
+
*
|
|
552
|
+
* @see Label#getVerticalOrigin
|
|
553
|
+
* @see Label#setHorizontalOrigin
|
|
554
|
+
*
|
|
555
|
+
* @example
|
|
556
|
+
* // Use a top, right origin
|
|
557
|
+
* l.setHorizontalOrigin(HorizontalOrigin.RIGHT);
|
|
558
|
+
* l.setVerticalOrigin(VerticalOrigin.TOP);
|
|
559
|
+
*/
|
|
560
|
+
Label.prototype.setVerticalOrigin = function(value) {
|
|
561
|
+
if (typeof value === 'undefined') {
|
|
562
|
+
throw new DeveloperError('value is required.');
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
if (this._verticalOrigin !== value) {
|
|
566
|
+
this._verticalOrigin = value;
|
|
567
|
+
repositionAllGlyphs(this);
|
|
568
|
+
}
|
|
569
|
+
};
|
|
570
|
+
|
|
571
|
+
/**
|
|
572
|
+
* Returns the uniform scale that is multiplied with the label's size in pixels.
|
|
573
|
+
*
|
|
574
|
+
* @memberof Label
|
|
575
|
+
*
|
|
576
|
+
* @return {Number} The scale used to size the label.
|
|
577
|
+
*
|
|
578
|
+
* @see Label#setScale
|
|
579
|
+
*/
|
|
580
|
+
Label.prototype.getScale = function() {
|
|
581
|
+
return this._scale;
|
|
582
|
+
};
|
|
583
|
+
|
|
584
|
+
/**
|
|
585
|
+
* Sets the uniform scale that is multiplied with the label's size in pixels.
|
|
586
|
+
* A scale of <code>1.0</code> does not change the size of the label; a scale greater than
|
|
587
|
+
* <code>1.0</code> enlarges the label; a positive scale less than <code>1.0</code> shrinks
|
|
588
|
+
* the label.
|
|
589
|
+
* <br /><br />
|
|
590
|
+
* Applying a large scale value may pixelate the label. To make text larger without pixelation,
|
|
591
|
+
* use a larger font size when calling {@link Label#setFont} instead.
|
|
592
|
+
* <br /><br />
|
|
593
|
+
* <div align='center'>
|
|
594
|
+
* <img src='images/Label.setScale.png' width='400' height='300' /><br/>
|
|
595
|
+
* From left to right in the above image, the scales are <code>0.5</code>, <code>1.0</code>,
|
|
596
|
+
* and <code>2.0</code>.
|
|
597
|
+
* </div>
|
|
598
|
+
*
|
|
599
|
+
* @memberof Label
|
|
600
|
+
*
|
|
601
|
+
* @param {Number} value The scale used to size the label.
|
|
602
|
+
*
|
|
603
|
+
* @exception {DeveloperError} value is required.
|
|
604
|
+
*
|
|
605
|
+
* @see Label#getScale
|
|
606
|
+
* @see Label#setFont
|
|
607
|
+
*/
|
|
608
|
+
Label.prototype.setScale = function(value) {
|
|
609
|
+
if (typeof value === 'undefined') {
|
|
610
|
+
throw new DeveloperError('value is required.');
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
if (this._scale !== value) {
|
|
614
|
+
this._scale = value;
|
|
615
|
+
|
|
616
|
+
var glyphs = this._glyphs;
|
|
617
|
+
for ( var i = 0, len = glyphs.length; i < len; i++) {
|
|
618
|
+
var glyph = glyphs[i];
|
|
619
|
+
if (typeof glyph.billboard !== 'undefined') {
|
|
620
|
+
glyph.billboard.setScale(value);
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
repositionAllGlyphs(this);
|
|
625
|
+
}
|
|
626
|
+
};
|
|
627
|
+
|
|
628
|
+
/**
|
|
629
|
+
* Computes the screen-space position of the label's origin, taking into account eye and pixel offsets.
|
|
630
|
+
* The screen space origin is the bottom, left corner of the canvas; <code>x</code> increases from
|
|
631
|
+
* left to right, and <code>y</code> increases from bottom to top.
|
|
632
|
+
*
|
|
633
|
+
* @memberof Label
|
|
634
|
+
*
|
|
635
|
+
* @param {UniformState} uniformState The same state object passed to {@link LabelCollection#update}.
|
|
636
|
+
* @param {FrameState} frameState The same state object passed to {@link LabelCollection#update}.
|
|
637
|
+
*
|
|
638
|
+
* @return {Cartesian2} The screen-space position of the label.
|
|
639
|
+
*
|
|
640
|
+
* @exception {DeveloperError} uniformState is required.
|
|
641
|
+
* @exception {DeveloperError} frameState is required.
|
|
642
|
+
*
|
|
643
|
+
* @see Label#setEyeOffset
|
|
644
|
+
* @see Label#setPixelOffset
|
|
645
|
+
*
|
|
646
|
+
* @example
|
|
647
|
+
* console.log(l.computeScreenSpacePosition(scene.getUniformState(), scene.getFrameState()).toString());
|
|
648
|
+
*/
|
|
649
|
+
Label.prototype.computeScreenSpacePosition = function(uniformState, frameState) {
|
|
650
|
+
if (typeof uniformState === 'undefined') {
|
|
651
|
+
throw new DeveloperError('uniformState is required.');
|
|
652
|
+
}
|
|
653
|
+
if (typeof frameState === 'undefined') {
|
|
654
|
+
throw new DeveloperError('frameState is required.');
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
var labelCollection = this._labelCollection;
|
|
658
|
+
var modelMatrix = labelCollection.modelMatrix;
|
|
659
|
+
var actualPosition = Billboard._computeActualPosition(this._position, frameState, labelCollection.morphTime, modelMatrix);
|
|
660
|
+
|
|
661
|
+
return Billboard._computeScreenSpacePosition(modelMatrix, actualPosition, this._eyeOffset, this._pixelOffset, labelCollection.clampToPixel, uniformState);
|
|
662
|
+
};
|
|
663
|
+
|
|
664
|
+
/**
|
|
665
|
+
* Determines if this label equals another label. Labels are equal if all their properties
|
|
666
|
+
* are equal. Labels in different collections can be equal.
|
|
667
|
+
*
|
|
668
|
+
* @memberof Label
|
|
669
|
+
*
|
|
670
|
+
* @param {Label} other The label to compare for equality.
|
|
671
|
+
*
|
|
672
|
+
* @return {Boolean} <code>true</code> if the labels are equal; otherwise, <code>false</code>.
|
|
673
|
+
*/
|
|
674
|
+
Label.prototype.equals = function(other) {
|
|
675
|
+
return this === other ||
|
|
676
|
+
typeof other !== 'undefined' &&
|
|
677
|
+
this._show === other._show &&
|
|
678
|
+
this._scale === other._scale &&
|
|
679
|
+
this._style === other._style &&
|
|
680
|
+
this._verticalOrigin === other._verticalOrigin &&
|
|
681
|
+
this._horizontalOrigin === other._horizontalOrigin &&
|
|
682
|
+
this._text === other._text &&
|
|
683
|
+
this._font === other._font &&
|
|
684
|
+
Cartesian3.equals(this._position, other._position) &&
|
|
685
|
+
Color.equals(this._fillColor, other._fillColor) &&
|
|
686
|
+
Color.equals(this._outlineColor, other._outlineColor) &&
|
|
687
|
+
Cartesian2.equals(this._pixelOffset, other._pixelOffset) &&
|
|
688
|
+
Cartesian3.equals(this._eyeOffset, other._eyeOffset);
|
|
689
|
+
};
|
|
690
|
+
|
|
691
|
+
/**
|
|
692
|
+
* Returns true if this object was destroyed; otherwise, false.
|
|
693
|
+
* <br /><br />
|
|
694
|
+
* If this object was destroyed, it should not be used; calling any function other than
|
|
695
|
+
* <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
|
|
696
|
+
*
|
|
697
|
+
* @memberof Label
|
|
698
|
+
*
|
|
699
|
+
* @return {Boolean} True if this object was destroyed; otherwise, false.
|
|
700
|
+
*/
|
|
701
|
+
Label.prototype.isDestroyed = function() {
|
|
702
|
+
return false;
|
|
703
|
+
};
|
|
704
|
+
|
|
705
|
+
return Label;
|
|
706
|
+
});
|