-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into terrain-availability
- Loading branch information
Showing
21 changed files
with
531 additions
and
73 deletions.
There are no files selected for viewing
127 changes: 127 additions & 0 deletions
127
Apps/Sandcastle/gallery/Google Photorealistic 3D Tiles with Building Insert.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
<!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="module" src="../load-cesium-es6.js"></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"> | ||
window.startup = async function (Cesium) { | ||
"use strict"; | ||
//Sandcastle_Begin | ||
const viewer = new Cesium.Viewer("cesiumContainer", { | ||
timeline: false, | ||
animation: false, | ||
sceneModePicker: false, | ||
baseLayerPicker: false, | ||
}); | ||
|
||
// The globe does not need to be displayed, | ||
// since the Photorealistic 3D Tiles include terrain | ||
viewer.scene.globe.show = false; | ||
|
||
// Add Photorealistic 3D Tiles | ||
try { | ||
const googleTileset = await Cesium.createGooglePhotorealistic3DTileset(); | ||
viewer.scene.primitives.add(googleTileset); | ||
} catch (error) { | ||
console.log(`Error loading Photorealistic 3D Tiles tileset. | ||
${error}`); | ||
} | ||
|
||
// Add highlight of target lot for development | ||
const targetHighlight = new Cesium.Entity({ | ||
polygon: { | ||
hierarchy: Cesium.Cartesian3.fromDegreesArray( | ||
[ | ||
[-105.0077102972673, 39.75198671798765], | ||
[-105.0095858062031, 39.75049417970743], | ||
[-105.00969000114443, 39.75035082687128], | ||
[-105.00972838875393, 39.75013579705808], | ||
[-105.00971742086537, 39.74997136204101], | ||
[-105.00962967775735, 39.749768979944236], | ||
[-105.00932806082336, 39.74928832007956], | ||
[-105.00887837739427, 39.749444324087904], | ||
[-105.00854934073887, 39.749663572365904], | ||
[-105.00822578802776, 39.749967145754084], | ||
[-105.00715641889735, 39.751312128419926], | ||
[-105.00715641889735, 39.75135429046085], | ||
[-105.0077102972673, 39.75198671798765], | ||
].flat(2) | ||
), | ||
material: Cesium.Color.YELLOW.withAlpha(0.6), | ||
classificationType: Cesium.ClassificationType.CESIUM_3D_TILE, | ||
}, | ||
}); | ||
viewer.entities.add(targetHighlight); | ||
|
||
// Add tileset of proposed new building | ||
let buildingTileset; | ||
try { | ||
buildingTileset = await Cesium.Cesium3DTileset.fromIonAssetId( | ||
1670818 | ||
); | ||
viewer.scene.primitives.add(buildingTileset); | ||
} catch (error) { | ||
console.log(`Error loading building tileset. | ||
${error}`); | ||
} | ||
|
||
// Zoom to the new building location | ||
const cameraOffset = new Cesium.HeadingPitchRange( | ||
Cesium.Math.toRadians(95.0), | ||
Cesium.Math.toRadians(-18.0), | ||
600.0 | ||
); | ||
viewer.zoomTo(buildingTileset, cameraOffset); | ||
|
||
// Enable toggling of new building visibility | ||
Sandcastle.addToggleButton("Show proposed building", true, function ( | ||
checked | ||
) { | ||
buildingTileset.show = checked; | ||
}); | ||
|
||
// Enable toggling of target location highlight | ||
Sandcastle.addToggleButton("Highlight target location", true, function ( | ||
checked | ||
) { | ||
if (checked) { | ||
viewer.entities.add(targetHighlight); | ||
} else { | ||
viewer.entities.remove(targetHighlight); | ||
} | ||
}); //Sandcastle_End | ||
Sandcastle.finishedLoading(); | ||
}; | ||
if (typeof Cesium !== "undefined") { | ||
window.startupCalled = true; | ||
window.startup(Cesium).catch((error) => { | ||
"use strict"; | ||
console.error(error); | ||
}); | ||
} | ||
</script> | ||
</body> | ||
</html> |
Binary file added
BIN
+79.7 KB
Apps/Sandcastle/gallery/Google Photorealistic 3D Tiles with Building Insert.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
77 changes: 77 additions & 0 deletions
77
Apps/Sandcastle/gallery/Google Photorealistic 3D Tiles.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<!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="module" src="../load-cesium-es6.js"></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"> | ||
window.startup = async function (Cesium) { | ||
"use strict"; | ||
//Sandcastle_Begin | ||
const viewer = new Cesium.Viewer("cesiumContainer", { | ||
timeline: false, | ||
animation: false, | ||
sceneModePicker: false, | ||
baseLayerPicker: false, | ||
}); | ||
|
||
// The globe does not need to be displayed, | ||
// since the Photorealistic 3D Tiles include terrain | ||
viewer.scene.globe.show = false; | ||
|
||
// Add Photorealistic 3D Tiles | ||
try { | ||
const tileset = await Cesium.createGooglePhotorealistic3DTileset(); | ||
viewer.scene.primitives.add(tileset); | ||
} catch (error) { | ||
console.log(`Error loading Photorealistic 3D Tiles tileset. | ||
${error}`); | ||
} | ||
|
||
// Point the camera at the Googleplex | ||
viewer.scene.camera.setView({ | ||
destination: new Cesium.Cartesian3( | ||
-2693797.551060477, | ||
-4297135.517094725, | ||
3854700.7470414364 | ||
), | ||
orientation: new Cesium.HeadingPitchRoll( | ||
4.6550106925119925, | ||
-0.2863894863138836, | ||
1.3561760425773173e-7 | ||
), | ||
}); //Sandcastle_End | ||
Sandcastle.finishedLoading(); | ||
}; | ||
if (typeof Cesium !== "undefined") { | ||
window.startupCalled = true; | ||
window.startup(Cesium).catch((error) => { | ||
"use strict"; | ||
console.error(error); | ||
}); | ||
} | ||
</script> | ||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import Credit from "./Credit.js"; | ||
import defined from "./defined.js"; | ||
import Resource from "./Resource.js"; | ||
|
||
let defaultKeyCredit; | ||
const defaultKey = "AIzaSyBESBYnp1EcqtlAcjMTJ65GjUsJtaCWVXA"; | ||
|
||
/** | ||
* Default settings for accessing the Google Maps API. | ||
* <br/> | ||
* An API key is only required if you are using any Google Maps APIs, such as {@link createGooglePhotorealistic3DTileset}. | ||
* A default key is provided for evaluation purposes only. | ||
* Follow instructions for managing API keys for the Google Maps Platform at {@link https://developers.google.com/maps/documentation/embed/get-api-key} | ||
* | ||
* @see createGooglePhotorealistic3DTileset | ||
* @see https://developers.google.com/maps/documentation/embed/get-api-key | ||
* | ||
* @namespace GoogleMaps | ||
*/ | ||
const GoogleMaps = {}; | ||
|
||
/** | ||
* Gets or sets the default Google Maps API key. | ||
* | ||
* @type {string} | ||
*/ | ||
GoogleMaps.defaultApiKey = defaultKey; | ||
|
||
/** | ||
* Gets or sets the default Google Map Tiles API endpoint. | ||
* | ||
* @type {string|Resource} | ||
* @default https://tile.googleapis.com/v1/ | ||
*/ | ||
GoogleMaps.mapTilesApiEndpoint = new Resource({ | ||
url: "https://tile.googleapis.com/v1/", | ||
}); | ||
|
||
GoogleMaps.getDefaultApiKeyCredit = function (providedKey) { | ||
if (providedKey !== defaultKey) { | ||
return undefined; | ||
} | ||
|
||
if (!defined(defaultKeyCredit)) { | ||
const defaultKeyMessage = | ||
'<b> \ | ||
This application is using CesiumJS\'s default Google Maps API key. Please assign <i>Cesium.GoogleMaps.defaultApiKey</i> \ | ||
with <a href="https://developers.google.com/maps/documentation/embed/get-api-key">your API key for the Google Maps Platform</a>.</b>'; | ||
|
||
defaultKeyCredit = new Credit(defaultKeyMessage, true); | ||
defaultKeyCredit._isDefaultToken = true; | ||
} | ||
|
||
return defaultKeyCredit; | ||
}; | ||
export default GoogleMaps; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.