@sanity/google-maps-input
TypeScript icon, indicating that this package has built-in type declarations

4.1.0 • Public • Published

@sanity/google-maps-input

This is a Sanity Studio v3 plugin. For the v2 version, please refer to the v2-branch.

What is it?

Plugin for Sanity Studio providing input handlers for geo-related input types using Google Maps.

This plugin will replace the default geopoint input component.

Google maps input

Know issues in Studio V3

  • Diff-preview is not implemented.

These will be re-added well before Studio V3 GA.

Installation

In your studio folder, run:

npm install --save @sanity/google-maps-input

or

yarn add @sanity/google-maps-input

Usage

Add it as a plugin in sanity.config.ts (or .js), with a valid Google Maps API key:

import {googleMapsInput} from '@sanity/google-maps-input'

export default defineConfig({
  // ...
  plugins: [
    googleMapsInput({
      apiKey: 'my-api-key',
    }),
  ],
})

Ensure that the key has access to:

  • Google Maps JavaScript API (for the interactive map)
  • Google Places API Web Service (for the search feature)
  • Google Static Maps API (for previewing a location)

And that the key allows web-access from the Studio URL(s) you are using the plugin in.

Note: This plugin will replace the default geopoint input component.

Stuck? Get help

Slack Community Button

Join Sanity’s developer community or ping us on twitter.

License

MIT-licensed. See LICENSE.

Develop & test

Add a Google Maps API key to .env.local (see .env.example for example format).

This plugin uses @sanity/plugin-kit with default configuration for build & watch scripts.

See Testing a plugin in Sanity Studio on how to run this plugin with hotreload in the studio.

Release new version

Run "CI & Release" workflow. Make sure to select the main branch and check "Release new version".

Package Sidebar

Install

npm i @sanity/google-maps-input

Weekly Downloads

8,807

Version

4.1.0

License

MIT

Unpacked Size

189 kB

Total Files

33

Last publish

Collaborators

  • kmelve
  • bjoerge
  • rexxars
  • skogsmaskin
  • tonina
  • mattcraig
  • joneidejohnsen
  • rubioz
  • robinpyon
  • mariuslundgard
  • sanity-io
  • evenw
  • radhe_sanity
  • rbotten
  • danielsgroves
  • judofyr
  • ryanblock
  • obliadp
  • dcilke
  • madken
  • fredcarlsen
  • hermanw
  • tambet
  • sgulseth
  • atombender
  • simeonsanity
  • stipsan
  • snorreeb
  • rankers
  • rdunk
  • michael-sanity
  • vincentquigley
  • ritasdias
  • kenjonespizza
  • rneatherway-sanity
  • josh_sanity_io
  • cngonzalez-sanity
  • jjburbridge
  • tdfka_rick
  • svirs
  • ryanbonial-sanity
  • indrek.karner
  • ash
  • sergeisarviro
  • refiito
  • drewsanity
  • kaspar.lippmaa.sanity
  • dam
  • simen.svale
  • tbeseda
  • daniel.malmer
  • jordanl17
  • colepeters
  • armandocerna
  • joan_miralles_paez
  • christianhg
  • pedro-sanity
  • jwoods-sanity
  • ricokahler
  • tiit.kass.saity
  • binoy14
  • pauloborgesf
  • ausha
  • nuurtamo
  • chrislarocquesanity