HoloMap.Terrain (HoloMap v0.1.0)

Copy Markdown View Source

3D terrain, draped over the map from an elevation source.

<HoloMap.Source.RasterDEM id="dem" tiles={@dem_tiles} encoding="terrarium" />
<HoloMap.Terrain source="dem" exaggeration={1.4} />

Terrain is a property of the map, not a layer. There is one, or there is none. Declaring the component turns it on; removing it from the template turns it off and the map flattens back out.

Props

PropTypeNotes
sourcestringRequired. The id of a HoloMap.Source.RasterDEM
exaggerationnumberVertical multiplier. 1.0 is true scale

Making terrain visible

Terrain does nothing at zero pitch, because a hill viewed from directly above still looks flat. Give the map a pitch, and usually let the user change it:

<HoloMap.Map cid="relief" style={@style} pitch={60} max_pitch={85}>
  <HoloMap.Source.RasterDEM id="dem" tiles={@dem_tiles} />
  <HoloMap.Terrain source="dem" exaggeration={1.4} />
  <HoloMap.Control.Navigation visualize_pitch />
</HoloMap.Map>

Exaggeration above roughly 2.0 reads as a video-game landscape rather than a map, which is a choice worth making deliberately.

Pair with HoloMap.Layer.Hillshade on the same DEM source for shaded relief, and HoloMap.Sky for an atmosphere at the horizon.

Summary

Functions

Returns true to indicate that the callee module is a component module (has "use Hologram.Component" directive).

Returns the list of property definitions for the compiled component.

Functions

__is_hologram_component__()

@spec __is_hologram_component__() :: boolean()

Returns true to indicate that the callee module is a component module (has "use Hologram.Component" directive).

Examples

iex> __is_hologram_component__()
true

__props__()

@spec __props__() :: [{atom(), atom(), keyword()}]

Returns the list of property definitions for the compiled component.