Skip to main content

@mapgear/geoapps > Analyses

Analyses class

Provides access to the analyses functionality of GeoApps. Can be accessed through the Map.Analyses-property.

Signature:
export declare class Analyses 

Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the Analyses class.

Example

An example of the usage:

// Connect as anonymous user to a geoapps environment
geoapps.Initialize("<specified tenant>");

// Add the map to a div with element id `map`
var map = geoapps.AddMap("map", "<mapId>");

// Wait till the map loaded, before starting the analyses
map.onLoaded.add(() => {
// Analyses
map.Analyses.onLoaded.add(function () {
console.log(map.Analyses.Items);
});

map.Analyses.onAnalysisLoaded.add(function () {
console.log(map.Analyses.Scenarios);
console.log(map.Analyses.Parameters);
});

map.Analyses.onAnalysisCompleted.add(function () {
console.log(map.Analyses.Results);
});

// Trigger on draw complete
map.Interactions.onSketchCompleted.add(function(e) {
map.Interactions.StopSketch();
map.Analyses.UpdateSelection({
type: "geometry",
geometry: e.Wkt,
})
});
});

Events

PropertyModifiersTypeDescription
onAnalysisCompletedreadonlyGAEvent<GAEventArgs>Triggers when an analyses has been computed
onAnalysisLoadedreadonlyGAEvent<GAEventArgs>Triggers when the details of an analyses has been loaded
onDownloadCompletedreadonlyGAEvent<GAEventArgs>Triggers when the analyses download has been completed
onLoadedreadonlyGAEvent<GAEventArgs>Triggers when the list of analyses is loaded

Properties

PropertyModifiersTypeDescription
ActiveAnalysisAnalysisThe currently active analysis
ActiveAnalysisLayersstring[]Layer id's of the layers in the active analysis
ActiveFeatureCountnumberNumber of features selected in the active analysis
AnalysisBusybooleanWhether analysis is busy calculating
ContainsAnalysesreadonlybooleanWhether the chosen thememap contains analyses
HasDownloadbooleanWhether analysis results can be downloaded
HasResultsbooleanWhether analysis has results
ItemsreadonlyAnalysis[]The current available analyses
ParametersreadonlyAnalysisParameterValue[]The current parameters for the specified analyses
ResultsreadonlyAnalysisResult[]The last computed results
ScenariosreadonlyAnalysisCompute[]The available scenarios for the current analysis
ShowValidationErrorbooleanWhether to show an error for incorrect user input
ValidatedInputbooleanWhether user input has been validated and is of the expected type

Methods

MethodModifiersDescription
DownloadPdf()Export analysis result to PDF
GetAnalysisById(analysisId)Retrieve the specific analysis by the specified id
StartAnalysis(analysisId, selectionOptions)Initialize the analysis and retrieve the available scenario's and parameters
UpdateParameters(parameters)Update the vaue of the parameters
UpdateSelection(options)Update the vaue of the parameters