use of org.cesiumjs.cs.datasources.properties.ConstantPositionProperty in project gwt-cs by iSergio.
the class Labels method setRightToLeft.
private void setRightToLeft() {
Label.enableRightToLeftDetection = true;
LabelGraphicsOptions labelGraphicsOptions = new LabelGraphicsOptions();
labelGraphicsOptions.text = new ConstantProperty<>("Master (אדון): Hello\nתלמיד (student): שלום");
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.datasources.properties.ConstantPositionProperty 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";
}
use of org.cesiumjs.cs.datasources.properties.ConstantPositionProperty in project gwt-cs by iSergio.
the class Labels method setProperties.
private void setProperties() {
LabelGraphicsOptions labelGraphicsOptions = new LabelGraphicsOptions();
labelGraphicsOptions.text = new ConstantProperty<>("Philadelphia");
EntityOptions entityOptions = new EntityOptions();
entityOptions.position = new ConstantPositionProperty(Cartesian3.fromDegrees(-75.1641667, 39.9522222, 300000.0));
entityOptions.label = new LabelGraphics(labelGraphicsOptions);
Entity entity = csVPanel.getViewer().entities().add(entityOptions);
entity.label.scale = new ConstantProperty<>(2.0);
entity.label.showBackground = new ConstantProperty<>(true);
}
use of org.cesiumjs.cs.datasources.properties.ConstantPositionProperty in project gwt-cs by iSergio.
the class Labels method setFont.
private void setFont() {
LabelGraphicsOptions labelGraphicsOptions = new LabelGraphicsOptions();
labelGraphicsOptions.text = new ConstantProperty<>("Philadelphia");
labelGraphicsOptions.font = new ConstantProperty<>("24px Helvetica");
labelGraphicsOptions.fillColor = new ConstantProperty<>(Color.SKYBLUE());
labelGraphicsOptions.outlineColor = new ConstantProperty<>(Color.BLACK());
labelGraphicsOptions.outlineWidth = new ConstantProperty<>(2);
labelGraphicsOptions.style = new ConstantProperty<>(LabelStyle.FILL_AND_OUTLINE());
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.datasources.properties.ConstantPositionProperty in project gwt-cs by iSergio.
the class Models3DColoring method createModel.
private void createModel(String url, double height) {
csVPanel.getViewer().entities().removeAll();
ModelGraphicsOptions modelGraphicsOptions = new ModelGraphicsOptions();
modelGraphicsOptions.uri = new ConstantProperty<>(url);
modelGraphicsOptions.minimumPixelSize = new ConstantProperty<>(128);
modelGraphicsOptions.maximumScale = new ConstantProperty<>(20000);
modelGraphicsOptions.color = new ConstantProperty<>(getColor(colorStr, alpha));
modelGraphicsOptions.colorBlendAmount = new ConstantProperty<>(colorBlendMode);
modelGraphicsOptions.silhouetteColor = new ConstantProperty<>(silhouetteColor);
modelGraphicsOptions.silhouetteSize = new ConstantProperty<>(silhouetteSize);
ModelGraphics modelGraphics = new ModelGraphics(modelGraphicsOptions);
Cartesian3 position = Cartesian3.fromDegrees(-123.0744619, 44.0503706, height);
double heading = Math.toRadians(135);
double pitch = 0;
double roll = 0;
org.cesiumjs.cs.core.HeadingPitchRoll hpr = new org.cesiumjs.cs.core.HeadingPitchRoll(heading, pitch, roll);
Quaternion orientation = Transforms.headingPitchRollQuaternion(position, hpr);
EntityOptions entityOptions = new EntityOptions();
entityOptions.name = url;
entityOptions.position = new ConstantPositionProperty(position);
entityOptions.orientation = new ConstantProperty<>(orientation);
entityOptions.model = modelGraphics;
csVPanel.getViewer().trackedEntity = csVPanel.getViewer().entities().add(entityOptions);
;
}
Aggregations