HoloMap.Source.Raster (HoloMap v0.3.0)

Copy Markdown View Source

Raster tiles: aerial imagery, scanned maps, any pre-rendered tile pyramid.

<HoloMap.Source.Raster
  id="ortho"
  tiles={["https://tiles.example.com/ortho/{z}/{x}/{y}.png"]}
  tile_size={256}
  attribution="© Example Imagery"
/>
<HoloMap.Layer.Raster id="ortho-layer" source="ortho" paint={%{raster_opacity: 0.8}} />

tile_size matters more than it looks: 256 is the classic scheme, 512 matches the vector-tile grid. Getting it wrong does not error. It shifts the imagery half a zoom level out of alignment with everything else.

Props

PropTypeNotes
idstringRequired. Referenced by layers' source prop
urlstringTileJSON endpoint. Supply this or tiles
tileslistTile URL templates containing {z}, {x}, {y}
tile_sizenumberPixel size of one tile, usually 256 or 512
min_zoom / max_zoomnumberZoom range the tiles exist at
boundslist[west, south, east, north] extent of the imagery
schemestring"xyz" (default) or "tms"
volatilebooleanSkip the tile cache
attributionstringAttribution text

A change to tiles or url applies in place, with MapLibre's setTiles and setUrl, so imagery can follow state, a date or a layer picker, with the raster layers on top left where they are:

<HoloMap.Source.Raster id="imagery" tiles={[@imagery_url]} tile_size={256} />

Any other change rebuilds the source (see "Updating a source" in HoloMap.Source).

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.