# `JSCalendar.Location`
[🔗](https://github.com/elixir-tempo/jscalendar/blob/v0.1.0/lib/jscalendar/parts.ex#L53)

A physical location
([RFC 8984 §4.2.5](https://www.rfc-editor.org/rfc/rfc8984.html#section-4.2.5)).

`relative_to` says which end of the object the location belongs to,
which is how an itinerary distinguishes where something starts from
where it finishes.

# `t`

```elixir
@type t() :: %JSCalendar.Location{
  coordinates: String.t() | nil,
  description: String.t() | nil,
  extra: map(),
  links: %{optional(String.t()) =&gt; JSCalendar.Link.t()} | nil,
  location_types: MapSet.t() | nil,
  name: String.t() | nil,
  relative_to: String.t() | nil,
  time_zone: String.t() | nil
}
```

# `from_map`

```elixir
@spec from_map(map()) :: {:ok, struct()} | {:error, term()}
```

Read this object from a decoded JSON map.

### Arguments

* `map` is a map with string keys, as `:json.decode/1` returns.

### Returns

* `{:ok, object}`; or

* `{:error, reason}` when a property does not match its declared
  type.

# `jscalendar_type`

```elixir
@spec jscalendar_type() :: String.t()
```

The `@type` value RFC 8984 gives this object.

### Returns

* the type name as a string.

# `to_map`

```elixir
@spec to_map(struct()) :: map()
```

Write this object back to a JSON-ready map.

### Arguments

* `object` is a `t:t/0`.

### Returns

* a map with string keys, ready for `:json.encode/1`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
