# Mappedin Venue Format

**Mappedin Venue Format (MVF)** is a [GeoJSON](https://geojson.org/.html) based format containing geometry data associated with an indoor map. This package contains type definitions and validation functions to assist with parsing and utilizing MVF.

## Resources

-   [Mappedin Developer Portal](https://developer.mappedin.com.html)
-   [Getting Started with MVF v2](https://developer.mappedin.com/mappedin-venue-format/getting-started.html)
-   [MVF v2 API Reference](https://developer.mappedin.com/mvf-api/v2.html)

## Usage

### Installation

`npm install @mappedin/mvf`

or

`yarn add @mappedin/mvf`

### Getting Started

All types are available as top-level exports of this package. Use the types to ensure data conforms to the MVF.

```ts
import { EntranceCollection, ObstructionCollection, SpaceCollection } from '@mappedin/mvf';

function loadData(path: string) {
	return fetch(path).then((res) => res.json());
}

const venue = 'mappedin-office';
const mapId = 'm_874696f47fbecb07';

const spaces: SpaceCollection = await loadData(`/data/${venue}/space/${mapId}.geojson`);
const obstructions: ObstructionCollection = await loadData(`/data/${venue}/obstruction/${mapId}.geojson`);
const entrances: EntranceCollection = await loadData(`/data/${venue}/entrance/${mapId}.geojson`);
```

For full documentation, read our [Getting Started guide on the Developer Portal](https://developer.mappedin.com/mappedin-venue-format/getting-started.html).