# maps

> Reference for the maps tool of Author: world maps, with every action and the arguments you can pass.

Source: https://author.geenius.io/docs/reference/maps/

World maps: places pinned on a picture or a drawing, with routes and distances. Routes give the travel check its distances.

Call it as `geenius_author(tool: "maps", action: "<action>", args: {...})` through Geenius OS.

## Actions

| Action | What it does |
|---|---|
| `list` | The world maps (of one book, or all). Rules: book_id?. |
| `get` | One map: its pins, routes and drawing. Rules: map_id. |
| `create` | A new world map. Rules: name, book_id?, image_file_id? (a picture uploaded in the Author app), width?, height? (map units), km_per_unit?. |
| `update` | Change a map. Rules: map_id + any of those (those of map_create). |
| `delete` | Delete a map. Rules: map_id. |
| `pin` | Pin a place profile on a map. Rules: map_id, profile_id (a place or city), x, y, label?. |
| `unpin` | Take a place's pin off a map. Rules: map_id, profile_id. |
| `route` | A route between two pinned places, with its distance. Rules: map_id, from_id, to_id (pinned profiles), km? (measured on the map when omitted), mode?, label?. |
| `unroute` | Remove a route. Rules: map_id, route_id. |
| `draw` | Replace a map's drawing with strokes. Rules: map_id, strokes [{points:[x0,y0,x1,y1,…], color?, width?, fill?}] (replaces the drawing). |

## Arguments we have checked

### maps · list

The world maps (of one book, or all). Rules: book_id?.

- `book_id`

### maps · get

One map: its pins, routes and drawing. Rules: map_id.

- `map_id` (required)

### maps · create

A new world map. Rules: name, book_id?, image_file_id? (a picture uploaded in the Author app), width?, height? (map units), km_per_unit?.

- `book_id`
- `height`
- `image_file_id`
- `km_per_unit`
- `name` (required)
- `width`

### maps · update

Change a map. Rules: map_id + any of those (those of map_create).

- `book_id`
- `height`
- `image_file_id`
- `km_per_unit`
- `map_id` (required)
- `name`
- `width`

### maps · delete

Delete a map. Rules: map_id.

- `map_id` (required)

### maps · pin

Pin a place profile on a map. Rules: map_id, profile_id (a place or city), x, y, label?.

- `label`
- `map_id` (required)
- `profile_id` (required)
- `x` (required)
- `y` (required)

### maps · unpin

Take a place's pin off a map. Rules: map_id, profile_id.

- `map_id` (required)
- `profile_id` (required)

### maps · route

A route between two pinned places, with its distance. Rules: map_id, from_id, to_id (pinned profiles), km? (measured on the map when omitted), mode?, label?.

- `from_id` (required)
- `km`
- `label`
- `map_id` (required)
- `mode`
- `to_id` (required)

### maps · unroute

Remove a route. Rules: map_id, route_id.

- `map_id` (required)
- `route_id` (required)

### maps · draw

Replace a map's drawing with strokes. Rules: map_id, strokes [{points:[x0,y0,x1,y1,…], color?, width?, fill?}] (replaces the drawing).

- `map_id` (required)
- `strokes` (required)

> [!TIP]
> Ask for the exact arguments of any action with `action: "help", of: "list"`. The server answers from its own definitions, so that answer is always current.

