ui.Checkbox.style

ウィジェットのスタイル ActiveDictionary を返します。この値を変更して、ウィジェットのスタイルを更新できます。

CSS のプロパティと同様に動作するプロパティ:

  - height、maxHeight、minHeight(例: '100px')

  - width、maxWidth、minWidth(例: '100px')

  - パディング、マージン(例: '4px 4px 4px 4px' または単に '4px')

  - color、backgroundColor(例:「red」または「#FF0000」)

  - 枠線(例: '1px solid black')

  - borderColor(例: 'red black blue #FF0000')

  - borderRadius(例: '10px')

  - borderStyle(例: 'solid dashed none dotted')

  - borderWidth(例: '1px 0px 1px 0px')

  - fontSize(例: '24px')

  - fontStyle(例: 太字)

  - fontWeight(例: 太字、100)

  - fontFamily(例: monospace、serif)

  - textAlign(例: 'left'、'center')

  - textDecoration(例: underline、line-through)

  - whiteSpace(例: nowrap、pre)

  - 表示(true または false)

サポートされているカスタム レイアウト プロパティ(ui.Panel.Layout のドキュメントを参照):

  - ストレッチ(「horizontal」、「vertical」、「both」)

  - position('top-right'、'top-center'、'top-left'、'bottom-right'、...)

用途戻り値
Checkbox.style()ui.data.ActiveDictionary
引数タイプ詳細
this: ui.widgetui.Widgetui.Widget インスタンス。

コードエディタ(JavaScript)

// Define a UI widget and add it to the map.
var widget = ui.Checkbox({label: 'A ui.Checkbox', style: {width: '400px'}});
Map.add(widget);

// View the UI widget's style properties; an ActiveDictionary.
print(widget.style());

// ActiveDictionaries are mutable; set a style property.
widget.style().set('color', 'blue');
print(widget.style());

// Define the UI widget's style ActiveDictionary as a variable.
var widgetStyle = widget.style();
print(widgetStyle);

// Set the UI widget's style properties from the ActiveDictionary variable.
widgetStyle.set({border: '5px solid darkgray'});
print(widgetStyle);