-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getTileDataAvailable() handling for terrain providers #2102
Changes from 7 commits
e0d0341
7a380e9
6a60a5b
427b6ac
576320a
7b3626a
e65ee54
ffbfd66
66229ac
b1c95a0
0c46ebb
25d222c
4517047
a361e49
c815459
3fbdd62
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -192,5 +192,16 @@ define([ | |
*/ | ||
TerrainProvider.prototype.getLevelMaximumGeometricError = DeveloperError.throwInstantiationError; | ||
|
||
/** | ||
* Determines whether data for a tile is available to be loaded. | ||
* @function | ||
* | ||
* @param {Number} x The X coordinate of the tile for which to request geometry. | ||
* @param {Number} y The Y coordinate of the tile for which to request geometry. | ||
* @param {Number} level The level of the tile for which to request geometry. | ||
* @returns {Number} Undefined if not supported by the terrain provider, otherwise true or false. | ||
*/ | ||
TerrainProvider.prototype.getTileDataAvailable = DeveloperError.throwInstantiationError; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a breaking change for folks who implemented We should provide a default implementation to not break them and perhaps warn if we want to eventually require this. See the Deprecation Guide. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I see There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Currently there are no "base classes" or inheritance in Cesium. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, right. This is still a little sketchy. It's as if we want to document this function as optional so users know they need to check to see if the function exists or we need to start using inheritance of whatever form to avoid this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I believe inheritance would have a performance cost we'd rather not pay. I agree it should be documented as optional, though. |
||
|
||
return TerrainProvider; | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<!DOCTYPE html> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why submit this and SanFrancisco.html? Why not profile with the Sandcastle app? I would prefer that we not include somewhat random files like these in the repo. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suspect this is to get the total seconds as part of the network profile? I'd still rather not have these here; it is yet another place we need to remember to update. Perhaps just separate Sandcastle examples would be OK - long-term, we may have a label for examples not included in the final release but used for testing and profiling. Or perhaps there is a way another way to get a time interval from the network profile? Or just not submit anything for now. |
||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"> | ||
<!-- Use Chrome Frame in IE --> | ||
<meta name="viewport" content="width=device-width, height=device-height, 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="../../Apps/Sandcastle/Sandcastle-header.js"></script> | ||
<script type="text/javascript" src="../../ThirdParty/requirejs-2.1.9/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(../../Apps/Sandcastle/templates/bucket.css); | ||
</style> | ||
<div id="cesiumContainer" class="fullSize"></div> | ||
<div id="toolbar"></div> | ||
<script id="cesium_sandcastle_script"> | ||
function startup(Cesium) { | ||
"use strict"; | ||
|
||
var cesiumTerrainProviderMeshes = new Cesium.CesiumTerrainProvider({ | ||
url : '//cesiumjs.org/stk-terrain/tilesets/world/tiles' | ||
}); | ||
|
||
var viewer = new Cesium.Viewer('cesiumContainer'); | ||
var scene = viewer.scene; | ||
scene.terrainProvider = cesiumTerrainProviderMeshes; | ||
|
||
var setCamera = function(){ | ||
var eye = new Cesium.Cartesian3(-2496304.1498512086, -4391818.97382059, 3884176.4503971986); | ||
var target = Cesium.Cartesian3.add(eye, new Cesium.Cartesian3(0.9279518715011381, -0.29488412129953234, -0.22792252890604328), new Cesium.Cartesian3()); | ||
var up = new Cesium.Cartesian3(-0.11836693744723503, -0.8130611584421428, 0.5700182635106171); | ||
scene.camera.lookAt(eye, target, up); | ||
} | ||
|
||
setCamera(); | ||
|
||
// Half Dome | ||
setInterval(setCamera, 1000); | ||
} | ||
if (typeof Cesium !== "undefined") { | ||
startup(Cesium); | ||
} else if (typeof require === "function") { | ||
require(["Cesium"], startup); | ||
} | ||
</script> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"> | ||
<!-- Use Chrome Frame in IE --> | ||
<meta name="viewport" content="width=device-width, height=device-height, 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="../../Apps/Sandcastle/Sandcastle-header.js"></script> | ||
<script type="text/javascript" src="../../ThirdParty/requirejs-2.1.9/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(../../Apps/Sandcastle/templates/bucket.css); | ||
</style> | ||
<div id="cesiumContainer" class="fullSize"></div> | ||
<div id="toolbar"></div> | ||
<script id="cesium_sandcastle_script"> | ||
function startup(Cesium) { | ||
"use strict"; | ||
|
||
var cesiumTerrainProviderMeshes = new Cesium.CesiumTerrainProvider({ | ||
url : '//cesiumjs.org/stk-terrain/tilesets/world/tiles' | ||
}); | ||
|
||
var viewer = new Cesium.Viewer('cesiumContainer'); | ||
var scene = viewer.scene; | ||
scene.terrainProvider = cesiumTerrainProviderMeshes; | ||
|
||
var setCamera = function(){ | ||
var eye = new Cesium.Cartesian3(-2703493, -4261486, 3887588); | ||
var target = Cesium.Cartesian3.add(eye, new Cesium.Cartesian3(-0.3, 0.9, 0.4), new Cesium.Cartesian3()); | ||
var up = new Cesium.Cartesian3(-0.6502679490649945, -0.3129458646313862, 0.6922546353438556); | ||
scene.camera.lookAt(eye, target, up); | ||
} | ||
|
||
setCamera(); | ||
|
||
setInterval(function(){ | ||
setCamera(); | ||
}, 1000); | ||
} | ||
if (typeof Cesium !== "undefined") { | ||
startup(Cesium); | ||
} else if (typeof require === "function") { | ||
require(["Cesium"], startup); | ||
} | ||
</script> | ||
</body> | ||
</html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be
{Boolean}
, right?