HoloMap.Source.Vector (HoloMap v0.1.0)

Copy Markdown View Source

Vector tiles, from a TileJSON endpoint or an explicit tile URL template.

<HoloMap.Source.Vector id="basemap" url="https://tiles.example.com/basemap.json" />

<HoloMap.Source.Vector
  id="parcels"
  tiles={["https://tiles.example.com/parcels/{z}/{x}/{y}.pbf"]}
  min_zoom={8}
  max_zoom={14}
/>

Layers reading from a vector source must set source_layer. A vector tile carries several named layers and MapLibre has no way to guess which one is meant:

<HoloMap.Layer.Fill id="water" source="basemap" source_layer="water"
                    paint={%{fill_color: "#a5d8ff"}} />

Props

PropTypeNotes
idstringRequired. Referenced by layers' source prop
urlstringTileJSON endpoint. Supply this or tiles
tileslistTile URL templates containing {z}, {x}, {y}
min_zoom / max_zoomnumberZoom range the tiles exist at
boundslist[west, south, east, north] extent of the data
schemestring"xyz" (default) or "tms"
promote_idstring or mapProperty to use as the feature id
volatilebooleanSkip the tile cache
attributionstringAttribution text

Changing any of these is a structural update: the source is torn down and rebuilt, and the layers on top of it are detached and re-added around that.

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.