You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/scripts/content/google-maps.md
+10-5Lines changed: 10 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,15 +29,17 @@ By default, it will load on the `mouseover` and `mouseclick` events.
29
29
### Billing & Permissions
30
30
31
31
::callout
32
-
You'll need an API key with permissions to access the [Static Maps API](https://developers.google.com/maps/documentation/maps-static/cloud-setup), the [Maps JavaScript API](https://developers.google.com/maps/documentation/javascript/cloud-setup) and [Places API](https://developers.google.com/maps/documentation/places/web-service/cloud-setup).
32
+
You'll need an API key with permissions to access the [Maps JavaScript API](https://developers.google.com/maps/documentation/javascript/cloud-setup).
33
+
34
+
Optionally, you can provide permissions to the [Static Maps API](https://developers.google.com/maps/documentation/maps-static/cloud-setup) (required when lazy loading and using the placeholder map) and [Places API](https://developers.google.com/maps/documentation/places/web-service/cloud-setup) (required when searching using a query, i.e "New York").
33
35
::
34
36
35
37
Showing an interactive JS map requires the Maps JavaScript API, which is a paid service. If a user interacts with the map, the following costs will be incurred:
36
38
- $7 per 1000 loads for the Maps JavaScript API (default for using Google Maps)
37
-
- $2 per 1000 loads for the Static Maps API - You can avoid providing a `placeholder` slot.
38
-
- $5 per 1000 loads for the Geocoding API - You can avoid this by providing a `google.maps.LatLng` object instead of a string for the `center` prop
39
+
- $2 per 1000 loads for the Static Maps API - Only used when you don't provide a `placeholder` slot.
40
+
- $5 per 1000 loads for the Geocoding API - Only used when you don't provide a `google.maps.LatLng` object instead of a query string for the `center` prop
39
41
40
-
However, if the user never engages with the map, only the Static Maps API usage ($2 per 1000 loads) will be charged.
42
+
However, if the user never engages with the map, only the Static Maps API usage ($2 per 1000 loads) will be charged, assuming you're using it.
41
43
42
44
Billing will be optimized in a [future update](https://github.com/nuxt/scripts/issues/83).
43
45
@@ -127,7 +129,10 @@ function handleReady({ map }) {
127
129
128
130
### Props
129
131
130
-
The `ScriptGoogleMaps` component accepts the following props:
132
+
The `ScriptGoogleMaps` component accepts the following props.
133
+
134
+
You must provide a `center` prop for the map to load correctly, alternatively you should provide `mapOptions` and configure
0 commit comments