Skip to content

Commit 5411a75

Browse files
committed
doc(googleMaps): make billing and requirements clearer.
1 parent e73b4c6 commit 5411a75

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

docs/content/scripts/content/google-maps.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,17 @@ By default, it will load on the `mouseover` and `mouseclick` events.
2929
### Billing & Permissions
3030

3131
::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").
3335
::
3436

3537
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:
3638
- $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
3941

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.
4143

4244
Billing will be optimized in a [future update](https://github.com/nuxt/scripts/issues/83).
4345

@@ -127,7 +129,10 @@ function handleReady({ map }) {
127129

128130
### Props
129131

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
135+
the `center` option there.
131136

132137
**Map**
133138

0 commit comments

Comments
 (0)