I want to make split map on GEE, so i importing my image on asset in projects/ee-auliaputrisabita/assets/contohreclassgee. But if i want call the image asset function .select not going on. Here my code :
//Pembuatan Split Map Sisi Kiri
var leftMap = ui.Map();
leftMap.setControlVisibility(false);
var leftSelector = addLayerSelector(leftMap, 2, 'top-left');
//Pembuatan Split Map Sisi Kanan
var rightMap = ui.Map();
rightMap.setControlVisibility(false);
var rightSelector = addLayerSelector(rightMap, 1, 'top-right');
//Pengaturan Layer Peta Untuk Memilih Citra Yang Ingin Ditampilkan
function addLayerSelector(mapToChage, defaultValue, position)
{
var label = ui.Label('Pilih Tahun');
function updateMap(selection)
{
mapToChange.layers().set(0, ui.Map.Layer(images[selection]));
}
var image = ee.FeatureCollection("projects/ee-auliaputrisabita/assets/contohreclassgee");
//Konfigurasi Layer Terpilih
var select = ui.Select({items: Object.keys(image), onChange: updateMap});
select.setValue(Object.keys(image)[defaultValue], true);
var controlPanel = ui.Panel({widgets: [label, select], style: {position: position}});
mapToChange.add(controlPanel);
}
//Pembuatan Split Panel
var splitPanel = ui.SplitPanel({
firstPanel: leftMap,
secondPanel: rightMap,
wipe: true,
style: {stretch: 'both'}
});
//Meletakkan SplitPanel pada root UI
ui.root.widgets().reset([splitPanel]);
var linker = ui.Map.Linker([leftMap, rightMap]);
leftMap.centerObject(geometry, 9);
rightMap.centerObject(geometry, 9);