| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Web.API.Mapquest
Contents
Geocoding
Arguments
| :: Text | API key (available for free on mapquestapi.com) |
| -> GeoQuery | Query address |
| -> IO (Maybe (Coords Float)) |
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 :
>>>request key (GQ "Via Irnerio" "Bologna" "Italy")Just (Coords {lat = 44.49897, long = 11.34503})
>>>request key (GQFree "Hong Kong")Just (Coords {lat = 22.264412, long = 114.16706})