plinth/browser/geolocation
Types
pub type GeolocationPosition {
GeolocationPosition(
latitude: Float,
longitude: Float,
altitude: Option(Float),
accuracy: Float,
altitude_accuracy: Option(Float),
heading: Option(Float),
speed: Option(Float),
timestamp: Float,
)
}
Constructors
-
GeolocationPosition( latitude: Float, longitude: Float, altitude: Option(Float), accuracy: Float, altitude_accuracy: Option(Float), heading: Option(Float), speed: Option(Float), timestamp: Float, )
pub type JSGeolocationPosition
pub type JSGeolocationPositionError
Functions
pub fn current_position() -> Promise(
Result(GeolocationPosition, String),
)
pub fn get_current_position(
success: fn(JSGeolocationPosition) -> Nil,
error: fn(JSGeolocationPositionError) -> Nil,
) -> Nil