I am a newbie in GEE and I am trying to build up an apparently simple widgets combination that allows to center the map around a point whose coordinates are entered by the users into text boxes. I have tried the following code:
var lon = ui.Textbox({
value: 1.0,
placeholder: 'Enter longitude here...',
onChange: function(value) {
return(value);
}
});
print(lon);
var lat = ui.Textbox({
value: 1.0,
placeholder: 'Enter latitude here...',
onChange: function(value) {
return(value);
}
});
print(lat);
var Lo = ee.Number.parse(lon);
var La = ee.Number.parse(lat);
var button = ui.Button({
label: 'Go to Location',
onClick: function() {
Map.setCenter(Lo,La,1);
}
});
print(button);
which returns the following error:
Provided center object has invalid values for lat, lon, or zoom. Expected numeric values.
I am afraid that either I am not able to convert the text into number, or I am making a mistake in the structures defining "lon" and "lat"