fay-geoposition-0.1.0.0: W3C compliant implementation of GeoPosition API.

Copyright(c) 2015 Altera Praxis Pty Ltd
LicenseBSD
Maintainereocallaghan@alterapraxis.com
Stabilityprovisional
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Fay.GeoPosition

Description

This module encapsulates Fay Javascript for the GeoPosition API specified as in the W3C spec.

Synopsis

Documentation

geoPositionErrorMessage :: GeoPositionError -> String Source

Helper function extracts UTC-16 encoded error message

geoPositionErrorCode :: GeoPositionError -> GeoPositionErrorCode Source

Helper function decodes enumerated error code into the GeoPositionErrorCode type

data GeoPositionCallbacks m Source

See section [5.1 - W3C Geolocation API] Requires the monad type that the callbacks have action on

Constructors

GeoPositionCallbacks 

Fields

geoPositionCallback :: GeoPositionCallback m
 
geoPositionErrorCallback :: Maybe (GeoPositionErrorCallback m)
 

data GeoPositionOptions Source

See section [5.2 - W3C Geolocation API]

Constructors

GeoPositionOptions 

Fields

enableHighAccuracy :: Bool

Is a Bool that indicates the application would like to receive the best possible results.

timeout :: Int

Maximum length of time (in milliseconds) the device is allowed to take in order to return a position.

maximumAge :: Int

Maximum age in milliseconds of a possible cached position that is acceptable to return.

data GeoPosition Source

See section [5.3 - W3C Geolocation API]

Constructors

GeoPosition 

Fields

coords :: GeoCoordinates

Coordinates object defining the current location

timestamp :: UTCTime

DOMTimeStamp, time at which location was retrieved

data GeoCoordinates Source

See section [5.4 - W3C Geolocation API]

Constructors

GeoCoordinates 

Fields

latitude :: Double

decimal degrees

longitude :: Double

decimal degrees

altitude :: Maybe Double

meters above the reference ellipsoid

accuracy :: Double

meters

altitudeAccuracy :: Maybe Double

meters

heading :: Maybe Double

degrees clockwise from true north

speed :: Maybe Double

meters/second

data GeoPositionError Source

See section [5.5 - W3C Geolocation API]

Constructors

GeoPositionError 

Fields

code :: Int

Enumerated code, see GeoPositionErrorCode

message :: Text

Human readable 'UTF-16 DOMString' for debugging

data GeoPositionErrorCode Source

N.B. Fay does not support the Enum type class :( Thus, use the geoPositionErrorCode function to decode the value to the GeoPositionErrorCode type.

Constructors

PermissionDenied

The acquisition of the geolocation information failed because the page didn't have the permission to do it.

PositionUnavailable

The acquisition of the geolocation failed because at least one internal source of position returned an internal error.

Timeout

The time allowed to acquire the geolocation, defined by timeout information was reached before the information was obtained.

Unknown

Out of spec error code