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);
}
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;
}
Aggregations