ui.Map.DrawingTools.onLayerConfig
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Enregistre un rappel qui est déclenché lorsque le nom ou la couleur d'un calque sont modifiés.
Renvoie un ID qui peut être transmis à unlisten() pour annuler l'enregistrement du rappel.
Utilisation | Renvoie |
---|
DrawingTools.onLayerConfig(callback) | Chaîne |
Argument | Type | Détails |
---|
ceci : ui.map.drawingtools | ui.Map.DrawingTools | Instance ui.Map.DrawingTools. |
callback | Fonction | Rappel à déclencher après la configuration d'un calque. Le rappel reçoit deux paramètres : le GeometryLayer configuré et le widget ui.Map.DrawingTools auquel l'écouteur d'événements est lié. |
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/07/26 (UTC).
[null,null,["Dernière mise à jour le 2025/07/26 (UTC)."],[[["\u003cp\u003eRegisters a callback function that is triggered when a layer's name or color is modified.\u003c/p\u003e\n"],["\u003cp\u003eProvides a unique ID that can be used to unregister the callback using the \u003ccode\u003eunlisten()\u003c/code\u003e function.\u003c/p\u003e\n"],["\u003cp\u003eThe callback receives the modified \u003ccode\u003eGeometryLayer\u003c/code\u003e and the \u003ccode\u003eui.Map.DrawingTools\u003c/code\u003e widget as parameters.\u003c/p\u003e\n"]]],["The function `DrawingTools.onLayerConfig` registers a callback that triggers when a layer's name or color changes. This callback receives the modified `GeometryLayer` and the `ui.Map.DrawingTools` instance. The function returns a unique ID string, which can be used with `unlisten()` to remove the callback. This function allows user to be notified when a layer's configuration has changed.\n"],null,["# ui.Map.DrawingTools.onLayerConfig\n\n\u003cbr /\u003e\n\nRegisters a callback that's fired after a layer's name or color is changed.\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.onLayerConfig`(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 after a layer is configured. The callback is passed two parameters: the configured GeometryLayer and the ui.Map.DrawingTools widget that the event listener is bound to. |"]]