|
| 1 | +<!doctype html> |
| 2 | +<html lang="en"> |
| 3 | + <head> |
| 4 | + <meta charset="utf-8" /> |
| 5 | + <meta http-equiv="X-UA-Compatible" content="IE=edge" /> |
| 6 | + <meta |
| 7 | + name="viewport" |
| 8 | + content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" |
| 9 | + /> |
| 10 | + <meta |
| 11 | + name="description" |
| 12 | + content="Imagery tiles from Google Maps with additional parameters to create overlays and custom styles." |
| 13 | + /> |
| 14 | + <meta name="cesium-sandcastle-labels" content="Beginner, Showcases" /> |
| 15 | + <title>Cesium Demo</title> |
| 16 | + <script type="text/javascript" src="../Sandcastle-header.js"></script> |
| 17 | + <script type="module" src="../load-cesium-es6.js"></script> |
| 18 | + </head> |
| 19 | + <body class="sandcastle-loading" data-sandcastle-bucket="bucket-requirejs.html"> |
| 20 | + <style> |
| 21 | + @import url(../templates/bucket.css); |
| 22 | + </style> |
| 23 | + <div id="cesiumContainer" class="fullSize"></div> |
| 24 | + <div id="loadingOverlay"><h1>Loading...</h1></div> |
| 25 | + <div id="toolbar"></div> |
| 26 | + <script id="cesium_sandcastle_script"> |
| 27 | + window.startup = async function (Cesium) { |
| 28 | + "use strict"; |
| 29 | + //Sandcastle_Begin |
| 30 | + const assetId = 3830184; |
| 31 | + |
| 32 | + const base = Cesium.ImageryLayer.fromProviderAsync( |
| 33 | + Cesium.Google2DImageryProvider.fromIonAssetId({ |
| 34 | + assetId, |
| 35 | + mapType: "satellite", |
| 36 | + }), |
| 37 | + ); |
| 38 | + |
| 39 | + const overlay = Cesium.ImageryLayer.fromProviderAsync( |
| 40 | + Cesium.Google2DImageryProvider.fromIonAssetId({ |
| 41 | + assetId, |
| 42 | + overlayLayerType: "layerRoadmap", |
| 43 | + styles: [ |
| 44 | + { |
| 45 | + stylers: [{ hue: "#00ffe6" }, { saturation: -20 }], |
| 46 | + }, |
| 47 | + { |
| 48 | + featureType: "road", |
| 49 | + elementType: "geometry", |
| 50 | + stylers: [{ lightness: 100 }, { visibility: "simplified" }], |
| 51 | + }, |
| 52 | + ], |
| 53 | + }), |
| 54 | + ); |
| 55 | + |
| 56 | + const viewer = new Cesium.Viewer("cesiumContainer", { |
| 57 | + animation: false, |
| 58 | + baseLayer: false, |
| 59 | + baseLayerPicker: false, |
| 60 | + geocoder: Cesium.IonGeocodeProviderType.GOOGLE, |
| 61 | + timeline: false, |
| 62 | + sceneModePicker: false, |
| 63 | + navigationHelpButton: false, |
| 64 | + homeButton: false, |
| 65 | + terrainProvider: await Cesium.CesiumTerrainProvider.fromIonAssetId(1), |
| 66 | + }); |
| 67 | + viewer.geocoder.viewModel.keepExpanded = true; |
| 68 | + |
| 69 | + viewer.imageryLayers.add(base); |
| 70 | + viewer.imageryLayers.add(overlay); |
| 71 | + |
| 72 | + viewer.scene.camera.flyTo({ |
| 73 | + duration: 0, |
| 74 | + destination: new Cesium.Rectangle.fromDegrees( |
| 75 | + //Philly |
| 76 | + -75.280266, |
| 77 | + 39.867004, |
| 78 | + -74.955763, |
| 79 | + 40.137992, |
| 80 | + ), |
| 81 | + }); |
| 82 | + //Sandcastle_End |
| 83 | + Sandcastle.finishedLoading(); |
| 84 | + }; |
| 85 | + if (typeof Cesium !== "undefined") { |
| 86 | + window.startupCalled = true; |
| 87 | + window.startup(Cesium).catch((error) => { |
| 88 | + "use strict"; |
| 89 | + console.error(error); |
| 90 | + }); |
| 91 | + } |
| 92 | + </script> |
| 93 | + </body> |
| 94 | +</html> |
0 commit comments