ui.Map.DrawingTools.onSelect
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Rejestruje wywołanie zwrotne, które jest uruchamiane po wybraniu kształtu.
Zwraca identyfikator, który można przekazać do funkcji unlisten(), aby wyrejestrować wywołanie zwrotne.
Wykorzystanie | Zwroty |
---|
DrawingTools.onSelect(callback) | Ciąg znaków |
Argument | Typ | Szczegóły |
---|
to: ui.map.drawingtools | ui.Map.DrawingTools | Instancja ui.Map.DrawingTools. |
callback | Funkcja | Funkcja zwrotna, która ma zostać wywołana po wybraniu kształtu. Funkcja zwrotna otrzymuje 3 parametry: wybraną geometrię ee.Geometry, warstwę GeometryLayer, do której należy wybrana geometria, oraz widżet ui.Map.DrawingTools, z którym powiązany jest detektor zdarzeń. |
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-26 UTC.
[null,null,["Ostatnia aktualizacja: 2025-07-26 UTC."],[[["\u003cp\u003eRegisters a callback function that is triggered when a shape is selected on the map.\u003c/p\u003e\n"],["\u003cp\u003eReturns a unique ID that can be used to unregister the callback function using the \u003ccode\u003eunlisten()\u003c/code\u003e method.\u003c/p\u003e\n"],["\u003cp\u003eThe callback function receives the selected geometry, its corresponding layer, and the DrawingTools widget as arguments.\u003c/p\u003e\n"]]],["Registers a callback function triggered when a shape is selected. The function takes a callback as input. It returns a string ID for unregistering the callback later. The callback function receives three parameters: the selected geometry, its associated layer, and the `ui.Map.DrawingTools` instance. The `ui.Map.DrawingTools` is the instance on which the function is being called.\n"],null,["# ui.Map.DrawingTools.onSelect\n\n\u003cbr /\u003e\n\nRegisters a callback that's fired when a shape is selected.\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.onSelect`(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 shape is selected. The callback is passed three parameters: the selected ee.Geometry, the GeometryLayer to which the selected geometry belongs, and the ui.Map.DrawingTools widget that the event listener is bound to. |"]]