I want to draw a line on the globe with elevation representation, something like this :
I know I can use polyline to represent a line, but how can fill the space below the line ?
You can use a path to draw the line. The setOutlineMaterial will draw a "curtain" similar to what you want.
Path path = new Path(pathPositions); //Arraylist of positions
final BasicShapeAttributes attrs = new BasicShapeAttributes();
attrs.setInteriorOpacity(0.25);
attrs.setInteriorMaterial(Material.BLACK);
attrs.setOutlineMaterial(new Material(color));
attrs.setOutlineWidth(width);
path.setAttributes(attrs);
path.setDrawVerticals(true);
path.setAltitudeMode(WorldWind.ABSOLUTE);
look at Path
altitude mode how you want it follow the ground.
You can use a polygon, just give it points with the same latitude and longitude but different elevations:
ArrayList<Position> pathPositions = new ArrayList<Position>();
pathPositions.add(Position.fromDegrees(28, -106, 3e4));
pathPositions.add(Position.fromDegrees(28, -106, 3e0));
pathPositions.add(Position.fromDegrees(35, -107, 9e0));
pathPositions.add(Position.fromDegrees(35, -107, 9e4));
pathPositions.add(Position.fromDegrees(28, -106, 3e4));
Polygon pgon = new Polygon(pathPositions);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With