お知らせ:
2025 年 4 月 15 日より前に Earth Engine の使用を登録したすべての非商用プロジェクトは、Earth Engine へのアクセスを維持するために
非商用目的での利用資格を確認する必要があります。
Map.setLocked
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
地図のパンとズームを制限します。
- パンとズームの両方をロックするには、locked を true に設定します。
- パンを許可し、最小ズームと最大ズームを制限するには、locked を false に設定し、minZoom パラメータと maxZoom パラメータを指定します。
- パンを禁止し、最小ズームと最大ズームを制限するには、locked を true に設定し、minZoom パラメータと maxZoom パラメータを指定します。
- 地図をデフォルトにリセットするには、locked を false に設定します。
用途 | 戻り値 |
---|
Map.setLocked(locked, minZoom, maxZoom) | |
引数 | タイプ | 詳細 |
---|
locked | ブール値 | 地図をロックするかどうか。 |
minZoom | 数値、省略可 | (省略可)地図の最小ズームレベル。0 ~ 24 の範囲(両端を含む)。 |
maxZoom | 数値、省略可 | (省略可)地図の最大ズームレベル。0 ~ 24 の範囲(両端の値を含む)。 |
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-26 UTC。
[null,null,["最終更新日 2025-07-26 UTC。"],[[["\u003cp\u003e\u003ccode\u003eMap.setLocked()\u003c/code\u003e enables control over map panning and zooming by setting the \u003ccode\u003elocked\u003c/code\u003e parameter.\u003c/p\u003e\n"],["\u003cp\u003eSetting \u003ccode\u003elocked\u003c/code\u003e to \u003ccode\u003etrue\u003c/code\u003e restricts map movement, while \u003ccode\u003efalse\u003c/code\u003e allows interaction.\u003c/p\u003e\n"],["\u003cp\u003eOptional \u003ccode\u003eminZoom\u003c/code\u003e and \u003ccode\u003emaxZoom\u003c/code\u003e parameters further refine zoom levels when \u003ccode\u003elocked\u003c/code\u003e is used.\u003c/p\u003e\n"],["\u003cp\u003eTo reset the map to default behavior, set \u003ccode\u003elocked\u003c/code\u003e to \u003ccode\u003efalse\u003c/code\u003e without specifying \u003ccode\u003eminZoom\u003c/code\u003e or \u003ccode\u003emaxZoom\u003c/code\u003e.\u003c/p\u003e\n"]]],["The `Map.setLocked()` function controls map panning and zooming. Setting `locked` to `true` disables panning. `minZoom` and `maxZoom` (0-24) define zoom limits, applicable whether panning is locked or not. Setting `locked` to `false` with no other parameters resets the map. To allow panning and limit zoom, set `locked` to false with `minZoom` and `maxZoom`. `True` `locked` with `minZoom` and `maxZoom` disallows panning but limits zooming.\n"],null,["# Map.setLocked\n\n\u003cbr /\u003e\n\nLimits panning and zooming on the map.\n\n\u003cbr /\u003e\n\n- To lock both panning and zooming, set locked to true and nothing else.\n\n- To allow panning and limit the min and max zoom, set locked to false and supply the minZoom and maxZoom parameters.\n\n- To disallow panning and limit min and max zoom, set locked to true and supply the minZoom and maxZoom parameters.\n\n- To reset the map to default, set locked to false and nothing else.\n\n| Usage | Returns |\n|----------------------------------------------------|---------|\n| `Map.setLocked(locked, `*minZoom* `, `*maxZoom*`)` | |\n\n| Argument | Type | Details |\n|-----------|------------------|-----------------------------------------------------------------------|\n| `locked` | Boolean | Whether the map should be locked or not. |\n| `minZoom` | Number, optional | (optional) The minimum zoom for the map, between 0 and 24, inclusive. |\n| `maxZoom` | Number, optional | (optional) The maximum zoom for the map, between 0 and 24, inclusive. |"]]