3D data, such as flight trajectories or extruded shapes, has a height dimension. Displaying it on a 3D map is straightforward.

On the other hand, 2D data such as streets or administrative boundaries, needs to be visualized right on top of the terrain, even when that terrain changes.

To display shapes on the terrain, LuciadRIA uses a custom visualization technique called draping: the shape follows the changes in elevation, even when more detailed elevation data becomes available.

draped line
Figure 1. A 3D line (purple) and a similar, draped 2D line (pink)

LuciadRIA uses the geometry and vertical reference of shapes to automatically determine whether they need to be draped: if a geometry has an undefined or zero height (Z-coordinate), it will be draped.

You can override that default, and explicitly enable or disable draping through the draping parameter on ShapeStyle. If you explicitly drape a 3D shape, its 2D shadow is painted on the terrain. The draped parameter is only relevant for 3D maps and will be ignored on 2D maps.

Program: Specifying draped styling
const painter = new FeaturePainter();

painter.paintBody = function(geocanvas, feature, shape, layer, map, paintState) {
  geocanvas.drawShape(shape, {
    fill: {
      color: "rgba(0,96,154,0.8)"
    },
    stroke: {
      color: "rgb(255,255,255)"
    },
    draped: true // If you don't define this, it will automatically be determined based
                 // on the shape and its reference
  });
};