Permalink
Please sign in to comment.
Showing
with
2,567 additions
and 1,202 deletions.
- +0 −40 .eslintrc
- +6 −0 .eslintrc.json
- +2 −2 .idea/jsLibraryMappings.xml
- +1 −1 Apps/Sandcastle/{.eslintrc → .eslintrc.json}
- +106 −0 Apps/Sandcastle/gallery/Callback Property.html
- BIN Apps/Sandcastle/gallery/Callback Property.jpg
- +5 −0 CHANGES.md
- +22 −19 Source/Core/CesiumTerrainProvider.js
- +17 −31 Source/Core/Ellipsoid.js
- +3 −4 Source/Core/EllipsoidTerrainProvider.js
- +35 −30 Source/Core/GoogleEarthEnterpriseMetadata.js
- +52 −29 Source/Core/GoogleEarthEnterpriseTerrainProvider.js
- +100 −78 Source/Core/Heap.js
- +128 −22 Source/Core/Request.js
- +319 −335 Source/Core/RequestScheduler.js
- +64 −0 Source/Core/RequestState.js
- +30 −1 Source/Core/RequestType.js
- +3 −3 Source/Core/TerrainProvider.js
- +19 −15 Source/Core/VRTheWorldTerrainProvider.js
- +29 −0 Source/Core/isBlobUri.js
- +6 −6 Source/Core/isDataUri.js
- +7 −6 Source/Core/loadArrayBuffer.js
- +7 −6 Source/Core/loadBlob.js
- +10 −5 Source/Core/loadCRN.js
- +36 −12 Source/Core/loadImage.js
- +6 −9 Source/Core/loadImageFromTypedArray.js
- +18 −10 Source/Core/loadImageViaBlob.js
- +11 −5 Source/Core/loadJson.js
- +30 −20 Source/Core/loadJsonp.js
- +9 −4 Source/Core/loadKTX.js
- +7 −5 Source/Core/loadText.js
- +42 −10 Source/Core/loadWithXhr.js
- +7 −5 Source/Core/loadXML.js
- +1 −1 Source/Core/sampleTerrain.js
- +0 −95 Source/Core/throttleRequestByServer.js
- +2 −2 Source/Renderer/loadCubeMap.js
- +3 −2 Source/Scene/ArcGisMapServerImageryProvider.js
- +3 −2 Source/Scene/BingMapsImageryProvider.js
- +49 −19 Source/Scene/Camera.js
- +31 −1 Source/Scene/GlobeSurfaceTile.js
- +15 −6 Source/Scene/GoogleEarthEnterpriseImageryProvider.js
- +3 −2 Source/Scene/GoogleEarthEnterpriseMapsProvider.js
- +1 −1 Source/Scene/GoogleEarthImageryProvider.js
- +2 −1 Source/Scene/GridImageryProvider.js
- +5 −2 Source/Scene/Imagery.js
- +26 −2 Source/Scene/ImageryLayer.js
- +10 −9 Source/Scene/ImageryProvider.js
- +3 −2 Source/Scene/MapboxImageryProvider.js
- +2 −2 Source/Scene/Model.js
- +0 −1 Source/Scene/QuadtreePrimitive.js
- +1 −0 Source/Scene/QuadtreeTile.js
- +1 −1 Source/Scene/Scene.js
- +2 −1 Source/Scene/SingleTileImageryProvider.js
- +2 −1 Source/Scene/TileCoordinatesImageryProvider.js
- +2 −2 Source/Scene/TileImagery.js
- +33 −15 Source/Scene/TileTerrain.js
- +5 −5 Source/Scene/UrlTemplateImageryProvider.js
- +3 −2 Source/Scene/WebMapServiceImageryProvider.js
- +3 −2 Source/Scene/WebMapTileServiceImageryProvider.js
- +1 −1 Specs/{.eslintrc → .eslintrc.json}
- +20 −6 Specs/Core/CesiumTerrainProviderSpec.js
- +11 −6 Specs/Core/GoogleEarthEnterpriseMetadataSpec.js
- +21 −9 Specs/Core/GoogleEarthEnterpriseTerrainProviderSpec.js
- +103 −22 Specs/Core/HeapSpec.js
- +482 −232 Specs/Core/RequestSchedulerSpec.js
- +17 −6 Specs/Core/VRTheWorldTerrainProviderSpec.js
- +27 −0 Specs/Core/isBlobUriSpec.js
- +6 −1 Specs/Core/isDataUriSpec.js
- +21 −2 Specs/Core/loadArrayBufferSpec.js
- +21 −2 Specs/Core/loadBlobSpec.js
- +21 −2 Specs/Core/loadCRNSpec.js
- +19 −0 Specs/Core/loadImageSpec.js
- +19 −0 Specs/Core/loadImageViaBlobSpec.js
- +21 −2 Specs/Core/loadJsonSpec.js
- +21 −2 Specs/Core/loadJsonpSpec.js
- +21 −2 Specs/Core/loadKTXSpec.js
- +21 −2 Specs/Core/loadTextSpec.js
- +24 −2 Specs/Core/loadWithXhrSpec.js
- +21 −2 Specs/Core/loadXMLSpec.js
- +12 −2 Specs/DomEventSimulator.js
- +10 −0 Specs/Scene/ArcGisMapServerImageryProviderSpec.js
- +10 −0 Specs/Scene/BingMapsImageryProviderSpec.js
- +46 −0 Specs/Scene/CameraSpec.js
- +15 −0 Specs/Scene/GlobeSurfaceTileSpec.js
- +10 −0 Specs/Scene/GoogleEarthEnterpriseImageryProviderSpec.js
- +6 −0 Specs/Scene/GoogleEarthEnterpriseMapsProviderSpec.js
- +9 −0 Specs/Scene/ImageryLayerSpec.js
- +10 −0 Specs/Scene/MapboxImageryProviderSpec.js
- +10 −0 Specs/Scene/UrlTemplateImageryProviderSpec.js
- +10 −0 Specs/Scene/WebMapServiceImageryProviderSpec.js
- +10 −0 Specs/Scene/WebMapTileServiceImageryProviderSpec.js
- +10 −0 Specs/Scene/createOpenStreetMapImageryProviderSpec.js
- +10 −0 Specs/Scene/createTileMapServiceImageryProviderSpec.js
- +3 −0 Tools/eslint-config-cesium/.eslintrc.json
- +6 −0 Tools/eslint-config-cesium/CHANGES.md
- +29 −0 Tools/eslint-config-cesium/README.md
- +12 −0 Tools/eslint-config-cesium/browser.js
- +37 −0 Tools/eslint-config-cesium/index.js
- +8 −0 Tools/eslint-config-cesium/node.js
- +25 −0 Tools/eslint-config-cesium/package.json
- +2 −2 package.json
- +2 −3 server.js
- +2 −2 web.config
| @@ -1,40 +0,0 @@ | ||
| -{ | ||
| - "extends": "eslint:recommended", | ||
| - "env": { | ||
| - "browser": true | ||
| - }, | ||
| - "globals": { | ||
| - "DataView": false, | ||
| - "ArrayBuffer": false, | ||
| - "Float32Array": false, | ||
| - "Float64Array": false, | ||
| - "Int16Array": false, | ||
| - "Int32Array": false, | ||
| - "Int8Array": false, | ||
| - "Uint16Array": false, | ||
| - "Uint32Array": false, | ||
| - "Uint8Array": false, | ||
| - "Uint8ClampedArray": false | ||
| - }, | ||
| - "plugins": [ | ||
| - "html" | ||
| - ], | ||
| - "rules": { | ||
| - "curly": ["error"], | ||
| - "eqeqeq": ["error"], | ||
| - "guard-for-in": ["error"], | ||
| - "new-cap": ["error", {"properties": false}], | ||
| - "no-caller": ["error"], | ||
| - "no-console": "off", | ||
| - "no-empty": ["error"], | ||
| - "no-extend-native": ["error"], | ||
| - "no-extra-boolean-cast": "off", | ||
| - "no-irregular-whitespace": ["error"], | ||
| - "no-new": ["error"], | ||
| - "no-undef": ["error"], | ||
| - "no-unused-vars": ["error", {"vars": "all", "args": "none"}], | ||
| - "semi": ["error"], | ||
| - "strict": ["error"], | ||
| - "wrap-iife": ["error", "any"] | ||
| - } | ||
| -} |
| @@ -0,0 +1,6 @@ | ||
| +{ | ||
| + "extends": "./Tools/eslint-config-cesium/browser.js", | ||
| + "rules": { | ||
| + "no-unused-vars": ["error", {"vars": "all", "args": "none"}] | ||
| + } | ||
| +} |
| @@ -1,7 +1,7 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project version="4"> | ||
| <component name="JavaScriptLibraryMappings"> | ||
| - <file url="file://$PROJECT_DIR$" libraries="{cesium/node_modules}" /> | ||
| <includedPredefinedLibrary name="WebGL" /> | ||
| + <excludedPredefinedLibrary name="cesium/Tools/eslint-config-cesium/node_modules" /> | ||
| </component> | ||
| -</project> | ||
| +</project> |
| @@ -0,0 +1,106 @@ | ||
| +<!DOCTYPE html> | ||
| +<html lang="en"> | ||
| +<head> | ||
| + <meta charset="utf-8"> | ||
| + <meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
| + <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> | ||
| + <meta name="description" content="Use Viewer to start building new applications or easily embed Cesium into existing applications."> | ||
| + <meta name="cesium-sandcastle-labels" content="Beginner, Showcases"> | ||
| + <title>Cesium Demo</title> | ||
| + <script type="text/javascript" src="../Sandcastle-header.js"></script> | ||
| + <script type="text/javascript" src="../../../ThirdParty/requirejs-2.1.20/require.js"></script> | ||
| + <script type="text/javascript"> | ||
| + require.config({ | ||
| + baseUrl : '../../../Source', | ||
| + waitSeconds : 60 | ||
| + }); | ||
| + </script> | ||
| +</head> | ||
| +<body class="sandcastle-loading" data-sandcastle-bucket="bucket-requirejs.html"> | ||
| +<style> | ||
| + @import url(../templates/bucket.css); | ||
| +</style> | ||
| +<div id="cesiumContainer" class="fullSize"></div> | ||
| +<div id="loadingOverlay"><h1>Loading...</h1></div> | ||
| +<div id="toolbar"></div> | ||
| +<script id="cesium_sandcastle_script"> | ||
| +function startup(Cesium) { | ||
| + 'use strict'; | ||
| +//Sandcastle_Begin | ||
| +// This example illustrates a Callback Property, a property whose | ||
| +// value is lazily evaluated by a callback function. | ||
| +// Use a CallbackProperty when your data can't be pre-computed | ||
| +// or needs to be derived from other properties at runtime. | ||
| +var viewer = new Cesium.Viewer('cesiumContainer'); | ||
| + | ||
| +var startLatitude = 35; | ||
| +var startLongitude = -120; | ||
| +var endLongitude; | ||
| +var startTime = Cesium.JulianDate.now(); | ||
| + | ||
| +// Add a polyline to the scene. Positions are dynamic. | ||
| +var isConstant = false; | ||
| +var redLine = viewer.entities.add({ | ||
| + polyline : { | ||
| + // This callback updates positions each frame. | ||
| + positions : new Cesium.CallbackProperty(function(time, result) { | ||
| + endLongitude = startLongitude + 0.001 * Cesium.JulianDate.secondsDifference(time, startTime); | ||
| + return Cesium.Cartesian3.fromDegreesArray([startLongitude, startLatitude, endLongitude, startLatitude], Cesium.Ellipsoid.WGS84, result); | ||
| + }, isConstant), | ||
| + width : 5, | ||
| + material : Cesium.Color.RED | ||
| + } | ||
| +}); | ||
| + | ||
| +var startCartographic = Cesium.Cartographic.fromDegrees(startLongitude, startLatitude); | ||
| + | ||
| +// use scratch object to avoid new allocations per frame. | ||
| +var endCartographic = new Cesium.Cartographic(); | ||
| +var scratch = new Cesium.Cartographic(); | ||
| +var geodesic = new Cesium.EllipsoidGeodesic(); | ||
| + | ||
| +// Calculate the length of the line | ||
| +function getLength(time, result) { | ||
| + // Get the end position from the polyLine's callback. | ||
| + var endPoint = redLine.polyline.positions.getValue(time, result)[1]; | ||
| + endCartographic = Cesium.Cartographic.fromCartesian(endPoint); | ||
| + | ||
| + geodesic.setEndPoints(startCartographic, endCartographic); | ||
| + var lengthInMeters = Math.round(geodesic.surfaceDistance); | ||
| + return (lengthInMeters / 1000).toFixed(1) + " km"; | ||
| +} | ||
| + | ||
| +function getMidpoint(time, result) { | ||
| + // Get the end position from the polyLine's callback. | ||
| + var endPoint = redLine.polyline.positions.getValue(time, result)[1]; | ||
| + endCartographic = Cesium.Cartographic.fromCartesian(endPoint); | ||
| + | ||
| + geodesic.setEndPoints(startCartographic, endCartographic); | ||
| + var midpointCartographic = geodesic.interpolateUsingFraction(0.5, scratch); | ||
| + return Cesium.Cartesian3.fromRadians(midpointCartographic.longitude, midpointCartographic.latitude); | ||
| +} | ||
| + | ||
| +// Label the polyline with calculated length. | ||
| +var label = viewer.entities.add({ | ||
| + position : new Cesium.CallbackProperty(getMidpoint, isConstant), | ||
| + label : { | ||
| + // This callback updates the length to print each frame. | ||
| + text: new Cesium.CallbackProperty(getLength, isConstant), | ||
| + font : '20px sans-serif', | ||
| + pixelOffset : new Cesium.Cartesian2(0.0, 20) | ||
| + } | ||
| +}); | ||
| + | ||
| +// Keep the view centered. | ||
| +viewer.trackedEntity = label; | ||
| +//Sandcastle_End | ||
| + Sandcastle.finishedLoading(); | ||
| +} | ||
| +if (typeof Cesium !== "undefined") { | ||
| + startup(Cesium); | ||
| +} else if (typeof require === "function") { | ||
| + require(["Cesium"], startup); | ||
| +} | ||
| +</script> | ||
| +</body> | ||
| +</html> |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
0 comments on commit
01bcc7d