/vaadin-cesium-component

Vaadin 7 WebGL Cesium Globe Component

Primary LanguageJavaScriptApache License 2.0Apache-2.0

Vaadin Cesium Component

Add the Cesium WebGL Virtual Globe and Map Engine to your Vaadin 7 Application.

Build Status

Vaadin Cesium Example Image

Download

Download the latest release via Maven Central:

<dependency>
    <groupId>com.github.lotsabackscatter</groupId>
    <artifactId>vaadin-cesium-component</artifactId>
    <version>1.3</version>
</dependency>

Or Download the latest SNAPSHOT via the Sonatype Maven Repository:

<repositories>
    <repository>
        <id>oss-sonatype</id>
        <name>oss-sonatype</name>
        <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
</repositories>

...

<dependency>
  <groupId>com.github.lotsabackscatter</groupId>
  <artifactId>vaadin-cesium-component</artifactId>
  <version>1.4-SNAPSHOT</version>
</dependency>

Usage

Simply create a layout and add the Cesium component to it!

VerticalLayout layout = new VerticalLayout();

Cesium cesium = new Cesium();
layout.addComponent(cesium);

You can even add billboards to the globe:

Cesium cesium = new Cesium();
cesium.addBillboard(-75.0, 40.0, "banana.jpg");

And respond to click events, on the billboards:

Cesium cesium = new Cesium();

BillboardClickListener listener = new BillboardClickListener() {

    @Override
    public void onClick() {
        Notification.show("Bananas", Notification.Type.TRAY_NOTIFICATION);
    }
};

cesium.addBillboard(-75.0, 40.0, "banana.jpg", listener);

Possible other examples include:

cesium.addLabel("Perth", -31.9522, 115.8589);
cesium.flyToMyLocation();
cesium.flyToPosition(-31.9522, 115.8589);

Developed By

License

Copyright 2014 Dylan Watson.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.