Created
October 3, 2014 21:20
-
-
Save shunter/399adf926b5554040f64 to your computer and use it in GitHub Desktop.
billboard show
This file contains hidden or 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
| <!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, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> | |
| <meta name="description" content="Add billboard images, points, and markers to the scene."> | |
| <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.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(../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 | |
| var viewer = new Cesium.Viewer('cesiumContainer'); | |
| var scene = viewer.scene; | |
| var primitives = scene.primitives; | |
| var logoUrl = '../images/Cesium_Logo_overlay.png'; | |
| var facilityUrl = '../images/facility.gif'; | |
| var billboards = scene.primitives.add(new Cesium.BillboardCollection()); | |
| billboards.add({ | |
| image : logoUrl, | |
| position : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883) | |
| }); | |
| billboards.add({ | |
| image : facilityUrl, | |
| position : Cesium.Cartesian3.fromDegrees(-80.50, 35.14) | |
| }); | |
| billboards.add({ | |
| image : facilityUrl, | |
| position : Cesium.Cartesian3.fromDegrees(-80.12, 25.46) | |
| }); | |
| var show = true; | |
| Sandcastle.addToolbarButton('toggle show', function() { | |
| show = !show; | |
| for (var i = 0; i < billboards.length; ++i) { | |
| billboards.get(i).show = show; | |
| } | |
| }); | |
| //Sandcastle_End | |
| Sandcastle.finishedLoading(); | |
| } | |
| if (typeof Cesium !== "undefined") { | |
| startup(Cesium); | |
| } else if (typeof require === "function") { | |
| require(["Cesium"], startup); | |
| } | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment