Using the Latest WorldWind Features
Accessing, building, and understanding the development version of WebWorldWind
The WebWorldWind project uses GitHub as a web-based hosting service for version control using git. The library uses RequireJS for loading javascript modules and npm is used as a build tool run tasks like: consolidating and minifying the library, generating documentation, and deploying artifacts.
To use the latest WebWorldWind library, you must be familiar with the software/services/concepts above. More information about each of the components can be found below:
- git and GitHub
- RequireJS - not necessary to fully understand in order to use the development version but does provide background on the file header configuration and how multiple files contribute to the library
- npm
To build WebWorldWind from the latest source hosted on GitHub, follow these steps:
-
Install git and npm on your computer (varies by operating system)
-
Clone the WebWorldWind project which will copy the source code to your computer:
git clone https://github.com/NASAWorldWind/WebWorldWind.git
-
Navigate into the newly created directory
WebWorldWind
:cd WebWorldWind
-
Invoke npm to install the required dependencies for building the different output components of the library:
npm install
-
Invoke the npm build command for WebWorldWind to consolidate and minify library:
npm run build
-
npm will now consolidate the files, minifying if necessary, and generate documentation. The outputs from this process are located in the
build
directory. Let’s summarize the contents of thebuild
directory:WebWorldWind-Distribution-0.9.0.zip
: A zipped file containing: License, Readme, documentation, examples, images, and the consolidated and minified libraries (worldwind.js and worldiwind.min.js).dist
: the unzipped contents of the WebWorldWind-Distribution zip filetest-report
: test output reports
To build your application you will need a minimum of one of the provided libraries (worldwind.js or worldwind.min.js). Finally, WorldWind’s npm package requires that you publish the images folder in your npm-based project’s web root.
-
To retrieve the latest updates of WebWorldWind simply:
git pull
and then start back at step 5 to update the build products.
Future Development Library Distribution Plan
The WebWorldWind development team has identified several alternatives for providing the development version of WebWorldWind. In the future, a precompiled version will always be available or integrated into npm’s distribution mechanism.