Settings
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
設定
class
google.maps.Settings
class
用於控制 Maps JavaScript API 整體行為的設定。
請呼叫 const {Settings} = await google.maps.importLibrary("core")
存取。請參閱「Maps JavaScript API 中的程式庫」。
靜態方法 |
getInstance |
getInstance()
參數:無
傳回 google.maps.Settings 的單例模式例項。 |
屬性 |
experienceIds
|
一組用於歸因 Maps JS API 呼叫的獨特體驗 ID。傳回的值是 Settings 類別單例例項中儲存的內部值副本。因此,對 google.maps.Settings.getInstance().experienceIds 執行的作業只會修改副本,而不會修改內部值。
如要更新內部值,請將屬性設為單例例項的新值 (例如 google.maps.Settings.getInstance().experienceIds = [experienceId]; )。 |
fetchAppCheckToken |
傳回解析為 Firebase App Check 權杖結果的承諾。權杖會以「X-Firebase-AppCheck」HTTP 標頭的形式附加至 gRPC 要求。如果權杖為空白,則不會附加標頭。 |
google.maps.MapsAppCheckTokenResult
介面
說明 Firebase App Check 權杖結果。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-12-22 (世界標準時間)。
[null,null,["上次更新時間:2024-12-22 (世界標準時間)。"],[],[],null,["# Settings\n\nThe documentation for has moved to a different page.\n\nThe documentation for the linked item could not be found. \n\n[Settings](#Settings)\nclass\n---------------------------\n\n\ngoogle.maps`.`Settings\nclass\n\nSettings which control the behavior of the Maps JavaScript API as a whole.\n\nAccess by calling `const {Settings} = await google.maps.importLibrary(\"core\")`. \nSee [Libraries in the Maps JavaScript API](/maps/documentation/javascript/libraries).\n\n| ### Static Methods ||\n|--------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [getInstance](#Settings.getInstance) | `getInstance()` **Parameters:** None **Return Value:** [Settings](/maps/documentation/javascript/reference/settings#Settings) Returns the singleton instance of `google.maps.Settings`. |\n\n| ### Properties ||\n|----------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [experienceIds](#Settings.experienceIds) | **Notice:** Available only in the [v=beta channel](/maps/documentation/javascript/versions#choosing-the-beta-channel). **Type:** [Iterable](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol)`\u003cstring\u003e` A collection of unique experience IDs to which to attribute Maps JS API calls. The returned value is a copy of the internal value that is stored in the `Settings` class singleton instance. Operations on `google.maps.Settings.getInstance().experienceIds` will therefore only modify the copy and not the internal value. To update the internal value, set the property equal to the new value on the singleton instance (ex: `google.maps.Settings.getInstance().experienceIds = [experienceId];`). |\n| [fetchAppCheckToken](#Settings.fetchAppCheckToken) | **Type:** `function(): `[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)`\u003c`[MapsAppCheckTokenResult](/maps/documentation/javascript/reference/settings#MapsAppCheckTokenResult)`\u003e` Set this property to a function that returns a promise which resolves to a Firebase App Check token result. |\n\n[MapsAppCheckTokenResult](#MapsAppCheckTokenResult)\ninterface\n-------------------------------------------------------------\n\n\ngoogle.maps`.`MapsAppCheckTokenResult\ninterface\n\nDescribes a Firebase App Check token result."]]