# Offer your app for directions in Maps

> Have an Agent make the geographic coverage file a routing app needs, upload it for the version you submit, and replace it when the area changes.

Source: https://air.build/docs/app-store/list-a-routing-app-in-maps/

A routing app gives directions that other apps can ask for: Apple's [Location and Maps Programming Guide](https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/LocationAwarenessPG/ProvidingDirections/ProvidingDirections.html) says its directions are available to the Maps app and to other apps on the device. Apple's page [Upload a geographic coverage file](https://developer.apple.com/help/app-store-connect/manage-submissions-to-app-review/upload-a-geographic-coverage-file) calls it "an app that provides point-to-point directions for other apps", for iOS and watchOS. A routing app needs a geographic coverage file: a map of the areas where it gives directions. The `asc` help says routing apps require one, and Apple's page says App Review doesn't start on a routing app until the file is uploaded.

> [!NOTE]
> AirBuild has no screen for the coverage file. You ask an Agent in the Project's chat, and it uses `asc routing-coverage` (listed in [asc: apps and App Store listing](https://air.build/docs/cli/asc-apps/#routing-coverage)).

## Before you ask

- The app itself has to be set up as a routing app. Ask the Agent to do it with the coverage file. Apple's [Location and Maps Programming Guide](https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/LocationAwarenessPG/ProvidingDirections/ProvidingDirections.html) covers it, and also what the coverage file may contain.
- Know the areas your app gives directions in: cities, regions or countries.
- The file goes with an App Store version, so start the version first. See [Ship an update to your app](https://air.build/docs/app-store/ship-an-update/#start-the-next-version), or [Create your app's App Store Connect record](https://air.build/docs/app-store/create-your-app-record/) for a new app.

## What the file looks like

The file is GeoJSON. Before it uploads anything, `asc` checks that:

- The file name ends in `.geojson`.
- It holds one object whose `type` is `MultiPolygon`, with at least one polygon.
- Each ring of a polygon has at least four points, and its first and last points are the same.
- Each point is longitude first, then latitude: longitude between -180 and 180, latitude between -90 and 90.

For example, one rectangle:

```json title="coverage.geojson"
{
  "type": "MultiPolygon",
  "coordinates": [
    [
      [[-9.25, 38.65], [-9.05, 38.65], [-9.05, 38.80], [-9.25, 38.80], [-9.25, 38.65]]
    ]
  ]
}
```

## Make the file and upload it

Ask in the Project's chat, for example:

```text
Our app gives transit directions in Lisbon and Porto. Make the routing coverage file for those areas and upload it for version 1.0.
```

1. The Agent writes the `.geojson` file in the Project. To check the areas, ask it to describe what each shape covers before it uploads.
2. It uploads the file for the version with `asc routing-coverage create`. If the file breaks one of the rules above, `asc` stops before uploading and says what's wrong, for example "invalid routing coverage GeoJSON: top-level type must be MultiPolygon".
3. The Agent tells you the upload is done. It can check later with `asc routing-coverage view`, which shows the coverage file of a version.

Then submit the version as usual. See [Submit to App Review and release](https://air.build/docs/app-store/submit-for-review/#submit-a-version).

If the Agent prepares the version with `asc release stage`, it can upload the file in the same run with `--routing-coverage-file`. `asc release stage` always needs `--confirm`, so the Agent asks you first. See [asc: review and release](https://air.build/docs/cli/asc-release/#release).

## Change the area

A version has one coverage file. To change it, the Agent deletes the old one with `asc routing-coverage delete`, then uploads the new one. `asc` deletes only with `--confirm`, so the Agent asks you first. Until the new file is uploaded, the version has no coverage file. `asc release stage` with `--routing-coverage-file` replaces the old file in one run; it also needs `--confirm`.

## Questions

**Does the next version keep the coverage file?**

The file belongs to one App Store version, and `asc` doesn't say whether a new version keeps it. When you start the next version, ask the Agent to check it with `asc routing-coverage view` and to upload the file again if it's missing.

**asc says the longitude or latitude is out of range.**

The points may be the wrong way round: GeoJSON puts longitude first. Ask the Agent to swap them. Swapped points often pass the check and put the area in the wrong place, so ask the Agent to describe each shape (step 1).

**asc says the start and end points must be the same.**

Each ring has to close: its last point repeats its first. Ask the Agent to fix the file.

**asc says the file must use the .geojson extension.**

Ask the Agent to rename the file so it ends in `.geojson`.

**App Review hasn't started on my routing app.**

Apple's page says review doesn't start until the coverage file is uploaded. Ask the Agent to check the version with `asc routing-coverage view`.

**My app isn't a directions app. Does it need this?**

The `asc` help says the file is required for routing apps. Apple's page describes a routing app as one that gives point-to-point directions for other apps.
