HoloMap.Control.Globe (HoloMap v0.1.0)

Copy Markdown View Source

A button that switches the map between the flat mercator projection and a globe.

<HoloMap.Control.Globe position="top-right" />

New in MapLibre GL JS 6. The projection is a rendering choice, not data: the same sources and layers draw either way, and nothing in your components needs to know which is active.

Props

PropTypeNotes
positionstringCorner to place the control in. Default "top-right"

The control takes no options of its own, because MapLibre's GlobeControl constructor accepts none.

When a globe helps

At low zoom the mercator projection inflates everything far from the equator, which is the wrong story for anything global: coverage maps, flight paths, climate data. A globe removes that distortion and makes polar regions readable. Past roughly zoom 6 the two are indistinguishable, so the control earns its place on world views and clutters a city map.

Pair it with HoloMap.Control.Navigation. A rotated globe is much easier to reset with a compass than by dragging.

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.