Search in sources :

Example 31 with Entity

use of org.cesiumjs.cs.datasources.Entity in project gwt-cs by iSergio.

the class Camera method flyToRectangle.

private void flyToRectangle() {
    double west = -90.0;
    double south = 38.0;
    double east = -87.0;
    double north = 40.0;
    Rectangle rectangle = Rectangle.fromDegrees(west, south, east, north);
    CameraFlyToOptions cameraFlyToOptions = new CameraFlyToOptions();
    cameraFlyToOptions.destinationRec = rectangle;
    csVPanel.getViewer().camera.flyTo(cameraFlyToOptions);
    RectangleGraphicsOptions rectangleGraphicsOptions = new RectangleGraphicsOptions();
    rectangleGraphicsOptions.coordinates = new ConstantProperty<>(rectangle);
    rectangleGraphicsOptions.fill = new ConstantProperty<>(false);
    rectangleGraphicsOptions.outline = new ConstantProperty<>(true);
    rectangleGraphicsOptions.outlineColor = new ConstantProperty<>(Color.WHITE());
    EntityOptions entityOptions = new EntityOptions();
    entityOptions.rectangle = new RectangleGraphics(rectangleGraphicsOptions);
    csVPanel.getViewer().entities().add(new Entity(entityOptions));
}
Also used : Entity(org.cesiumjs.cs.datasources.Entity) CameraFlyToOptions(org.cesiumjs.cs.scene.options.CameraFlyToOptions) RectangleGraphicsOptions(org.cesiumjs.cs.datasources.graphics.options.RectangleGraphicsOptions) EntityOptions(org.cesiumjs.cs.datasources.options.EntityOptions) RectangleGraphics(org.cesiumjs.cs.datasources.graphics.RectangleGraphics)

Aggregations

Entity (org.cesiumjs.cs.datasources.Entity)31 EntityOptions (org.cesiumjs.cs.datasources.options.EntityOptions)27 ConstantPositionProperty (org.cesiumjs.cs.datasources.properties.ConstantPositionProperty)16 ViewerPanel (org.cesiumjs.cs.widgets.ViewerPanel)13 BillboardGraphics (org.cesiumjs.cs.datasources.graphics.BillboardGraphics)12 BillboardGraphicsOptions (org.cesiumjs.cs.datasources.graphics.options.BillboardGraphicsOptions)12 HTML (com.google.gwt.user.client.ui.HTML)9 MouseMoveEvent (org.cesiumjs.cs.core.events.MouseMoveEvent)5 ModelGraphics (org.cesiumjs.cs.datasources.graphics.ModelGraphics)5 ModelGraphicsOptions (org.cesiumjs.cs.datasources.graphics.options.ModelGraphicsOptions)5 ColorMaterialProperty (org.cesiumjs.cs.datasources.properties.ColorMaterialProperty)5 ConstantProperty (org.cesiumjs.cs.datasources.properties.ConstantProperty)5 ViewerOptions (org.cesiumjs.cs.widgets.options.ViewerOptions)5 ChangeEvent (com.google.gwt.event.dom.client.ChangeEvent)4 ChangeHandler (com.google.gwt.event.dom.client.ChangeHandler)4 AbsolutePanel (com.google.gwt.user.client.ui.AbsolutePanel)4 CesiumTerrainProvider (org.cesiumjs.cs.core.providers.CesiumTerrainProvider)4 CesiumTerrainProviderOptions (org.cesiumjs.cs.core.providers.options.CesiumTerrainProviderOptions)4 LabelGraphics (org.cesiumjs.cs.datasources.graphics.LabelGraphics)4 Fulfill (org.cesiumjs.cs.promise.Fulfill)4