HoloMap.Control.Geolocate (HoloMap v0.1.0)

Copy Markdown View Source

Locate the user, and optionally follow them.

<HoloMap.Control.Geolocate track_user_location show_user_heading />

Props

PropTypeNotes
positionstringCorner to place the control in. Default "top-right"
track_user_locationbooleanKeep following after the first fix
show_user_locationbooleanDraw a dot at the users position. Default true
show_accuracy_circlebooleanDraw the accuracy radius. Default true
show_user_headingbooleanDraw a heading arrow on the dot
position_optionsmapPassed to the browser Geolocation API
fit_bounds_optionsmapCamera options used when zooming to the user

position_options takes enableHighAccuracy, timeout and maximumAge.

Geolocation requires a secure context and the users permission, and the browser prompt only appears when they click the button. Nothing happens on page load, by design.

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.