お知らせ:
2025 年 4 月 15 日より前に Earth Engine の使用を登録したすべての非商用プロジェクトは、Earth Engine へのアクセスを維持するために
非商用目的での利用資格を確認する必要があります。
Map.setOptions
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Google マップの基本地図を変更します。次のことが可能になります。
1)現在の MapType を設定します。2)基本地図のカスタム スタイル(MapTypeStyles)を指定する。3)基本地図で使用可能な mapTypesIds のリストを設定します。
パラメータなしで呼び出された場合、地図のタイプを Google のデフォルトにリセットします。
マップを返します。
用途 | 戻り値 |
---|
Map.setOptions(mapTypeId, styles, types) | ui.Map |
引数 | タイプ | 詳細 |
---|
mapTypeId | 文字列、省略可 | 基本地図を設定する mapTypeId。「ROADMAP」、「SATELLITE」、「HYBRID」、「TERRAIN」のいずれか 1 つを指定して、標準の Google Maps API の地図タイプを選択するか、opt_styles 辞書で指定されたキーのいずれか 1 つを指定します。null のままにして、opt_styles でスタイルが 1 つだけ指定されている場合は、そのスタイルが使用されます。 |
styles | オブジェクト、省略可 | 地図の地図タイプ コントロールに表示される名前でキー付けされたカスタム MapTypeStyle オブジェクトのディクショナリ。https://developers.google.com/maps/documentation/javascript/reference#MapTypeStyle をご覧ください。 |
types | List<String>(省略可) | 使用可能にする mapTypeId のリスト。省略した場合で、opt_styles が指定されている場合は、すべてのスタイルキーが標準の Google Maps API の地図タイプに追加されます。 |
例
コードエディタ(JavaScript)
// Types
Map.setOptions('HYBRID');
Map.setOptions('ROADMAP');
Map.setOptions('SATELLITE');
Map.setOptions('TERRAIN');
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-25 UTC。
[null,null,["最終更新日 2025-07-25 UTC。"],[[["\u003cp\u003eModifies the Google Maps basemap by setting the map type, providing custom styles, and controlling available map types.\u003c/p\u003e\n"],["\u003cp\u003eAccepts parameters to change the basemap's appearance or resets to the default Google Maps style when called without parameters.\u003c/p\u003e\n"],["\u003cp\u003eOffers flexibility in styling through custom MapTypeStyle objects and allows for selection from standard Google Maps API map types or custom styles.\u003c/p\u003e\n"],["\u003cp\u003eUses the \u003ccode\u003esetOptions()\u003c/code\u003e method with arguments for mapTypeId, styles, and types to implement the modifications.\u003c/p\u003e\n"],["\u003cp\u003eReturns the ui.Map object after applying the specified options.\u003c/p\u003e\n"]]],["This function, `Map.setOptions()`, modifies the Google Maps basemap. It can set the `mapTypeId` to \"ROADMAP,\" \"SATELLITE,\" \"HYBRID,\" or \"TERRAIN,\" or to a custom style from the `styles` dictionary. Custom styles (`styles`) are defined as `MapTypeStyle` objects. The available `mapTypeIds` displayed in the basemap can be defined in `types`. If called without arguments, the function reverts to the default Google map type. It returns the modified `ui.Map` object.\n"],null,["# Map.setOptions\n\n\u003cbr /\u003e\n\nModifies the Google Maps basemap. Allows for:\n\n\u003cbr /\u003e\n\n1) Setting the current MapType. 2) Providing custom styles for the basemap (MapTypeStyles). 3) Setting the list of available mapTypesIds for the basemap.\n\nIf called with no parameters, resets the map type to the google default.\n\nReturns the map.\n\n| Usage | Returns |\n|----------------------------------------------------------|---------|\n| `Map.setOptions(`*mapTypeId* `, `*styles* `, `*types*`)` | ui.Map |\n\n| Argument | Type | Details |\n|-------------|--------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `mapTypeId` | String, optional | A mapTypeId to set the basemap to. Can be one of \"ROADMAP\", \"SATELLITE\", \"HYBRID\" or \"TERRAIN\" to select one of the standard Google Maps API map types, or one of the keys specified in the opt_styles dictionary. If left as null and only 1 style is specified in opt_styles, that style will be used. |\n| `styles` | Object, optional | A dictionary of custom MapTypeStyle objects keyed with a name that will appear in the map's Map Type Controls. See: https://developers.google.com/maps/documentation/javascript/reference#MapTypeStyle |\n| `types` | List\\\u003cString\\\u003e, optional | A list of mapTypeIds to make available. If omitted, but opt_styles is specified, appends all of the style keys to the standard Google Maps API map types. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// Types\nMap.setOptions('HYBRID');\nMap.setOptions('ROADMAP');\nMap.setOptions('SATELLITE');\nMap.setOptions('TERRAIN');\n```"]]