Scala.js interface to Cesium.js
To use the last release (compatible with Cesium 1.30) add the following dependency to your build.sbt:
libraryDependencies += "com.github.workingDog" %%% "cesiumscala" % "1.6"
Typical steps to run CesiumApp:
- Download and install Cesium.
- Compile and generate cesiumscala, using "sbt fullOptJS". This will generate "cesiumscala-opt.js" in the "./target/scala-2.11" directory.
- Put "CesiumScala.html" and "cesiumscala-opt.js" files in the "Cesium/Apps" directory and
- launch Cesium (e.g. "node server.js").
- Then point your browser to http://localhost:8080/Apps/CesiumScala.html
A 3D world globe with an aircraft and various shapes should be displayed in your browser. If the globe is not showing, you may need to get a Bing Map key and put it in the CesiumScala.html.
This library makes extensive use of jsext JSOptionBuilder for defining "options" objects. Here these objects are named "class-name + Options". For example:
class ModelGraphics(options: ModelGraphicsOptions)
See the example CesiumApp and Using the JSOptionBuilder documentation to learn how to define these "options" objects using jsext.
Compiling, packaging and publishing
To publish cesiumscala to your local (Ivy) repository, simply type:
Then put this in your build.sbt
libraryDependencies += "com.github.workingDog" %%% "cesiumscala" % "1.7-SNAPSHOT"
Dependencies code inclusions
The code from jsext relating to JSOptionBuilder is used in cesiumscala and is included here (verbatim) rather than as an external dependency.
cesiumscala also depends on scala-js-dom, see also build.sbt.
Scaladoc documentations can be generated by typing:
Refer to Cesium API reference for the original Cesium documentation.
cesiumscala is licensed under the terms of the Apache v2.0 license.
usable, ongoing work