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.DrawingTools.onLayerAdd
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Registra un callback che viene attivato quando viene aggiunto un livello.
Restituisce un ID che può essere passato a unlisten() per annullare la registrazione del callback.
Utilizzo | Resi |
---|
DrawingTools.onLayerAdd(callback) | Stringa |
Argomento | Tipo | Dettagli |
---|
questo: ui.map.drawingtools | ui.Map.DrawingTools | L'istanza ui.Map.DrawingTools. |
callback | Funzione | Il callback da attivare quando viene aggiunto un livello. Alla callback vengono passati due parametri: il GeometryLayer aggiunto e il widget ui.Map.DrawingTools a cui è associato il listener eventi. |
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\u003eRegisters a callback function that is triggered when a new layer is added to the map.\u003c/p\u003e\n"],["\u003cp\u003eReturns a unique ID that can be used to unregister the callback function with the \u003ccode\u003eunlisten()\u003c/code\u003e method.\u003c/p\u003e\n"],["\u003cp\u003eThe callback function receives the added GeometryLayer and the ui.Map.DrawingTools widget as parameters.\u003c/p\u003e\n"]]],[],null,["# ui.Map.DrawingTools.onLayerAdd\n\n\u003cbr /\u003e\n\nRegisters a callback that's fired when a layer is added.\n\n\u003cbr /\u003e\n\nReturns an ID which can be passed to unlisten() to unregister the callback.\n\n| Usage | Returns |\n|-------------------------------------|---------|\n| DrawingTools.onLayerAdd`(callback)` | String |\n\n| Argument | Type | Details |\n|-----------------------------|---------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `ui.map.drawingtools` | ui.Map.DrawingTools | The ui.Map.DrawingTools instance. |\n| `callback` | Function | The callback to fire when a layer is added. The callback is passed two parameters: the added GeometryLayer and the ui.Map.DrawingTools widget that the event listener is bound to. |"]]