Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@sanity/google-maps-input

sanity-io26kMIT4.1.0TypeScript support: included

Sanity plugin providing input handlers for geo-related input types using Google Maps

sanity, cms, headless, realtime, content, google-maps-input, sanity-plugin

readme

@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".

changelog

📓 Changelog

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

4.1.0 (2024-12-16)

Features

  • improve focus handling, open on double-click, support react 19 (#75) (21541fc)

4.0.1 (2024-04-09)

Bug Fixes

  • deps: use caret for styled-components peer dependency (#70) (4b38112)

4.0.0 (2024-04-08)

⚠ BREAKING CHANGES

  • deps: Requires sanity@>=3.19.0 installed as a peer dependency

Bug Fixes

  • deps: require sanity >=3.19.0 (#69) (ef97355)
  • deps: upgrade @sanity/ui and require styled-components v6 as peer dependency (#68) (5cea2c9)

3.0.2 (2023-10-27)

Bug Fixes

3.0.1 (2023-01-06)

Bug Fixes

3.0.0 (2022-11-25)

⚠ BREAKING CHANGES

  • this version does not work ins Sanity Studio v2

Features

  • initial Sanity Studio v3 release (2b825ef)

Bug Fixes

  • compiled for sanity 3.0.0-rc.0 (455b81c)
  • deps: dev-preview.21 (82ece5d)
  • deps: dev-preview.22 (c637a35)
  • deps: pkg-utils & @sanity/plugin-kit (e1a7053)
  • deps: sanity ^3.0.0 (works with rc.3) (e03c9c9)
  • deps: sanity 3.0.0-dev-preview.17 and ui 0.38 (e70074d)
  • deps: update dependencies (non-major) (#3) (bc361e2)
  • deps: updated @sanity/ui (a84ed1c)
  • improve peer deps (5c9c2fc)

3.0.0-v3-studio.8 (2022-11-04)

Bug Fixes

  • deps: pkg-utils & @sanity/plugin-kit (e1a7053)

3.0.0-v3-studio.7 (2022-11-02)

Bug Fixes

  • compiled for sanity 3.0.0-rc.0 (455b81c)

3.0.0-v3-studio.6 (2022-10-27)

Bug Fixes

3.0.0-v3-studio.5 (2022-10-07)

Bug Fixes

3.0.0-v3-studio.4 (2022-09-28)

Bug Fixes

  • deps: update dependencies (non-major) (#3) (bc361e2)
  • improve peer deps (5c9c2fc)

3.0.0-v3-studio.3 (2022-09-15)

Bug Fixes

  • deps: sanity 3.0.0-dev-preview.17 and ui 0.38 (e70074d)

3.0.0-v3-studio.2 (2022-09-09)

Bug Fixes

  • deps: updated @sanity/ui (a84ed1c)