Search in sources :

Example 1 with RectangleGraphics

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

the class Camera method viewRectangle.

private void viewRectangle() {
    double west = -90.0;
    double south = 38.0;
    double east = -87.0;
    double north = 40.0;
    Rectangle rectangle = Rectangle.fromDegrees(west, south, east, north);
    ViewOptions viewOptions = new ViewOptions();
    viewOptions.destinationRec = rectangle;
    csVPanel.getViewer().camera.setView(viewOptions);
    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) ViewOptions(org.cesiumjs.cs.scene.options.ViewOptions) RectangleGraphicsOptions(org.cesiumjs.cs.datasources.graphics.options.RectangleGraphicsOptions) EntityOptions(org.cesiumjs.cs.datasources.options.EntityOptions) RectangleGraphics(org.cesiumjs.cs.datasources.graphics.RectangleGraphics)

Example 2 with RectangleGraphics

use of org.cesiumjs.cs.datasources.graphics.RectangleGraphics 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)2 RectangleGraphics (org.cesiumjs.cs.datasources.graphics.RectangleGraphics)2 RectangleGraphicsOptions (org.cesiumjs.cs.datasources.graphics.options.RectangleGraphicsOptions)2 EntityOptions (org.cesiumjs.cs.datasources.options.EntityOptions)2 CameraFlyToOptions (org.cesiumjs.cs.scene.options.CameraFlyToOptions)1 ViewOptions (org.cesiumjs.cs.scene.options.ViewOptions)1