0

I am trying to write a function that when a region is clicked on the map, a dot will show and will highlight the region, and show a property in its FeatureCollection (UHIAdded). Here is my code:

lat.setValue('Lat: ' + coords.lat.toFixed(2));
lon.setValue('Lon: ' + coords.lon.toFixed(2));
Dayall.setValue('Annual daytime UHI: ' + ee.Number(UHIAdded.filterBounds(ee.Geometry.Point(coords.lon, coords.lat)).get('UHIday')));
print(UHIAdded.filterBounds(ee.Geometry.Point(coords.lon, coords.lat)).getArray('Area')); 

The result showed up as this:

Lat: 37.84
Lon: -120.81

Annual daytime UHI: ee.Number({ "type": "Invocation", "arguments": { "object": { "type": "Invocation", "arguments": { "collection": { "type": "Invocation", "arguments": { "collection": { "type": "Invocation", "arguments": { "collection": { "type": "Invocation", "arguments": { "tableId":......)

and the printed value is

Null

Why won't FeatureCollection.get work and how do I access the specific property/column

0

Without all of your code and a working example if will be difficult, but probably something like this:

Map.onClick(function(coords) {
    var point = ee.Geometry.Point(coords.lon, coords.lat);
    Map.addLayer(point)
})

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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