Skip to content

asyncSelect

fitoprincipe edited this page Jul 4, 2019 · 2 revisions

asyncSelect(options)

It's a drop down selector (ui.Select) that retrieves items asynchronously.

Options:

It inherit options from ui.Select, with the following by its own

  • setItems(items, value, trigger): set the items for the drop down. The parameter value replace the functionality of setValue if you want to do both things at once. If you just want to set the value of a drop down that already has values you can use setValue.
  • build(): this method returns the actual widget. For example:
var widgets = require('users/fitoprincipe/geetools:widgets')
var asyncsel = new widgets.asyncSelect({items:['a', 'b']})

// Can't do Map.add(asyncsel)
Map.add(asyncsel.build())

example: https://code.earthengine.google.com/0b49b5d56731f1ff2c465e21156e6d4d

Clone this wiki locally