-
Notifications
You must be signed in to change notification settings - Fork 418
Expand file tree
/
Copy pathOffline.html
More file actions
75 lines (60 loc) · 3.53 KB
/
Offline.html
File metadata and controls
75 lines (60 loc) · 3.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<!DOCTYPE html>
<!--
Invokes Web WorldWind without using the Internet. Refers to data stored only on a local environment.
To deploy:
- Download https://files.worldwind.arc.nasa.gov/artifactory/standalone-data/WebWorldWind-StandaloneData.tar.gz and unzip it
so that the "standalonedata" directory is a peer of the 'apps' folder. It contains the Blue Marble imagery,
the Landsat imagery and the DTED0 elevations in its Earth directory.
- The worldwind.min.js file location in this file is assumed to be where the library is compiled given the repository
build process, and it can be modified as needed.
- 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.
-->
<html>
<head lang="en">
<meta charset="UTF-8">
<title>WorldWind Offline Example</title>
<!-- Include the locally hosted Web WorldWind library. Modify the address to your local setup as needed. -->
<script src="../build/dist/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() {
// Tell WorldWind to log only warnings and errors.
WorldWind.Logger.setLoggingLevel(WorldWind.Logger.LEVEL_WARNING);
// Use a local elevation coverage rather than the defaults.
var elevationCoverage = new WorldWind.EarthRestElevationCoverage("../standalonedata/Earth/DTED0");
var elevationModel = new WorldWind.ElevationModel();
elevationModel.addCoverage(elevationCoverage);
// Create a WorldWindow for the canvas using the local elevations data.
var wwd = new WorldWind.WorldWindow("canvasOne", elevationModel);
// Add the local Blue Marble layer that retrieves imagery from local standalone data.
var blueMarble = new WorldWind.BMNGRestLayer(null, "../standalonedata/Earth/BlueMarble256/");
wwd.addLayer(blueMarble);
// Add the local 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>