Search in sources :

Example 1 with PointGraphics

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

the class CustomHomeButton method buildPanel.

@Override
public void buildPanel() {
    final PointGraphicsOptions pointOptions = new PointGraphicsOptions();
    pointOptions.pixelSize = new ConstantProperty<>(5);
    final EntityOptions entityOptions = new EntityOptions();
    entityOptions.position = new ConstantPositionProperty(Cartesian3.fromDegrees(-73.986555, 40.735396, 0));
    entityOptions.point = new PointGraphics(pointOptions);
    final Entity entity = new Entity(entityOptions);
    final ViewerOptions viewerOptions = new ViewerOptions();
    final ViewerPanel viewer = new ViewerPanel(viewerOptions);
    viewer.getViewer().homeButton().viewModel.tooltip = "Fly to New York";
    viewer.getViewer().entities().add(entity);
    viewer.getViewer().homeButton().viewModel.command.beforeExecute.addEventListener(new Event.Listener() {

        @Override
        public void function(Object... o) {
            viewer.getViewer().flyTo(entity);
        }
    });
    contentPanel.add(new HTML("<div>Click the home button to fly to New York.</div>"));
    contentPanel.add(viewer);
    initWidget(contentPanel);
}
Also used : ViewerPanel(org.cesiumjs.cs.widgets.ViewerPanel) Entity(org.cesiumjs.cs.datasources.Entity) PointGraphicsOptions(org.cesiumjs.cs.datasources.graphics.options.PointGraphicsOptions) ViewerOptions(org.cesiumjs.cs.widgets.options.ViewerOptions) PointGraphics(org.cesiumjs.cs.datasources.graphics.PointGraphics) HTML(com.google.gwt.user.client.ui.HTML) ConstantPositionProperty(org.cesiumjs.cs.datasources.properties.ConstantPositionProperty) EntityOptions(org.cesiumjs.cs.datasources.options.EntityOptions) Event(org.cesiumjs.cs.core.Event)

Example 2 with PointGraphics

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

the class Interpolation method computeCirclularFlight.

private PositionProperty computeCirclularFlight(double lon, double lat, double radius) {
    SampledPositionProperty property = new SampledPositionProperty();
    for (int i = 0; i <= 360; i += 45) {
        double radians = Math.toRadians(i);
        JulianDate time = JulianDate.addSeconds(_start, i, new JulianDate());
        Cartesian3 position = Cartesian3.fromDegrees(lon + (radius * 1.5 * java.lang.Math.cos(radians)), lat + (radius * java.lang.Math.sin(radians)), Math.nextRandomNumber() * 500 + 1750);
        property.addSample(time, position);
        PointGraphicsOptions pointGraphicsOptions = new PointGraphicsOptions();
        pointGraphicsOptions.pixelSize = new ConstantProperty<>(8);
        pointGraphicsOptions.color = new ConstantProperty<>(Color.TRANSPARENT());
        pointGraphicsOptions.outlineColor = new ConstantProperty<>(Color.YELLOW());
        pointGraphicsOptions.outlineWidth = new ConstantProperty<>(3);
        EntityOptions entityOptions = new EntityOptions();
        entityOptions.position = new ConstantPositionProperty(position);
        entityOptions.point = new PointGraphics(pointGraphicsOptions);
        csVPanel.getViewer().entities().add(entityOptions);
    }
    return property;
}
Also used : PointGraphicsOptions(org.cesiumjs.cs.datasources.graphics.options.PointGraphicsOptions) PointGraphics(org.cesiumjs.cs.datasources.graphics.PointGraphics) EntityOptions(org.cesiumjs.cs.datasources.options.EntityOptions)

Aggregations

PointGraphics (org.cesiumjs.cs.datasources.graphics.PointGraphics)2 PointGraphicsOptions (org.cesiumjs.cs.datasources.graphics.options.PointGraphicsOptions)2 EntityOptions (org.cesiumjs.cs.datasources.options.EntityOptions)2 HTML (com.google.gwt.user.client.ui.HTML)1 Event (org.cesiumjs.cs.core.Event)1 Entity (org.cesiumjs.cs.datasources.Entity)1 ConstantPositionProperty (org.cesiumjs.cs.datasources.properties.ConstantPositionProperty)1 ViewerPanel (org.cesiumjs.cs.widgets.ViewerPanel)1 ViewerOptions (org.cesiumjs.cs.widgets.options.ViewerOptions)1