HoloMap.Source.Image (HoloMap v0.1.0)

Copy Markdown View Source

A single image pinned to four geographic corners.

<HoloMap.Source.Image
  id="floorplan"
  url="/images/floor-3.png"
  coordinates={[
    {-70.6620, 19.4530},
    {-70.6600, 19.4530},
    {-70.6600, 19.4515},
    {-70.6620, 19.4515}
  ]}
/>
<HoloMap.Layer.Raster id="floorplan-layer" source="floorplan" />

Corners are listed clockwise from the top left: top-left, top-right, bottom-right, bottom-left. They are corners of the image, not a bounding box, so the image can be placed rotated or skewed.

Useful for floor plans, historical map scans, weather frames and site overlays. Anything that is one picture rather than a tile pyramid.

Props

PropTypeNotes
idstringRequired. Referenced by layers' source prop
urlstringRequired. Image URL
coordinateslistRequired. Four {lng, lat} corners, clockwise from top-left

Changing url or coordinates uses MapLibre's updateImage, so an animated sequence, such as a radar loop or a time series, swaps frames without rebuilding the source or disturbing the layer above it.

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.