I am trying to recreate this ui.Select
function with data from an imported FeatureCollection
.
In the original example the ui.Select
function uses a dictionary that looks like this:
var places = {
MTV: [-122.0849, 37.3887],
PEK: [116.4056, 39.9097],
ZRH: [8.536, 47.376]
};
So I would like to recreate with my own FeatureCollection. My attempt at code for creating the dictionary.
function get_coords(f){return f.centroid()}
var urban_areas = ee.Dictionary.fromLists(boroughs.aggregate_array('lad17nm'),
ee.List(boroughs.map(get_coords)));
print (urban_areas)
My code is here.