Search in sources :

Example 11 with BillboardGraphics

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

the class Billboards method addMarkerBillboards.

private void addMarkerBillboards() {
    BillboardGraphicsOptions billboardGraphicsOptions = new BillboardGraphicsOptions();
    billboardGraphicsOptions.image = new ConstantProperty<>(GWT.getModuleBaseURL() + "images/whiteShapes.png");
    billboardGraphicsOptions.imageSubRegion = new ConstantProperty<>(new BoundingRectangle(49, 43, 18, 18));
    billboardGraphicsOptions.color = new ConstantProperty<>(Color.LIME());
    EntityOptions entityOptions = new EntityOptions();
    entityOptions.billboard = new BillboardGraphics(billboardGraphicsOptions);
    entityOptions.position = new ConstantPositionProperty(Cartesian3.fromDegrees(-75.59777, 40.03883));
    csVPanel.getViewer().entities().add(new Entity(entityOptions));
    billboardGraphicsOptions = new BillboardGraphicsOptions();
    billboardGraphicsOptions.image = new ConstantProperty<>(GWT.getModuleBaseURL() + "images/whiteShapes.png");
    billboardGraphicsOptions.imageSubRegion = new ConstantProperty<>(new BoundingRectangle(61, 23, 18, 18));
    billboardGraphicsOptions.color = new ConstantProperty<>(new Color(0, 0.5, 1.0, 1.0));
    entityOptions = new EntityOptions();
    entityOptions.billboard = new BillboardGraphics(billboardGraphicsOptions);
    entityOptions.position = new ConstantPositionProperty(Cartesian3.fromDegrees(-84.0, 39.0));
    csVPanel.getViewer().entities().add(new Entity(entityOptions));
    billboardGraphicsOptions = new BillboardGraphicsOptions();
    billboardGraphicsOptions.image = new ConstantProperty<>(GWT.getModuleBaseURL() + "images/whiteShapes.png");
    billboardGraphicsOptions.imageSubRegion = new ConstantProperty<>(new BoundingRectangle(67, 80, 14, 14));
    billboardGraphicsOptions.color = new ConstantProperty<>(new Color(0.5, 0.9, 1.0, 1.0));
    entityOptions = new EntityOptions();
    entityOptions.billboard = new BillboardGraphics(billboardGraphicsOptions);
    entityOptions.position = new ConstantPositionProperty(Cartesian3.fromDegrees(-70.0, 41.0));
    csVPanel.getViewer().entities().add(new Entity(entityOptions));
    billboardGraphicsOptions = new BillboardGraphicsOptions();
    billboardGraphicsOptions.image = new ConstantProperty<>(GWT.getModuleBaseURL() + "images/whiteShapes.png");
    billboardGraphicsOptions.imageSubRegion = new ConstantProperty<>(new BoundingRectangle(27, 103, 22, 22));
    billboardGraphicsOptions.color = new ConstantProperty<>(Color.RED());
    entityOptions = new EntityOptions();
    entityOptions.billboard = new BillboardGraphics(billboardGraphicsOptions);
    entityOptions.position = new ConstantPositionProperty(Cartesian3.fromDegrees(-73.0, 37.0));
    csVPanel.getViewer().entities().add(new Entity(entityOptions));
    billboardGraphicsOptions = new BillboardGraphicsOptions();
    billboardGraphicsOptions.image = new ConstantProperty<>(GWT.getModuleBaseURL() + "images/whiteShapes.png");
    billboardGraphicsOptions.imageSubRegion = new ConstantProperty<>(new BoundingRectangle(105, 105, 18, 18));
    billboardGraphicsOptions.color = new ConstantProperty<>(Color.YELLOW());
    entityOptions = new EntityOptions();
    entityOptions.billboard = new BillboardGraphics(billboardGraphicsOptions);
    entityOptions.position = new ConstantPositionProperty(Cartesian3.fromDegrees(-79.0, 35.0));
    csVPanel.getViewer().entities().add(new Entity(entityOptions));
}
Also used : Entity(org.cesiumjs.cs.datasources.Entity) BillboardGraphicsOptions(org.cesiumjs.cs.datasources.graphics.options.BillboardGraphicsOptions) BillboardGraphics(org.cesiumjs.cs.datasources.graphics.BillboardGraphics) ConstantPositionProperty(org.cesiumjs.cs.datasources.properties.ConstantPositionProperty) EntityOptions(org.cesiumjs.cs.datasources.options.EntityOptions)

Example 12 with BillboardGraphics

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

the class Billboards method addMultipleBillboards.

