getsurance/elm-street/1.0.0

NOTE: the latest version is 2.0.0

ElmStreet.Place

Types for Google places api

Type aliases

type alias Place =
{ addressComponents : List AddressComponent
, adrAddress : String
, formattedAddress : String
, geometry : Geometry
, icon : String
, id : String
, name : String
, placeId : String
, reference : String
, scope : String
, types : List String
, url : String
, utcOffset : Int
, vicinity : String
}

Type alias for PlaceResult

type alias LatLng =
{ lat : Float
, lng : Float
}

Type alias for LatLng coordinates

type alias LatLngBounds =
{ south : Float
, west : Float
, north : Float
, east : Float
}

Type alias for LatLngBouns

type alias AddressComponent =
{ long_name : String
, short_name : String
, types : List ComponentType
}
type alias Geometry =
{ location : LatLng
, viewport : LatLngBounds
}

Type alias for PlaceGeometry

= StreetAddress
| Route
| Intersection
| Political
| Country
| AdministrativeAreaLevel1
| AdministrativeAreaLevel2
| AdministrativeAreaLevel3
| AdministrativeAreaLevel4
| AdministrativeAreaLevel5
| ColloquialArea
| Locality
| Sublocality
| SublocalityLevel1
| SublocalityLevel2
| SublocalityLevel3
| SublocalityLevel4
| SublocalityLevel5
| Neighborhood
| Premise
| Subpremise
| PostalCode
| NaturalFeature
| Airport
| Park
| PostBox
| StreetNumber
| Floor
| Room
| Establishment
| PointOfInterest
| Parking
| PostalTown
| BusStation
| TrainStation
| TransitStation
| PostalCodeSuffix
| OtherComponent

Types for address component

Decoding

decoder : Decoder Place

Decoder for objects of type PlaceResult

Helper

getComponentName : Place -> ComponentType -> Maybe String

Helper function to name by components type.