# sanity-plugin-mapbox-input

Sanity plugin providing input handlers for geo-related input types using Mapbox.
This plugin replaces the native Sanity `geopoint` type.

## Installation

- `sanity install mapbox-input`

- Then write a valid Mapbox API token into `./config/mapbox-input.json`

```json
{
  "apiKey": null,
  "defaultZoom": 11,
  "defaultLocation": {
    "lat": 40.7058254,
    "lng": -74.1180863
  }
}
```

- `npm start`

## Usage

Use the `geopoint` type in your schema. Ex:

```js
export default {
  name: 'article',
  title: 'Article',
  type: 'document',
  fields: [
    {
      name: 'location',
      type: 'geopoint',
      title: 'Location',
    },
  ],
}
```

## Screenshot

<p hidden align="center">
  <img src="https://user-images.githubusercontent.com/527559/86034638-5fa3c480-ba11-11ea-99d8-5b28aaf24817.jpg" width="520"  alt="Sanity Mapbox Input Plugin" />
</p>

## Related projects

https://github.com/rexxars/sanity-plugin-leaflet-input
