Getting Started
LithoSphere is accessible via the Node.js package manager npm (recommended) as well as an old-school JavaScript module.
npm
-
To install LithoSphere via npm, simply run:
npm install lithosphere
-
Then, at the top of your script, import it like so:
import LithoSphere from 'lithosphere'
-
Then invoke LithoSphere with:
const Litho = new LithoSphere(yourHtmlContainerId, yourOptionsObject) // Litho.addLayer(type, layerOptions)
Old-School Alternative
If you’re not using npm just yet, that’s okay, we support you too.
-
Within the LithoSphere GitHub repository, navigate to
/public/dist
and copylithosphere.js
into your project. - Add the following script tag to your HTML before you intend to invoke it:
<script src="your/path/to/lithosphere.js"></script>
- Using the
/public/examples
files as a guide, use something like the following to initialize LithoSphere:<div id="container"></div> <script> const Litho = new LithoSphere.default('container', {}) // Litho.addLayer(type, layerOptions) </script>
Moving Forward
Check out the Constructor page next for more information about the LithoSphere constructor and its available options.