use of org.cesiumjs.cs.datasources.graphics.options.BillboardGraphicsOptions in project gwt-cs by iSergio.
the class Billboards method addBillboard.
private void addBillboard() {
BillboardGraphicsOptions billboardGraphicsOptions = new BillboardGraphicsOptions();
billboardGraphicsOptions.image = new ConstantProperty<>(GWT.getModuleBaseURL() + "images/Cesium_Logo_overlay.png");
BillboardGraphics billboardGraphics = new BillboardGraphics(billboardGraphicsOptions);
EntityOptions entityOptions = new EntityOptions();
entityOptions.position = new ConstantPositionProperty(Cartesian3.fromDegrees(-75.59777, 40.03883));
entityOptions.billboard = billboardGraphics;
csVPanel.getViewer().entities().add(new Entity(entityOptions));
}
use of org.cesiumjs.cs.datasources.graphics.options.BillboardGraphicsOptions in project gwt-cs by iSergio.
the class Billboards method scaleByDistance.
private void scaleByDistance() {
BillboardGraphicsOptions billboardGraphicsOptions = new BillboardGraphicsOptions();
billboardGraphicsOptions.image = new ConstantProperty<>(GWT.getModuleBaseURL() + "images/facility.gif");
billboardGraphicsOptions.scaleByDistance = new ConstantProperty<>(new NearFarScalar(1.5e2, 2.0, 1.5e7, 0.5));
BillboardGraphics billboardGraphics = new BillboardGraphics(billboardGraphicsOptions);
EntityOptions entityOptions = new EntityOptions();
entityOptions.position = new ConstantPositionProperty(Cartesian3.fromDegrees(-75.59777, 40.03883));
entityOptions.billboard = billboardGraphics;
csVPanel.getViewer().entities().add(new Entity(entityOptions));
}
use of org.cesiumjs.cs.datasources.graphics.options.BillboardGraphicsOptions in project gwt-cs by iSergio.
the class Billboards method sizeBillboardInMeters.
private void sizeBillboardInMeters() {
BillboardGraphicsOptions billboardGraphicsOptions = new BillboardGraphicsOptions();
billboardGraphicsOptions.image = new ConstantProperty<>(GWT.getModuleBaseURL() + "images/Cesium_Logo_overlay.png");
billboardGraphicsOptions.sizeInMeters = new ConstantProperty<>(true);
BillboardGraphics billboardGraphics = new BillboardGraphics(billboardGraphicsOptions);
EntityOptions entityOptions = new EntityOptions();
entityOptions.position = new ConstantPositionProperty(Cartesian3.fromDegrees(-75.59777, 40.03883));
entityOptions.billboard = billboardGraphics;
Entity entity = csVPanel.getViewer().entities().add(new Entity(entityOptions));
csVPanel.getViewer().zoomTo(entity);
}
use of org.cesiumjs.cs.datasources.graphics.options.BillboardGraphicsOptions in project gwt-cs by iSergio.
the class Billboards method fadeByDistance.
private void fadeByDistance() {
BillboardGraphicsOptions billboardGraphicsOptions = new BillboardGraphicsOptions();
billboardGraphicsOptions.image = new ConstantProperty<>(GWT.getModuleBaseURL() + "images/Cesium_Logo_overlay.png");
billboardGraphicsOptions.translucencyByDistance = new ConstantProperty<>(new NearFarScalar(1.5e2, 2.0, 1.5e7, 0.5));
BillboardGraphics billboardGraphics = new BillboardGraphics(billboardGraphicsOptions);
EntityOptions entityOptions = new EntityOptions();
entityOptions.position = new ConstantPositionProperty(Cartesian3.fromDegrees(-75.59777, 40.03883));
entityOptions.billboard = billboardGraphics;
csVPanel.getViewer().entities().add(new Entity(entityOptions));
}
use of org.cesiumjs.cs.datasources.graphics.options.BillboardGraphicsOptions in project gwt-cs by iSergio.
the class Labels method offsetByDistance.
private void offsetByDistance() {
final JsImage image = new JsImage();
image.onload = new JsImage.Listener() {
@Override
public void function() {
BillboardGraphicsOptions billboardGraphicsOptions = new BillboardGraphicsOptions();
billboardGraphicsOptions.scaleByDistance = new ConstantProperty<>(new NearFarScalar(1.5e2, 5.0, 1.5e7, 0.5));
billboardGraphicsOptions.image = new ConstantProperty<>(image);
LabelGraphicsOptions labelGraphicsOptions = new LabelGraphicsOptions();
labelGraphicsOptions.text = new ConstantProperty<>("Label on top of scaling billboard");
labelGraphicsOptions.font = new ConstantProperty<>("20px sans-serif");
labelGraphicsOptions.showBackground = new ConstantProperty<>(true);
labelGraphicsOptions.horizontalOrigin = new ConstantProperty<>(HorizontalOrigin.CENTER());
labelGraphicsOptions.pixelOffset = new ConstantProperty<>(new Cartesian2(0.0, -image.height));
labelGraphicsOptions.pixelOffsetScaleByDistance = new ConstantProperty<>(new NearFarScalar(1.5e2, 3.0, 1.5e7, 0.5));
EntityOptions entityOptions = new EntityOptions();
entityOptions.position = new ConstantPositionProperty(Cartesian3.fromDegrees(-75.1641667, 39.9522222));
entityOptions.billboard = new BillboardGraphics(billboardGraphicsOptions);
entityOptions.label = new LabelGraphics(labelGraphicsOptions);
csVPanel.getViewer().entities().add(entityOptions);
}
};
image.src = GWT.getModuleBaseURL() + "images/facility.gif";
}
Aggregations