Annuncio: tutti i progetti non commerciali registrati per l'utilizzo di Earth Engine prima del
15 aprile 2025 devono
verificare l'idoneità non commerciale per mantenere l'accesso a Earth Engine.
ui.Map.setLocked
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Limita la panoramica e lo zoom sulla mappa.
- Per bloccare sia la panoramica che lo zoom, imposta locked su true e nient'altro.
- Per consentire lo spostamento e limitare lo zoom minimo e massimo, imposta locked su false e fornisci i parametri minZoom e maxZoom.
- Per impedire lo spostamento e limitare lo zoom minimo e massimo, imposta locked su true e fornisci i parametri minZoom e maxZoom.
- Per ripristinare la mappa alle impostazioni predefinite, imposta locked su false e nient'altro.
Utilizzo | Resi |
---|
Map.setLocked(locked, minZoom, maxZoom) | |
Argomento | Tipo | Dettagli |
---|
questo: ui.map | ui.Map | L'istanza ui.Map. |
locked | Booleano | Indica se la mappa deve essere bloccata o meno. |
minZoom | Numero, facoltativo | (facoltativo) Lo zoom minimo per la mappa, compreso tra 0 e 24. |
maxZoom | Numero, facoltativo | (facoltativo) Lo zoom massimo per la mappa, compreso tra 0 e 24. |
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-07-26 UTC.
[null,null,["Ultimo aggiornamento 2025-07-26 UTC."],[[["\u003cp\u003e\u003ccode\u003eMap.setLocked()\u003c/code\u003e controls the panning and zooming behavior of the map.\u003c/p\u003e\n"],["\u003cp\u003eSetting \u003ccode\u003elocked\u003c/code\u003e to \u003ccode\u003etrue\u003c/code\u003e restricts panning and, optionally, allows setting zoom limits with \u003ccode\u003eminZoom\u003c/code\u003e and \u003ccode\u003emaxZoom\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eSetting \u003ccode\u003elocked\u003c/code\u003e to \u003ccode\u003efalse\u003c/code\u003e with no other parameters resets the map to default behavior.\u003c/p\u003e\n"],["\u003cp\u003eProviding \u003ccode\u003eminZoom\u003c/code\u003e and/or \u003ccode\u003emaxZoom\u003c/code\u003e along with \u003ccode\u003elocked\u003c/code\u003e sets zoom limitations, while the presence or absence of \u003ccode\u003elocked\u003c/code\u003e dictates panning restrictions.\u003c/p\u003e\n"]]],[],null,["# ui.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| this: `ui.map` | ui.Map | The ui.Map instance. |\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. |"]]