gampleman / elm-mapbox / LngLat

Encodes geographic position.


type alias LngLat =
{ lng : Basics.Float
, lat : Basics.Float 
}

A LngLat represents a geographic position.

encodeAsPair : LngLat -> Json.Encode.Value

Most implementations seem to encode these as a 2 member array.

encodeAsObject : LngLat -> Json.Encode.Value

We can also encode as an {lng: 32, lat: 435} object.

decodeFromPair : Json.Decode.Decoder LngLat

Most implementations seem to encode these as a 2 member array.

decodeFromObject : Json.Decode.Decoder LngLat

We can also encode from an {lng: 32, lat: 435} object.

map : (Basics.Float -> Basics.Float) -> LngLat -> LngLat

toString : LngLat -> String

Returns a text representation suitable for humans.