use of org.cesiumjs.cs.core.NearFarScalar in project gwt-cs by iSergio.
the class Labels method scaleByDistance.
private void scaleByDistance() {
LabelGraphicsOptions labelGraphicsOptions = new LabelGraphicsOptions();
labelGraphicsOptions.text = new ConstantProperty<>("Philadelphia");
labelGraphicsOptions.scaleByDistance = new NearFarScalar(1.5e2, 2.0, 1.5e7, 0.5);
EntityOptions entityOptions = new EntityOptions();
entityOptions.position = new ConstantPositionProperty(Cartesian3.fromDegrees(-75.1641667, 39.9522222));
entityOptions.label = new LabelGraphics(labelGraphicsOptions);
csVPanel.getViewer().entities().add(entityOptions);
}
use of org.cesiumjs.cs.core.NearFarScalar in project gwt-cs by iSergio.
the class Labels method fadeByDistance.
private void fadeByDistance() {
LabelGraphicsOptions labelGraphicsOptions = new LabelGraphicsOptions();
labelGraphicsOptions.text = new ConstantProperty<>("New York");
labelGraphicsOptions.translucencyByDistance = new ConstantProperty<>(new NearFarScalar(1.5e2, 1.0, 1.5e8, 0.0));
EntityOptions entityOptions = new EntityOptions();
entityOptions.position = new ConstantPositionProperty(Cartesian3.fromDegrees(-73.94, 40.67));
entityOptions.label = new LabelGraphics(labelGraphicsOptions);
csVPanel.getViewer().entities().add(entityOptions);
labelGraphicsOptions = new LabelGraphicsOptions();
labelGraphicsOptions.text = new ConstantProperty<>("'Atlanta'");
labelGraphicsOptions.translucencyByDistance = new ConstantProperty<>(new NearFarScalar(1.5e5, 1.0, 1.5e7, 0.0));
entityOptions = new EntityOptions();
entityOptions.position = new ConstantPositionProperty(Cartesian3.fromDegrees(-84.39, 33.75));
entityOptions.label = new LabelGraphics(labelGraphicsOptions);
csVPanel.getViewer().entities().add(entityOptions);
}
use of org.cesiumjs.cs.core.NearFarScalar 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