0

is there drawing functionality in the ui.Linker Map object of Earth Engine?

var linker = ui.Map.Linker(maps)

function display3 ()   {
    var map = new ui.Map();
    map.addLayer(toFeature);
    map.style().set('cursor', 'crosshair');
    map.centerObject(prorestaura_mg, 9)
    map.addLayer(select_2016,visPar432, 'Com nuvem - 2016');
    map.addLayer(select_2016.mask(select_2016.select('BQA').eq(2720)),visMosaic, 'Sem nuvem -2016',false);
    map.addLayer(prorestaura_mg.draw({color: 'F8E9CA', pointRadius: 5}), {},'PRO-RESTAURA/MG',false);
    map.add(ui.Label('DATA:26-08-2016', {position:'bottom-center', fontWeight: 'bold'}))
    map.ui.enableDrawing(false)
    return map}    } });

1 Answer 1

1

As far as I know you cannot include the drawing tools in a ui.Map instance. The only workaround I found is to get, at least, the only instance of the drawing map.

// Get Drawing Map
var root_widgets = ui.root.widgets()
var drawing_map = root_widgets.get(0)
drawing_map.add(ui.Label('Drawing Map'))

var second_map = ui.Map()
second_map.add(ui.Label('NOT Drawing Map'))

ui.Map.Linker([drawing_map, second_map])

ui.root.clear()
ui.root.add(second_map)
ui.root.add(drawing_map)

link: https://code.earthengine.google.com/e12c39b06be55a90ed0c7000803d42d1

5

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.