# MapNotice

## Overview

`MapNotice` is a persistent badge over the map for provenance, caveats, and attribution. It covers the two notices that must stay on screen permanently: the "demonstrative data" seal and any cartographic credit a tile license requires. Its surfaces are built from semantic tokens, so it stays legible in light and dark without consumer intervention.

---

## Import

```tsx
import { MapNotice, type MapNoticeVariant } from 'xertica-ui/ui';
```

---

## Prerequisites

- Import `xertica-ui/style.css` once at the app root.
- For the default `layout="overlay"`, wrap the map and the notice in a container with `position: relative`.
- For basemap licensing credit specifically, prefer `<Map attribution="…">`, which is placed and sized to the cartographic convention.

---

## Props

| Prop       | Type                                 | Default       | Description                                                     |
| ---------- | ------------------------------------ | ------------- | --------------------------------------------------------------- |
| `variant`  | `'info' \| 'warning' \| 'synthetic'` | `'info'`      | `synthetic` marks demonstrative or generated data.              |
| `position` | `MapOverlayPosition`                 | `'top-right'` | Anchor for `layout="overlay"`. One of nine.                     |
| `layout`   | `'overlay' \| 'inline'`              | `'overlay'`   | `overlay` floats over the map; `inline` flows in normal layout. |
| `children` | `ReactNode`                          | required      | Short phrase. A notice is a label, not a message box.           |

---

## Example

```tsx
import { Map, MapNotice } from 'xertica-ui/ui';

<div className="relative">
  <Map height="440px" attribution="© OpenStreetMap contributors" markers={markers} />
  <MapNotice variant="synthetic" position="top-right">
    Dados demonstrativos
  </MapNotice>
  <MapNotice variant="info" position="top-left">
    Posições agregadas por centroide municipal
  </MapNotice>
</div>;
```

---

## AI Rules

- **Always** use `variant="synthetic"` for demo, seeded, or generated data. Provenance is a statement of fact, not a problem the user can act on.
- **Always** wrap the map and the notice in a `relative` container when using the default overlay layout.
- **Always** keep the text to a short phrase.
- **Never** use `variant="warning"` for synthetic data — `warning` tells the user something is wrong.
- **Never** hand-style an attribution badge per theme. Use `<Map attribution>` and let the tokens handle light and dark.
- Common mistake: putting a paragraph of explanation inside a notice. Anything longer than a phrase belongs in an `Alert` beside the map.
