@sanity/google-maps-input 4.1.0 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 Sanity.io
3
+ Copyright (c) 2025 Sanity.io
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,17 +1,16 @@
1
1
  # @sanity/google-maps-input
2
2
 
3
- > This is a **Sanity Studio v3** plugin.
4
3
  > For the v2 version, please refer to the [v2-branch](https://github.com/sanity-io/google-maps-input/tree/studio-v2).
5
4
 
6
5
  ## What is it?
7
6
 
8
7
  Plugin for [Sanity Studio](https://www.sanity.io) providing input handlers for geo-related input types using Google Maps.
9
8
 
10
- This plugin will replace the default `geopoint` input component.
9
+ This plugin will replace the default `geopoint` input component and adds support for `geopointRadius` fields with circle visualization.
11
10
 
12
11
  ![Google maps input](assets/google-maps-input.png)
13
12
 
14
- ## Know issues in Studio V3
13
+ ## Known issues in Studio V3
15
14
 
16
15
  - Diff-preview is not implemented.
17
16
 
@@ -35,6 +34,9 @@ yarn add @sanity/google-maps-input
35
34
 
36
35
  Add it as a plugin in sanity.config.ts (or .js), with a valid [Google Maps API key](https://developers.google.com/maps/documentation/javascript/get-api-key):
37
36
 
37
+ > [!WARNING]
38
+ > This plugin will replace the default `geopoint` input component.
39
+
38
40
  ```js
39
41
  import {googleMapsInput} from '@sanity/google-maps-input'
40
42
 
@@ -56,7 +58,62 @@ Ensure that the key has access to:
56
58
 
57
59
  And that the key allows web-access from the Studio URL(s) you are using the plugin in.
58
60
 
59
- Note: This plugin will replace the default `geopoint` input component.
61
+ ### Configuration Options
62
+
63
+ You can also configure additional options:
64
+
65
+ ```js
66
+ import {googleMapsInput} from '@sanity/google-maps-input'
67
+
68
+ export default defineConfig({
69
+ // ...
70
+ plugins: [
71
+ googleMapsInput({
72
+ apiKey: 'my-api-key',
73
+ defaultZoom: 8,
74
+ defaultRadiusZoom: 15, // zoom level for radius editing
75
+ defaultLocation: {lat: 59.91273, lng: 10.74609},
76
+ defaultRadius: 1000, // for geopointRadius fields
77
+ }),
78
+ ],
79
+ })
80
+ ```
81
+
82
+ ### Field Types
83
+
84
+ #### Basic Geopoint Field
85
+
86
+ ![Google maps input](assets/google-maps-input.png)
87
+
88
+ ```typescript
89
+ // In your schema
90
+ export default {
91
+ name: 'location',
92
+ title: 'Location',
93
+ type: 'geopoint',
94
+ }
95
+ ```
96
+
97
+ #### Geopoint Radius Field
98
+
99
+ ![Google maps input](assets/google-maps-radius-input.png)
100
+
101
+ ```typescript
102
+ // In your schema
103
+ export default {
104
+ name: 'serviceArea',
105
+ title: 'Service Area',
106
+ type: 'geopointRadius',
107
+ }
108
+ ```
109
+
110
+ The `geopointRadius` field type extends the basic geopoint with:
111
+
112
+ - A radius property (in meters)
113
+ - Visual circle overlay on the map
114
+ - Editable radius input field
115
+ - Draggable circle for radius adjustment
116
+ - Enhanced diff visualization showing radius changes
60
117
 
61
118
  ## Stuck? Get help
62
119