showMessage('Loading',staticTemplates.loadingModal);
function runGeeViz(){
Map2.addSerializedLayer({"result": "0", "values": {"1": {"functionInvocationValue": {"functionName": "Image.constant", "arguments": {"value": {"constantValue": 1}}}}, "2": {"functionInvocationValue": {"functionName": "ImageCollection.mosaic", "arguments": {"collection": {"functionInvocationValue": {"functionName": "Collection.filter", "arguments": {"collection": {"functionInvocationValue": {"functionName": "ImageCollection.load", "arguments": {"id": {"constantValue": "projects/CCDC/USA_V2"}}}}, "filter": {"functionInvocationValue": {"functionName": "Filter.equals", "arguments": {"leftField": {"constantValue": "spectral"}, "rightValue": {"constantValue": "SR"}}}}}}}}}}, "3": {"functionInvocationValue": {"functionName": "Image.select", "arguments": {"bandSelectors": {"constantValue": ["NDVI.*"]}, "input": {"functionInvocationValue": {"functionName": "Image.select", "arguments": {"bandSelectors": {"constantValue": [".*_magnitude"]}, "input": {"valueReference": "2"}}}}}}}, "4": {"functionInvocationValue": {"functionName": "Image.constant", "arguments": {"value": {"constantValue": 0}}}}, "0": {"functionInvocationValue": {"functionName": "Image.updateMask", "arguments": {"image": {"functionInvocationValue": {"functionName": "Image.arrayFlatten", "arguments": {"coordinateLabels": {"constantValue": [["loss_year"]]}, "image": {"functionInvocationValue": {"functionName": "Image.arraySlice", "arguments": {"axis": {"constantValue": 0}, "end": {"valueReference": "1"}, "input": {"functionInvocationValue": {"functionName": "Image.arraySort", "arguments": {"image": {"functionInvocationValue": {"functionName": "Image.select", "arguments": {"bandSelectors": {"constantValue": ["tBreak"]}, "input": {"valueReference": "2"}}}}, "keys": {"valueReference": "3"}}}}, "start": {"valueReference": "4"}}}}}}}, "mask": {"functionInvocationValue": {"functionName": "Image.and", "arguments": {"image1": {"functionInvocationValue": {"functionName": "Image.lt", "arguments": {"image1": {"functionInvocationValue": {"functionName": "Image.arrayFlatten", "arguments": {"coordinateLabels": {"constantValue": [["loss_mag"]]}, "image": {"functionInvocationValue": {"functionName": "Image.arraySlice", "arguments": {"axis": {"constantValue": 0}, "end": {"valueReference": "1"}, "input": {"functionInvocationValue": {"functionName": "Image.arraySort", "arguments": {"image": {"valueReference": "3"}}}}, "start": {"valueReference": "4"}}}}}}}, "image2": {"valueReference": "4"}}}}, "image2": {"functionInvocationValue": {"functionName": "Image.arrayFlatten", "arguments": {"coordinateLabels": {"constantValue": [["loss_mask"]]}, "image": {"functionInvocationValue": {"functionName": "Image.arraySlice", "arguments": {"axis": {"constantValue": 0}, "end": {"valueReference": "1"}, "input": {"functionInvocationValue": {"functionName": "Image.arraySort", "arguments": {"image": {"functionInvocationValue": {"functionName": "Image.gte", "arguments": {"image1": {"functionInvocationValue": {"functionName": "Image.select", "arguments": {"bandSelectors": {"constantValue": ["changeProb"]}, "input": {"valueReference": "2"}}}}, "image2": {"valueReference": "1"}}}}, "keys": {"valueReference": "3"}}}}, "start": {"valueReference": "4"}}}}}}}}}}}}}}},{"min": 1984, "max": 2020, "palette": "ffffe5,fff7bc,fee391,fec44f,fe9929,ec7014,cc4c02"},'Loss Year',true);
Map2.addSerializedLayer({"result": "0", "values": {"2": {"functionInvocationValue": {"functionName": "Image.constant", "arguments": {"value": {"constantValue": 1}}}}, "4": {"functionInvocationValue": {"functionName": "ImageCollection.mosaic", "arguments": {"collection": {"functionInvocationValue": {"functionName": "Collection.filter", "arguments": {"collection": {"functionInvocationValue": {"functionName": "ImageCollection.load", "arguments": {"id": {"constantValue": "projects/CCDC/USA_V2"}}}}, "filter": {"functionInvocationValue": {"functionName": "Filter.equals", "arguments": {"leftField": {"constantValue": "spectral"}, "rightValue": {"constantValue": "SR"}}}}}}}}}}, "3": {"functionInvocationValue": {"functionName": "Image.select", "arguments": {"bandSelectors": {"constantValue": ["NDVI.*"]}, "input": {"functionInvocationValue": {"functionName": "Image.select", "arguments": {"bandSelectors": {"constantValue": [".*_magnitude"]}, "input": {"valueReference": "4"}}}}}}}, "5": {"functionInvocationValue": {"functionName": "Image.constant", "arguments": {"value": {"constantValue": 0}}}}, "1": {"functionInvocationValue": {"functionName": "Image.arrayFlatten", "arguments": {"coordinateLabels": {"constantValue": [["loss_mag"]]}, "image": {"functionInvocationValue": {"functionName": "Image.arraySlice", "arguments": {"axis": {"constantValue": 0}, "end": {"valueReference": "2"}, "input": {"functionInvocationValue": {"functionName": "Image.arraySort", "arguments": {"image": {"valueReference": "3"}}}}, "start": {"valueReference": "5"}}}}}}}, "0": {"functionInvocationValue": {"functionName": "Image.updateMask", "arguments": {"image": {"valueReference": "1"}, "mask": {"functionInvocationValue": {"functionName": "Image.and", "arguments": {"image1": {"functionInvocationValue": {"functionName": "Image.lt", "arguments": {"image1": {"valueReference": "1"}, "image2": {"valueReference": "5"}}}}, "image2": {"functionInvocationValue": {"functionName": "Image.arrayFlatten", "arguments": {"coordinateLabels": {"constantValue": [["loss_mask"]]}, "image": {"functionInvocationValue": {"functionName": "Image.arraySlice", "arguments": {"axis": {"constantValue": 0}, "end": {"valueReference": "2"}, "input": {"functionInvocationValue": {"functionName": "Image.arraySort", "arguments": {"image": {"functionInvocationValue": {"functionName": "Image.gte", "arguments": {"image1": {"functionInvocationValue": {"functionName": "Image.select", "arguments": {"bandSelectors": {"constantValue": ["changeProb"]}, "input": {"valueReference": "4"}}}}, "image2": {"valueReference": "2"}}}}, "keys": {"valueReference": "3"}}}}, "start": {"valueReference": "5"}}}}}}}}}}}}}}},{"min": -0.5, "max": -0.1, "palette": "F5DEB3,D00"},'Loss Mag',false);
Map2.addSerializedLayer({"result": "0", "values": {"1": {"functionInvocationValue": {"functionName": "ImageCollection.mosaic", "arguments": {"collection": {"functionInvocationValue": {"functionName": "Collection.filter", "arguments": {"collection": {"functionInvocationValue": {"functionName": "ImageCollection.load", "arguments": {"id": {"constantValue": "projects/CCDC/USA_V2"}}}}, "filter": {"functionInvocationValue": {"functionName": "Filter.equals", "arguments": {"leftField": {"constantValue": "spectral"}, "rightValue": {"constantValue": "SR"}}}}}}}}}}, "2": {"functionInvocationValue": {"functionName": "Image.select", "arguments": {"bandSelectors": {"constantValue": ["NDVI.*"]}, "input": {"functionInvocationValue": {"functionName": "Image.select", "arguments": {"bandSelectors": {"constantValue": [".*_magnitude"]}, "input": {"valueReference": "1"}}}}}}}, "3": {"functionInvocationValue": {"functionName": "Image.constant", "arguments": {"value": {"constantValue": -1}}}}, "0": {"functionInvocationValue": {"functionName": "Image.updateMask", "arguments": {"image": {"functionInvocationValue": {"functionName": "Image.arrayFlatten", "arguments": {"coordinateLabels": {"constantValue": [["gain_year"]]}, "image": {"functionInvocationValue": {"functionName": "Image.arraySlice", "arguments": {"axis": {"constantValue": 0}, "input": {"functionInvocationValue": {"functionName": "Image.arraySort", "arguments": {"image": {"functionInvocationValue": {"functionName": "Image.select", "arguments": {"bandSelectors": {"constantValue": ["tBreak"]}, "input": {"valueReference": "1"}}}}, "keys": {"valueReference": "2"}}}}, "start": {"valueReference": "3"}}}}}}}, "mask": {"functionInvocationValue": {"functionName": "Image.and", "arguments": {"image1": {"functionInvocationValue": {"functionName": "Image.gt", "arguments": {"image1": {"functionInvocationValue": {"functionName": "Image.arrayFlatten", "arguments": {"coordinateLabels": {"constantValue": [["gain_mag"]]}, "image": {"functionInvocationValue": {"functionName": "Image.arraySlice", "arguments": {"axis": {"constantValue": 0}, "input": {"functionInvocationValue": {"functionName": "Image.arraySort", "arguments": {"image": {"valueReference": "2"}}}}, "start": {"valueReference": "3"}}}}}}}, "image2": {"functionInvocationValue": {"functionName": "Image.constant", "arguments": {"value": {"constantValue": 0}}}}}}}, "image2": {"functionInvocationValue": {"functionName": "Image.arrayFlatten", "arguments": {"coordinateLabels": {"constantValue": [["gain_mask"]]}, "image": {"functionInvocationValue": {"functionName": "Image.arraySlice", "arguments": {"axis": {"constantValue": 0}, "input": {"functionInvocationValue": {"functionName": "Image.arraySort", "arguments": {"image": {"functionInvocationValue": {"functionName": "Image.gte", "arguments": {"image1": {"functionInvocationValue": {"functionName": "Image.select", "arguments": {"bandSelectors": {"constantValue": ["changeProb"]}, "input": {"valueReference": "1"}}}}, "image2": {"functionInvocationValue": {"functionName": "Image.constant", "arguments": {"value": {"constantValue": 1}}}}}}}, "keys": {"valueReference": "2"}}}}, "start": {"valueReference": "3"}}}}}}}}}}}}}}},{"min": 1984, "max": 2020, "palette": "c5ee93,00a398"},'Gain Year',true);
Map2.addSerializedLayer({"result": "0", "values": {"3": {"functionInvocationValue": {"functionName": "ImageCollection.mosaic", "arguments": {"collection": {"functionInvocationValue": {"functionName": "Collection.filter", "arguments": {"collection": {"functionInvocationValue": {"functionName": "ImageCollection.load", "arguments": {"id": {"constantValue": "projects/CCDC/USA_V2"}}}}, "filter": {"functionInvocationValue": {"functionName": "Filter.equals", "arguments": {"leftField": {"constantValue": "spectral"}, "rightValue": {"constantValue": "SR"}}}}}}}}}}, "2": {"functionInvocationValue": {"functionName": "Image.select", "arguments": {"bandSelectors": {"constantValue": ["NDVI.*"]}, "input": {"functionInvocationValue": {"functionName": "Image.select", "arguments": {"bandSelectors": {"constantValue": [".*_magnitude"]}, "input": {"valueReference": "3"}}}}}}}, "4": {"functionInvocationValue": {"functionName": "Image.constant", "arguments": {"value": {"constantValue": -1}}}}, "1": {"functionInvocationValue": {"functionName": "Image.arrayFlatten", "arguments": {"coordinateLabels": {"constantValue": [["gain_mag"]]}, "image": {"functionInvocationValue": {"functionName": "Image.arraySlice", "arguments": {"axis": {"constantValue": 0}, "input": {"functionInvocationValue": {"functionName": "Image.arraySort", "arguments": {"image": {"valueReference": "2"}}}}, "start": {"valueReference": "4"}}}}}}}, "0": {"functionInvocationValue": {"functionName": "Image.updateMask", "arguments": {"image": {"valueReference": "1"}, "mask": {"functionInvocationValue": {"functionName": "Image.and", "arguments": {"image1": {"functionInvocationValue": {"functionName": "Image.gt", "arguments": {"image1": {"valueReference": "1"}, "image2": {"functionInvocationValue": {"functionName": "Image.constant", "arguments": {"value": {"constantValue": 0}}}}}}}, "image2": {"functionInvocationValue": {"functionName": "Image.arrayFlatten", "arguments": {"coordinateLabels": {"constantValue": [["gain_mask"]]}, "image": {"functionInvocationValue": {"functionName": "Image.arraySlice", "arguments": {"axis": {"constantValue": 0}, "input": {"functionInvocationValue": {"functionName": "Image.arraySort", "arguments": {"image": {"functionInvocationValue": {"functionName": "Image.gte", "arguments": {"image1": {"functionInvocationValue": {"functionName": "Image.select", "arguments": {"bandSelectors": {"constantValue": ["changeProb"]}, "input": {"valueReference": "3"}}}}, "image2": {"functionInvocationValue": {"functionName": "Image.constant", "arguments": {"value": {"constantValue": 1}}}}}}}, "keys": {"valueReference": "2"}}}}, "start": {"valueReference": "4"}}}}}}}}}}}}}}},{"min": 0.05, "max": 0.2, "palette": "F5DEB3,006400"},'Gain Mag',false);
setTimeout(function(){$('#close-modal-button').click();}, 2500);
$('#query-label').click();
}