| Copyright | (c) Marco Zocca 2018 |
|---|---|
| License | GPL-3 |
| Maintainer | zocca.marco gmail |
| Stability | experimental |
| Portability | POSIX |
| Safe Haskell | None |
| Language | Haskell2010 |
Web.API.MapQuest
Description
Geocoding
Running requests
Arguments
| :: (FromJSON a, Floating a) | |
| => Creds | API key (available for free on https://developer.mapquest.com) |
| -> GeoQuery | Location to be queried |
| -> IO (Maybe (Coords a)) |
Call the MapQuest Geocoding API with a given address and extract the coordinates from the parsed result.
Example usage : assuming the user has bound key to hold the API key string, the following can be run in a GHCi shell :
>>>runRequest key (GQ "Via Irnerio" "Bologna" "Italy")Just (Coords {lat = 44.49897, long = 11.34503})
>>>runRequest key (GQFree "Ngong Ping 360, Hong Kong")Just (Coords {lat = 22.264412, long = 114.16706})
Parameters
The user's API credential (i.e. the MapQuest "consumer key", visible at https://developer.mapquest.com/user/me/apps )
Geocoding query parameters
Constructors
| GQ | |
| GQFree Text | Free-text query (must be a valid address or location e.g. "Ngong Ping 360, Hong Kong") |
Output
Coordinates
Instances
| Eq a => Eq (Coords a) # | |
| Show a => Show (Coords a) # | |
| Generic (Coords a) # | |
| type Rep (Coords a) # | |
Defined in Web.API.MapQuest.Geocoding type Rep (Coords a) = D1 (MetaData "Coords" "Web.API.MapQuest.Geocoding" "mapquest-api-0.3.1-1mXHHlGJDNE6HMYjVXGBl1" False) (C1 (MetaCons "Coords" PrefixI True) (S1 (MetaSel (Just "lat") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a) :*: S1 (MetaSel (Just "long") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a))) | |