WebWorldWind/examples/Standalone.html
2017-11-14 13:33:04 -08:00

64 lines
3.1 KiB
HTML

<!DOCTYPE html>
<!--
Invokes Web WorldWind without using the internet. Refers to only data stored locally on the web server.
To deploy:
- Download https://worldwind32.arc.nasa.gov/WebWorldWind-StandaloneData.tar.gz and unzip it into the top-level
directory so that the "standalonedata" directory is a peer of examples and worldwind.min.js.
- Ensure that your web server is configured to send an HTTP content type of application/octet-stream
or application/bil16 for files with a .bil suffix. You can do this for Apache servers by adding bil
to the list of application-octet-stream suffixes in the mime.types file and then restarting the server.
- Use your browser to invoke this HTML file, the one you're now reading, via the web server. Do not attempt
to open it using the browser's File->Open menu. Use an http or https URL with the server address.
If deployment was successful then you should see a Web WorldWind globe in the browser. The globe
should have blue marble imagery all over it and greenish Landsat imagery over most of North America.
If you zoom into a mountainous region you should see the raised mountains. There are no elevations
included for the oceans, so they are all flat.
Be sure that the "../standalonedata" directory exists (relative to this file) and that it contains the Blue Marble
imagery, the Landsat imagery and the DTED0 elevations in its Earth directory.
-->
<html>
<head lang="en">
<meta charset="UTF-8">
<title>WorldWind Example</title>
<!-- Include the Web WorldWind library. -->
<script src="../worldwind.min.js" type="text/javascript"></script>
</head>
<body>
<div style="position: absolute; top: 50px; left: 50px;">
<!-- Create a canvas for Web WorldWind. -->
<canvas id="canvasOne" width="1024" height="768">
Your browser does not support HTML5 Canvas.
</canvas>
</div>
<script>
// Register an event listener to be called when the page is loaded.
window.addEventListener("load", eventWindowLoaded, false);
// Define the event listener to initialize Web WorldWind.
function eventWindowLoaded() {
WorldWind.Logger.setLoggingLevel(WorldWind.Logger.LEVEL_WARNING);
// Create a WorldWindow for the canvas. Use a REST elevation model rather than the default.
var elevationModel = new WorldWind.EarthRestElevationModel(null, "../standalonedata/Earth/DTED0");
var wwd = new WorldWind.WorldWindow("canvasOne", elevationModel);
// Add the REST Blue Marble layer that retrieves imagery from local standalone data.
var blueMarble = new WorldWind.BMNGRestLayer(null, "../standalonedata/Earth/BlueMarble256/");
wwd.addLayer(blueMarble);
// Add the REST Landsat layer (this offline data covers only a sector of the globe in North America)
var landSat = new WorldWind.LandsatRestLayer(null, "../standalonedata/Earth/Landsat");
wwd.addLayer(landSat);
// Add a compass, a coordinates display and some view controls to the WorldWindow.
wwd.addLayer(new WorldWind.CompassLayer());
wwd.addLayer(new WorldWind.CoordinatesDisplayLayer(wwd));
wwd.addLayer(new WorldWind.ViewControlsLayer(wwd));
}
</script>
</body>
</html>