Skip to content

Commit ddff632

Browse files
committed
fix: update on InternalUsageAttributionIds
1 parent d6c2b21 commit ddff632

File tree

2 files changed

+4
-18
lines changed

2 files changed

+4
-18
lines changed

README.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ npm i -D @types/google.maps
3939

4040
The reference documentation can be found at this [link](https://googlemaps.github.io/js-api-loader/index.html). The Google Maps JavaScript API [documentation](https://developers.google.com/maps/documentation/javascript/tutorial) is the authoritative source for the loader options.
4141

42-
## Internal usage attribution ID
43-
44-
This library uses `internalUsageAttributionIds`, which helps Google understand which libraries and samples are helpful to developers and is optional. Instructions for opting out of the identifier are provided in reference documentation.
45-
4642
## Example
4743

4844
```javascript
@@ -61,15 +57,6 @@ const mapOptions = {
6157
},
6258
zoom: 4
6359
};
64-
65-
// Adds a usage attribution ID to the initializer, which helps Google understand which libraries and samples are helpful to developers, such as usage of this library.
66-
// To opt out of sending the usage attribution ID, it is safe to set the const to false or replace the value with an empty string.
67-
const useIneternalUsageAttributionId = true;
68-
const internalUsageAttributionId = "GMP_LIB_JS_API_LOADER";
69-
70-
if (useIneternalUsageAttributionId) {
71-
mapOptions.internalUsageAttributionIds = [internalUsageAttributionId];
72-
}
7360
```
7461

7562
Using a promise for a specific library.

examples/index.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,13 @@
5151
mapId: "DEMO_MAP_ID"
5252
};
5353

54-
// Adds a usage attribution ID to the initializer, which helps Google understand which libraries and samples are helpful to developers, such as usage of this library.
55-
// To opt out of sending the usage attribution ID, it is safe to set the const to false or replace the value with an empty string.
56-
54+
// See https://developers.google.com/maps/documentation/javascript/reference/map#MapOptions.internalUsageAttributionIds
55+
5756
const useInternalUsageAttributionId = true;
58-
const internalUsageAttributionId = "GMP_LIB_JS_API_LOADER";
57+
const internalUsageAttributionIds = ["GMP_LIB_JS_API_LOADER"];
5958

6059
if (useInternalUsageAttributionId) {
61-
mapOptions.usageAttributionIds = [internalUsageAttributionId];
60+
mapOptions.usageAttributionIds = internalUsageAttributionIds;
6261
}
6362

6463
const loader = new google.maps.plugins.loader.Loader({

0 commit comments

Comments
 (0)