Skip to content
README.md 2.93 KiB
Newer Older
iSergio's avatar
iSergio committed
# GWT Cesium Wrapper
[CesiumJS](http://cesiumjs.org) GWT Wrapper based on JsInterop for [GWT 2.8.0](http://www.gwtproject.org/release-notes.html#Release_Notes_2_8_0).

Java API looks like as JavaScript.
What was done:
- [x] CesiumJS API like as native JavaScript. Based on CesiumJS source code
- [x] Simple support Promise
- [x] Simple support Callback functions.
iSergio's avatar
iSergio committed
- [x] Full Cesium documentation in javadoc. You can see they on official [CesiumJS](http://cesiumjs.org/refdoc.html) or on site [gwt-cs Documentation](http://sergeserver.noip.me/docs/gwt-cs)
iSergio's avatar
iSergio committed
- [x] [Examples showcase](http://sergeserver.noip.me/gwt-cs-test/).
iSergio's avatar
iSergio committed
- [x] Integration with [gwt-olcs](https://github.com/iSergio/gwt-olcs)
iSergio's avatar
iSergio committed

iSergio's avatar
iSergio committed
### DrawInteraction features:
 - [x] Pure java (Based on JsInterop wrapper without any JS code)
 - [x] Based on Cesium-Drawhelper (But on GroundPrimitives)
 - [x] Free hand mode (Shift pressed)
 - [x] Two markers type - PointPrimitive and Billboard (Canvas image)
 - [x] Draw works on EllipsoidTerrainProvider and other TerrainProvider's
 - [x] Dynamic colours style and marker styles
 - [x] Start and End draw listeners
### DrawInteraction TODO:
 - [ ] On draw listeners (mouse move listeners and primitive change)
 - [ ] Snap points
 - [ ] Maximum points (finish draw on current points == maximumPoints)
 - [ ] Outline colour and width
 - [ ] EditInteraction
 - [ ] BillboardPrimitive
 - [ ] EllipsePrimitive

### Issue
- [x] GXT work fine
- [x] GWT work fine
- [x] SmartGWT: ISC_DataBinding.js script destruct some functional of Cesium.js like as CesiumTerrain (what i find) (Fixed)
iSergio's avatar
iSergio committed
### Getting started
You not need include JavaScript of Cesium into main html file, injection realised in GWT code.
iSergio's avatar
iSergio committed
Now no need callback for ScriptInjection or AttachOrDetach, all worked "out from box".
iSergio's avatar
iSergio committed
See [Showcase](http://sergeserver.noip.me/gwt-cs-test/) or basic example:
```java
iSergio's avatar
iSergio committed
public class HelloWorld extends AbstractExample {

    @Inject
    public HelloWorld(ShowcaseExampleStore store) {
        super("Hello World", "Use Viewer to start building new applications or easily embed Cesium into existing applications", new String[]{"Showcase", "Cesium", "3d", "Viewer"}, store);
    }

    @Override
    public void buildPanel() {
iSergio's avatar
iSergio committed
        // Create Cesium Viewer
iSergio's avatar
iSergio committed
        ViewerPanel csVPanel = new ViewerPanel();

        contentPanel.add(new HTML("<p>Use Viewer to start building new applications or easily embed Cesium into existing applications.</p>"));
        contentPanel.add(csVPanel);

        initWidget(contentPanel);
iSergio's avatar
iSergio committed
    }

    @Override
iSergio's avatar
iSergio committed
    public String[] getSourceCodeURLs() {
        String[] sourceCodeURLs = new String[1];
        sourceCodeURLs[0] = GWT.getModuleBaseURL() + "examples/" + "HelloWorld.txt";
        return sourceCodeURLs;
iSergio's avatar
iSergio committed
    }
}
```
### Build library and examples:
==
You need Java 8 for build examples.
 * mvn -U clean install
 
This project will be used in [gwt-olcs](https://github.com/iSergio/gwt-olcs) and replace [Cesium GWT](https://github.com/richkadel/cesium-gwt)