How to draw a line with a height representation in WorldWind

I want to draw a line on the globe with a representation of the height, something like this:

Elevation representation sketch

I know that I can use a polyline to represent a line, but how to fill the space below the line?

+6
source share
2 answers

You can use the path to draw a line. The OutlineMaterial set 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); 

see the Path elevation mode as you want it to follow the ground.

+2
source

You can use the polygon, just give it points with the same latitude and longitude, but with different marks:

 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); 
+1
source

Source: https://habr.com/ru/post/988073/


All Articles