private void addMultipleBillboards() {
    String logoUrl = GWT.getModuleBaseURL() + "images/Cesium_Logo_overlay.png";
    String facilityUrl = GWT.getModuleBaseURL() + "images/facility.gif";
    BillboardGraphicsOptions billboardGraphicsOptions = new BillboardGraphicsOptions();
    billboardGraphicsOptions.image = new ConstantProperty<>(logoUrl);
    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));
    billboardGraphicsOptions = new BillboardGraphicsOptions();
    billboardGraphicsOptions.image = new ConstantProperty<>(facilityUrl);
    billboardGraphics = new BillboardGraphics(billboardGraphicsOptions);
    entityOptions = new EntityOptions();
    entityOptions.position = new ConstantPositionProperty(Cartesian3.fromDegrees(-80.50, 35.14));
    entityOptions.billboard = billboardGraphics;
    csVPanel.getViewer().entities().add(new Entity(entityOptions));
    billboardGraphicsOptions = new BillboardGraphicsOptions();
    billboardGraphicsOptions.image = new ConstantProperty<>(facilityUrl);
    billboardGraphics = new BillboardGraphics(billboardGraphicsOptions);
    entityOptions = new EntityOptions();
    entityOptions.position = new ConstantPositionProperty(Cartesian3.fromDegrees(-80.12, 25.46));
    entityOptions.billboard = billboardGraphics;
    csVPanel.getViewer().entities().add(new Entity(entityOptions));
}
Also used : Entity(org.cesiumjs.cs.datasources.Entity) BillboardGraphicsOptions(org.cesiumjs.cs.datasources.graphics.options.BillboardGraphicsOptions) BillboardGraphics(org.cesiumjs.cs.datasources.graphics.BillboardGraphics) ConstantPositionProperty(org.cesiumjs.cs.datasources.properties.ConstantPositionProperty) EntityOptions(org.cesiumjs.cs.datasources.options.EntityOptions)

Example 13 with BillboardGraphics

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

the class Billboards method setBillboardProperties.

private void setBillboardProperties() {
    BillboardGraphicsOptions billboardGraphicsOptions = new BillboardGraphicsOptions();
    // default: undefined
    billboardGraphicsOptions.image = new ConstantProperty<>(GWT.getModuleBaseURL() + "images/Cesium_Logo_overlay.png");
    // default
    billboardGraphicsOptions.show = new ConstantProperty<>(true);
    // default: (0, 0)
    billboardGraphicsOptions.pixelOffset = new ConstantProperty<>(new Cartesian2(0, -50));
    // default
    billboardGraphicsOptions.eyeOffset = new ConstantProperty<>(new Cartesian3(0, 0, 0));
    // default
    billboardGraphicsOptions.horizontalOrigin = new ConstantProperty<>(HorizontalOrigin.CENTER());
    // default: CENTER
    billboardGraphicsOptions.verticalOrigin = new ConstantProperty<>(VerticalOrigin.BOTTOM());
    // default: 1.0
    billboardGraphicsOptions.scale = new ConstantProperty<>(2.0);
    // default: WHITE
    billboardGraphicsOptions.color = new ConstantProperty<>(Color.LIME());
    // default: 0.0
    billboardGraphicsOptions.rotation = new ConstantProperty<>(Math.PI_OVER_FOUR());
    // default
    billboardGraphicsOptions.alignedAxis = new ConstantProperty<>(Cartesian3.ZERO());
    // default: undefined
    billboardGraphicsOptions.width = new ConstantProperty<>(100);
    // default: undefined
    billboardGraphicsOptions.height = new ConstantProperty<>(25);
    EntityOptions entityOptions = new EntityOptions();
    entityOptions.position = new ConstantPositionProperty(Cartesian3.fromDegrees(-75.59777, 40.03883));
    entityOptions.billboard = new BillboardGraphics(billboardGraphicsOptions);
    csVPanel.getViewer().entities().add(new Entity(entityOptions));
}
Also used : Entity(org.cesiumjs.cs.datasources.Entity) BillboardGraphicsOptions(org.cesiumjs.cs.datasources.graphics.options.BillboardGraphicsOptions) BillboardGraphics(org.cesiumjs.cs.datasources.graphics.BillboardGraphics) ConstantPositionProperty(org.cesiumjs.cs.datasources.properties.ConstantPositionProperty) EntityOptions(org.cesiumjs.cs.datasources.options.EntityOptions)

Aggregations

BillboardGraphics (org.cesiumjs.cs.datasources.graphics.BillboardGraphics)13 BillboardGraphicsOptions (org.cesiumjs.cs.datasources.graphics.options.BillboardGraphicsOptions)13 EntityOptions (org.cesiumjs.cs.datasources.options.EntityOptions)13 Entity (org.cesiumjs.cs.datasources.Entity)12 ConstantPositionProperty (org.cesiumjs.cs.datasources.properties.ConstantPositionProperty)12 JsImage (org.cesiumjs.cs.js.JsImage)3 LabelGraphics (org.cesiumjs.cs.datasources.graphics.LabelGraphics)2 LabelGraphicsOptions (org.cesiumjs.cs.datasources.graphics.options.LabelGraphicsOptions)2 ConstantProperty (org.cesiumjs.cs.datasources.properties.ConstantProperty)2 Canvas (com.google.gwt.canvas.client.Canvas)1 Context2d (com.google.gwt.canvas.dom.client.Context2d)1 CanvasElement (com.google.gwt.dom.client.CanvasElement)1 ImageElement (com.google.gwt.dom.client.ImageElement)1 AbsolutePanel (com.google.gwt.user.client.ui.AbsolutePanel)1 HTML (com.google.gwt.user.client.ui.HTML)1 BigDecimal (java.math.BigDecimal)1 Cartesian2 (org.cesiumjs.cs.core.Cartesian2)1 NearFarScalar (org.cesiumjs.cs.core.NearFarScalar)1 MouseMoveEvent (org.cesiumjs.cs.core.events.MouseMoveEvent)1 ResourceImageOptions (org.cesiumjs.cs.core.options.ResourceImageOptions)1