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
| Prop | Type | Notes |
|---|---|---|
id | string | Required. Referenced by layers' source prop |
url | string | TileJSON endpoint. Supply this or tiles |
tiles | list | Tile URL templates containing {z}, {x}, {y} |
min_zoom / max_zoom | number | Zoom range the tiles exist at |
bounds | list | [west, south, east, north] extent of the data |
scheme | string | "xyz" (default) or "tms" |
promote_id | string or map | Property to use as the feature id |
volatile | boolean | Skip the tile cache |
attribution | string | Attribution text |
encoding | string | "mvt" (default), Mapbox Vector Tiles, or "mlt", MapLibre Tiles |
sparse | boolean | Experimental in MapLibre. A missing tile is drawn from a lower zoom. See below |
Encoding and sparse tilesets
encoding says how the tiles are encoded: Mapbox Vector Tiles unless told
otherwise, or MapLibre Tiles (MLT), a newer columnar encoding MapLibre GL JS
reads since 5.12.0, with encoding="mlt". The prop wins over an encoding
the TileJSON at url names.
sparse is marked experimental in MapLibre's style specification. It is
for a tileset that leaves out tiles where a lower zoom already says all
there is. With it, MapLibre GL JS loads a tile the server answers with a 404
from the nearest lower zoom that has one, a few zoom levels up at most, and
cuts it to size, as it does for a tile beyond the tileset's max_zoom.
Without it, such a tile draws nothing. The prop wins over a sparse the
TileJSON names.
Updating the source
A change to tiles or url applies in place, with MapLibre's setTiles
and setUrl: the source requests its tiles again and the layers on top of
it stay. Changing any other prop, or taking tiles or url away, 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
@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
Returns the list of property definitions for the compiled component.