cesium 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- 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,277 @@
|
|
1
|
+
/**
|
2
|
+
* @fileOverview
|
3
|
+
* @license
|
4
|
+
*
|
5
|
+
* Grauw URI utilities
|
6
|
+
*
|
7
|
+
* See: http://hg.grauw.nl/grauw-lib/file/tip/src/uri.js
|
8
|
+
*
|
9
|
+
* @author Laurens Holst (http://www.grauw.nl/)
|
10
|
+
*
|
11
|
+
* Copyright 2012 Laurens Holst
|
12
|
+
*
|
13
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
14
|
+
* you may not use this file except in compliance with the License.
|
15
|
+
* You may obtain a copy of the License at
|
16
|
+
*
|
17
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
18
|
+
*
|
19
|
+
* Unless required by applicable law or agreed to in writing, software
|
20
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
21
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
22
|
+
* See the License for the specific language governing permissions and
|
23
|
+
* limitations under the License.
|
24
|
+
*
|
25
|
+
*/
|
26
|
+
/*global define*/
|
27
|
+
define(function() {
|
28
|
+
|
29
|
+
/**
|
30
|
+
* Constructs a URI object.
|
31
|
+
* @constructor
|
32
|
+
* @class Implementation of URI parsing and base URI resolving algorithm in RFC 3986.
|
33
|
+
* @param {string|URI} uri A string or URI object to create the object from.
|
34
|
+
*/
|
35
|
+
function URI(uri) {
|
36
|
+
if (uri instanceof URI) { // copy constructor
|
37
|
+
this.scheme = uri.scheme;
|
38
|
+
this.authority = uri.authority;
|
39
|
+
this.path = uri.path;
|
40
|
+
this.query = uri.query;
|
41
|
+
this.fragment = uri.fragment;
|
42
|
+
} else if (uri) { // uri is URI string or cast to string
|
43
|
+
var c = parseRegex.exec(uri);
|
44
|
+
this.scheme = c[1];
|
45
|
+
this.authority = c[2];
|
46
|
+
this.path = c[3];
|
47
|
+
this.query = c[4];
|
48
|
+
this.fragment = c[5];
|
49
|
+
}
|
50
|
+
};
|
51
|
+
|
52
|
+
// Initial values on the prototype
|
53
|
+
URI.prototype.scheme = null;
|
54
|
+
URI.prototype.authority = null;
|
55
|
+
URI.prototype.path = '';
|
56
|
+
URI.prototype.query = null;
|
57
|
+
URI.prototype.fragment = null;
|
58
|
+
|
59
|
+
// Regular expression from RFC 3986 appendix B
|
60
|
+
var parseRegex = new RegExp('^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$');
|
61
|
+
|
62
|
+
/**
|
63
|
+
* Returns the scheme part of the URI.
|
64
|
+
* In "http://example.com:80/a/b?x#y" this is "http".
|
65
|
+
*/
|
66
|
+
URI.prototype.getScheme = function() {
|
67
|
+
return this.scheme;
|
68
|
+
};
|
69
|
+
|
70
|
+
/**
|
71
|
+
* Returns the authority part of the URI.
|
72
|
+
* In "http://example.com:80/a/b?x#y" this is "example.com:80".
|
73
|
+
*/
|
74
|
+
URI.prototype.getAuthority = function() {
|
75
|
+
return this.authority;
|
76
|
+
};
|
77
|
+
|
78
|
+
/**
|
79
|
+
* Returns the path part of the URI.
|
80
|
+
* In "http://example.com:80/a/b?x#y" this is "/a/b".
|
81
|
+
* In "mailto:mike@example.com" this is "mike@example.com".
|
82
|
+
*/
|
83
|
+
URI.prototype.getPath = function() {
|
84
|
+
return this.path;
|
85
|
+
};
|
86
|
+
|
87
|
+
/**
|
88
|
+
* Returns the query part of the URI.
|
89
|
+
* In "http://example.com:80/a/b?x#y" this is "x".
|
90
|
+
*/
|
91
|
+
URI.prototype.getQuery = function() {
|
92
|
+
return this.query;
|
93
|
+
};
|
94
|
+
|
95
|
+
/**
|
96
|
+
* Returns the fragment part of the URI.
|
97
|
+
* In "http://example.com:80/a/b?x#y" this is "y".
|
98
|
+
*/
|
99
|
+
URI.prototype.getFragment = function() {
|
100
|
+
return this.fragment;
|
101
|
+
};
|
102
|
+
|
103
|
+
/**
|
104
|
+
* Tests whether the URI is an absolute URI.
|
105
|
+
* See RFC 3986 section 4.3.
|
106
|
+
*/
|
107
|
+
URI.prototype.isAbsolute = function() {
|
108
|
+
return !!this.scheme && !this.fragment;
|
109
|
+
};
|
110
|
+
|
111
|
+
///**
|
112
|
+
//* Extensive validation of the URI against the ABNF in RFC 3986
|
113
|
+
//*/
|
114
|
+
//URI.prototype.validate
|
115
|
+
|
116
|
+
/**
|
117
|
+
* Tests whether the URI is a same-document reference.
|
118
|
+
* See RFC 3986 section 4.4.
|
119
|
+
*
|
120
|
+
* To perform more thorough comparison, you can normalise the URI objects.
|
121
|
+
*/
|
122
|
+
URI.prototype.isSameDocumentAs = function(uri) {
|
123
|
+
return uri.scheme == this.scheme &&
|
124
|
+
uri.authority == this.authority &&
|
125
|
+
uri.path == this.path &&
|
126
|
+
uri.query == this.query;
|
127
|
+
};
|
128
|
+
|
129
|
+
/**
|
130
|
+
* Simple String Comparison of two URIs.
|
131
|
+
* See RFC 3986 section 6.2.1.
|
132
|
+
*
|
133
|
+
* To perform more thorough comparison, you can normalise the URI objects.
|
134
|
+
*/
|
135
|
+
URI.prototype.equals = function(uri) {
|
136
|
+
return this.isSameDocumentAs(uri) && uri.fragment == this.fragment;
|
137
|
+
};
|
138
|
+
|
139
|
+
/**
|
140
|
+
* Normalizes the URI using syntax-based normalization.
|
141
|
+
* This includes case normalization, percent-encoding normalization and path segment normalization.
|
142
|
+
* XXX: Percent-encoding normalization does not escape characters that need to be escaped.
|
143
|
+
* (Although that would not be a valid URI in the first place. See validate().)
|
144
|
+
* See RFC 3986 section 6.2.2.
|
145
|
+
*/
|
146
|
+
URI.prototype.normalize = function() {
|
147
|
+
this.removeDotSegments();
|
148
|
+
if (this.scheme)
|
149
|
+
this.scheme = this.scheme.toLowerCase();
|
150
|
+
if (this.authority)
|
151
|
+
this.authority = this.authority.replace(authorityRegex, replaceAuthority).
|
152
|
+
replace(caseRegex, replaceCase);
|
153
|
+
if (this.path)
|
154
|
+
this.path = this.path.replace(caseRegex, replaceCase);
|
155
|
+
if (this.query)
|
156
|
+
this.query = this.query.replace(caseRegex, replaceCase);
|
157
|
+
if (this.fragment)
|
158
|
+
this.fragment = this.fragment.replace(caseRegex, replaceCase);
|
159
|
+
};
|
160
|
+
|
161
|
+
var caseRegex = /%[0-9a-z]{2}/gi;
|
162
|
+
var percentRegex = /[a-zA-Z0-9\-\._~]/;
|
163
|
+
var authorityRegex = /(.*@)?([^@:]*)(:.*)?/;
|
164
|
+
|
165
|
+
function replaceCase(str) {
|
166
|
+
var dec = unescape(str);
|
167
|
+
return percentRegex.test(dec) ? dec : str.toUpperCase();
|
168
|
+
}
|
169
|
+
|
170
|
+
function replaceAuthority(str, p1, p2, p3) {
|
171
|
+
return (p1 || '') + p2.toLowerCase() + (p3 || '');
|
172
|
+
}
|
173
|
+
|
174
|
+
/**
|
175
|
+
* Resolve a relative URI (this) against a base URI.
|
176
|
+
* The base URI must be an absolute URI.
|
177
|
+
* See RFC 3986 section 5.2
|
178
|
+
*/
|
179
|
+
URI.prototype.resolve = function(baseURI) {
|
180
|
+
var uri = new URI();
|
181
|
+
if (this.scheme) {
|
182
|
+
uri.scheme = this.scheme;
|
183
|
+
uri.authority = this.authority;
|
184
|
+
uri.path = this.path;
|
185
|
+
uri.query = this.query;
|
186
|
+
} else {
|
187
|
+
uri.scheme = baseURI.scheme;
|
188
|
+
if (this.authority) {
|
189
|
+
uri.authority = this.authority;
|
190
|
+
uri.path = this.path;
|
191
|
+
uri.query = this.query;
|
192
|
+
} else {
|
193
|
+
uri.authority = baseURI.authority;
|
194
|
+
if (this.path == '') {
|
195
|
+
uri.path = baseURI.path;
|
196
|
+
uri.query = this.query || baseURI.query;
|
197
|
+
} else {
|
198
|
+
if (this.path.charAt(0) == '/') {
|
199
|
+
uri.path = this.path;
|
200
|
+
uri.removeDotSegments();
|
201
|
+
} else {
|
202
|
+
if (baseURI.authority && baseURI.path == '') {
|
203
|
+
uri.path = '/' + this.path;
|
204
|
+
} else {
|
205
|
+
uri.path = baseURI.path.substring(0, baseURI.path.lastIndexOf('/') + 1) + this.path;
|
206
|
+
}
|
207
|
+
uri.removeDotSegments();
|
208
|
+
}
|
209
|
+
uri.query = this.query;
|
210
|
+
}
|
211
|
+
}
|
212
|
+
}
|
213
|
+
uri.fragment = this.fragment;
|
214
|
+
return uri;
|
215
|
+
};
|
216
|
+
|
217
|
+
/**
|
218
|
+
* Remove dot segments from path.
|
219
|
+
* See RFC 3986 section 5.2.4
|
220
|
+
* @private
|
221
|
+
*/
|
222
|
+
URI.prototype.removeDotSegments = function() {
|
223
|
+
var input = this.path.split('/'),
|
224
|
+
output = [],
|
225
|
+
segment,
|
226
|
+
absPath = input[0] == '';
|
227
|
+
if (absPath)
|
228
|
+
input.shift();
|
229
|
+
var sFirst = input[0] == '' ? input.shift() : null;
|
230
|
+
while (input.length) {
|
231
|
+
segment = input.shift();
|
232
|
+
if (segment == '..') {
|
233
|
+
output.pop();
|
234
|
+
} else if (segment != '.') {
|
235
|
+
output.push(segment);
|
236
|
+
}
|
237
|
+
}
|
238
|
+
if (segment == '.' || segment == '..')
|
239
|
+
output.push('');
|
240
|
+
if (absPath)
|
241
|
+
output.unshift('');
|
242
|
+
this.path = output.join('/');
|
243
|
+
};
|
244
|
+
|
245
|
+
/**
|
246
|
+
* Resolves a relative URI against an absolute base URI.
|
247
|
+
* Convenience method.
|
248
|
+
* @param {String} uri the relative URI to resolve
|
249
|
+
* @param {String} baseURI the base URI (must be absolute) to resolve against
|
250
|
+
*/
|
251
|
+
URI.resolve = function(sURI, sBaseURI) {
|
252
|
+
var uri = cache[sURI] || (cache[sURI] = new URI(sURI));
|
253
|
+
var baseURI = cache[sBaseURI] || (cache[sBaseURI] = new URI(sBaseURI));
|
254
|
+
return uri.resolve(baseURI).toString();
|
255
|
+
};
|
256
|
+
|
257
|
+
var cache = {};
|
258
|
+
|
259
|
+
/**
|
260
|
+
* Serialises the URI to a string.
|
261
|
+
*/
|
262
|
+
URI.prototype.toString = function() {
|
263
|
+
var result = '';
|
264
|
+
if (this.scheme)
|
265
|
+
result += this.scheme + ':';
|
266
|
+
if (this.authority)
|
267
|
+
result += '//' + this.authority;
|
268
|
+
result += this.path;
|
269
|
+
if (this.query)
|
270
|
+
result += '?' + this.query;
|
271
|
+
if (this.fragment)
|
272
|
+
result += '#' + this.fragment;
|
273
|
+
return result;
|
274
|
+
};
|
275
|
+
|
276
|
+
return URI;
|
277
|
+
});
|
@@ -0,0 +1,197 @@
|
|
1
|
+
/**
|
2
|
+
@license
|
3
|
+
fontmetrics.js - https://github.com/Pomax/fontmetrics.js
|
4
|
+
|
5
|
+
This library rewrites the Canvas2D "measureText" function
|
6
|
+
so that it returns a more complete metrics object.
|
7
|
+
This library is licensed under the MIT (Expat) license,
|
8
|
+
the text for which is included below.
|
9
|
+
|
10
|
+
** -----------------------------------------------------------------------------
|
11
|
+
|
12
|
+
CHANGELOG:
|
13
|
+
|
14
|
+
2012-01-21 - Whitespace handling added by Joe Turner
|
15
|
+
(https://github.com/oampo)
|
16
|
+
|
17
|
+
** -----------------------------------------------------------------------------
|
18
|
+
|
19
|
+
Copyright (C) 2011 by Mike "Pomax" Kamermans
|
20
|
+
|
21
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
22
|
+
of this software and associated documentation files (the "Software"), to deal
|
23
|
+
in the Software without restriction, including without limitation the rights
|
24
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
25
|
+
copies of the Software, and to permit persons to whom the Software is
|
26
|
+
furnished to do so, subject to the following conditions:
|
27
|
+
|
28
|
+
The above copyright notice and this permission notice shall be included in
|
29
|
+
all copies or substantial portions of the Software.
|
30
|
+
|
31
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
32
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
33
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
34
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
35
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
36
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
37
|
+
THE SOFTWARE.
|
38
|
+
**/
|
39
|
+
/*global define*/
|
40
|
+
define(function() {
|
41
|
+
/*jshint strict:false*/
|
42
|
+
/*
|
43
|
+
var NAME = "FontMetrics Library"
|
44
|
+
var VERSION = "1-2012.0121.1300";
|
45
|
+
|
46
|
+
// if there is no getComputedStyle, this library won't work.
|
47
|
+
if(!document.defaultView.getComputedStyle) {
|
48
|
+
throw("ERROR: 'document.defaultView.getComputedStyle' not found. This library only works in browsers that can report computed CSS values.");
|
49
|
+
}
|
50
|
+
|
51
|
+
// store the old text metrics function on the Canvas2D prototype
|
52
|
+
CanvasRenderingContext2D.prototype.measureTextWidth = CanvasRenderingContext2D.prototype.measureText;
|
53
|
+
*/
|
54
|
+
/**
|
55
|
+
* shortcut function for getting computed CSS values
|
56
|
+
*/
|
57
|
+
var getCSSValue = function(element, property) {
|
58
|
+
return document.defaultView.getComputedStyle(element,null).getPropertyValue(property);
|
59
|
+
};
|
60
|
+
/*
|
61
|
+
// debug function
|
62
|
+
var show = function(canvas, ctx, xstart, w, h, metrics)
|
63
|
+
{
|
64
|
+
document.body.appendChild(canvas);
|
65
|
+
ctx.strokeStyle = 'rgba(0, 0, 0, 0.5)';
|
66
|
+
|
67
|
+
ctx.beginPath();
|
68
|
+
ctx.moveTo(xstart,0);
|
69
|
+
ctx.lineTo(xstart,h);
|
70
|
+
ctx.closePath();
|
71
|
+
ctx.stroke();
|
72
|
+
|
73
|
+
ctx.beginPath();
|
74
|
+
ctx.moveTo(xstart+metrics.bounds.maxx,0);
|
75
|
+
ctx.lineTo(xstart+metrics.bounds.maxx,h);
|
76
|
+
ctx.closePath();
|
77
|
+
ctx.stroke();
|
78
|
+
|
79
|
+
ctx.beginPath();
|
80
|
+
ctx.moveTo(0,h/2-metrics.ascent);
|
81
|
+
ctx.lineTo(w,h/2-metrics.ascent);
|
82
|
+
ctx.closePath();
|
83
|
+
ctx.stroke();
|
84
|
+
|
85
|
+
ctx.beginPath();
|
86
|
+
ctx.moveTo(0,h/2+metrics.descent);
|
87
|
+
ctx.lineTo(w,h/2+metrics.descent);
|
88
|
+
ctx.closePath();
|
89
|
+
ctx.stroke();
|
90
|
+
}
|
91
|
+
*/
|
92
|
+
/**
|
93
|
+
* The new text metrics function
|
94
|
+
*/
|
95
|
+
var measureText = function(context2D, textstring) {
|
96
|
+
var metrics = context2D.measureText(textstring),
|
97
|
+
fontFamily = getCSSValue(context2D.canvas,"font-family"),
|
98
|
+
fontSize = getCSSValue(context2D.canvas,"font-size").replace("px",""),
|
99
|
+
isSpace = !(/\S/.test(textstring));
|
100
|
+
metrics.fontsize = fontSize;
|
101
|
+
|
102
|
+
// for text lead values, we meaure a multiline text container.
|
103
|
+
var leadDiv = document.createElement("div");
|
104
|
+
leadDiv.style.position = "absolute";
|
105
|
+
leadDiv.style.opacity = 0;
|
106
|
+
leadDiv.style.font = fontSize + "px " + fontFamily;
|
107
|
+
leadDiv.innerHTML = textstring + "<br/>" + textstring;
|
108
|
+
document.body.appendChild(leadDiv);
|
109
|
+
|
110
|
+
// make some initial guess at the text leading (using the standard TeX ratio)
|
111
|
+
metrics.leading = 1.2 * fontSize;
|
112
|
+
|
113
|
+
// then we try to get the real value from the browser
|
114
|
+
var leadDivHeight = getCSSValue(leadDiv,"height");
|
115
|
+
leadDivHeight = leadDivHeight.replace("px","");
|
116
|
+
if (leadDivHeight >= fontSize * 2) { metrics.leading = (leadDivHeight/2) | 0; }
|
117
|
+
document.body.removeChild(leadDiv);
|
118
|
+
|
119
|
+
// if we're not dealing with white space, we can compute metrics
|
120
|
+
if (!isSpace) {
|
121
|
+
// Have characters, so measure the text
|
122
|
+
var canvas = document.createElement("canvas");
|
123
|
+
var padding = 100;
|
124
|
+
canvas.width = metrics.width + padding;
|
125
|
+
canvas.height = 3*fontSize;
|
126
|
+
canvas.style.opacity = 1;
|
127
|
+
canvas.style.fontFamily = fontFamily;
|
128
|
+
canvas.style.fontSize = fontSize;
|
129
|
+
var ctx = canvas.getContext("2d");
|
130
|
+
ctx.font = fontSize + "px " + fontFamily;
|
131
|
+
|
132
|
+
var w = canvas.width,
|
133
|
+
h = canvas.height,
|
134
|
+
baseline = h/2;
|
135
|
+
|
136
|
+
// Set all canvas pixeldata values to 255, with all the content
|
137
|
+
// data being 0. This lets us scan for data[i] != 255.
|
138
|
+
ctx.fillStyle = "white";
|
139
|
+
ctx.fillRect(-1, -1, w+2, h+2);
|
140
|
+
ctx.fillStyle = "black";
|
141
|
+
ctx.fillText(textstring, padding/2, baseline);
|
142
|
+
var pixelData = ctx.getImageData(0, 0, w, h).data;
|
143
|
+
|
144
|
+
// canvas pixel data is w*4 by h*4, because R, G, B and A are separate,
|
145
|
+
// consecutive values in the array, rather than stored as 32 bit ints.
|
146
|
+
var i = 0,
|
147
|
+
w4 = w * 4,
|
148
|
+
len = pixelData.length;
|
149
|
+
|
150
|
+
// Finding the ascent uses a normal, forward scanline
|
151
|
+
while (++i < len && pixelData[i] === 255) {}
|
152
|
+
var ascent = (i/w4)|0;
|
153
|
+
|
154
|
+
// Finding the descent uses a reverse scanline
|
155
|
+
i = len - 1;
|
156
|
+
while (--i > 0 && pixelData[i] === 255) {}
|
157
|
+
var descent = (i/w4)|0;
|
158
|
+
|
159
|
+
// find the min-x coordinate
|
160
|
+
for(i = 0; i<len && pixelData[i] === 255; ) {
|
161
|
+
i += w4;
|
162
|
+
if(i>=len) { i = (i-len) + 4; }}
|
163
|
+
var minx = ((i%w4)/4) | 0;
|
164
|
+
|
165
|
+
// find the max-x coordinate
|
166
|
+
var step = 1;
|
167
|
+
for(i = len-3; i>=0 && pixelData[i] === 255; ) {
|
168
|
+
i -= w4;
|
169
|
+
if(i<0) { i = (len - 3) - (step++)*4; }}
|
170
|
+
var maxx = ((i%w4)/4) + 1 | 0;
|
171
|
+
|
172
|
+
// set font metrics
|
173
|
+
metrics.ascent = (baseline - ascent);
|
174
|
+
metrics.descent = (descent - baseline);
|
175
|
+
metrics.bounds = { minx: minx - (padding/2),
|
176
|
+
maxx: maxx - (padding/2),
|
177
|
+
miny: 0,
|
178
|
+
maxy: descent-ascent };
|
179
|
+
metrics.height = 1+(descent - ascent);
|
180
|
+
}
|
181
|
+
|
182
|
+
// if we ARE dealing with whitespace, most values will just be zero.
|
183
|
+
else {
|
184
|
+
// Only whitespace, so we can't measure the text
|
185
|
+
metrics.ascent = 0;
|
186
|
+
metrics.descent = 0;
|
187
|
+
metrics.bounds = { minx: 0,
|
188
|
+
maxx: metrics.width, // Best guess
|
189
|
+
miny: 0,
|
190
|
+
maxy: 0 };
|
191
|
+
metrics.height = 0;
|
192
|
+
}
|
193
|
+
return metrics;
|
194
|
+
};
|
195
|
+
|
196
|
+
return measureText;
|
197
|
+
});
|