Skip to content

Commit

Permalink
keep spatial filter if same spatial unit remains
Browse files Browse the repository at this point in the history
  • Loading branch information
cDanowski committed Apr 24, 2023
1 parent 129a45a commit e8ceb36
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,8 @@ angular

$scope.onChangeSelectedIndicator = async function(recenterMap){

$rootScope.$broadcast("onChangeSelectedIndicator");

if(kommonitorDataExchangeService.selectedIndicator){

$scope.loadingData = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ angular
$scope.selectedSpatialUnitForFilter;
$scope.higherSpatialUnits = undefined;
$scope.higherSpatialUnitFilterFeatureGeoJSON;
$scope.reappliedFilter = false;

$scope.selectionByFeatureSpatialFilterDuallistOptions = {
title: {label: 'Gebiete', helpMessage: 'help'},
Expand Down Expand Up @@ -77,8 +78,24 @@ angular

$scope.inputNotValid = false;

$scope.$on("replaceIndicatorAsGeoJSON", function (event, indicatorMetadataAndGeoJSON, spatialUnitName, date, justRestyling, isCustomComputation) {
$scope.$on("onChangeSelectedIndicator", function(event){
$scope.reappliedFilter = false;
});

$scope.$on("indicatortMapDisplayFinished", function(){
// trigger the continous display of current filter
if(! $scope.reappliedFilter){
$scope.reappliedFilter = true;
if ($scope.showSelectionByFeatureSpatialFilter){
$scope.onSelectionByFeatureSpatialFilterSelectBtnPressed();
}
if ($scope.showManualSelectionSpatialFilter){
$scope.onManualSelectionBySelectedMapFeaturesBtnPressed();
}
}
});

$scope.$on("replaceIndicatorAsGeoJSON", function (event, indicatorMetadataAndGeoJSON, spatialUnitName, date, justRestyling, isCustomComputation) {

$scope.setupSpatialUnitFilter(indicatorMetadataAndGeoJSON, spatialUnitName, date);

Expand All @@ -89,7 +106,9 @@ angular
$scope.previouslySelectedSpatialUnit = kommonitorDataExchangeService.selectedSpatialUnit;
}

if($scope.previouslySelectedIndicator.indicatorId != indicatorMetadataAndGeoJSON.indicatorId || $scope.previouslySelectedSpatialUnit.spatialUnitLevel != spatialUnitName){
// if($scope.previouslySelectedIndicator.indicatorId != indicatorMetadataAndGeoJSON.indicatorId || $scope.previouslySelectedSpatialUnit.spatialUnitLevel != spatialUnitName){
if($scope.previouslySelectedSpatialUnit.spatialUnitLevel != spatialUnitName){
// reset filter component
if ($scope.showSelectionByFeatureSpatialFilter)
$scope.updateSelectableAreas("byFeature");
kommonitorFilterHelperService.clearFilteredFeatures();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3069,7 +3069,8 @@ angular.module('kommonitorMap').component(
$scope.showOutlierInfoAlert = true;
}

$rootScope.$broadcast("updateDiagrams", $scope.currentIndicatorMetadataAndGeoJSON, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitId, date, $scope.defaultBrew, $scope.gtMeasureOfValueBrew, $scope.ltMeasureOfValueBrew, $scope.dynamicIncreaseBrew, $scope.dynamicDecreaseBrew, kommonitorDataExchangeService.isMeasureOfValueChecked, kommonitorDataExchangeService.measureOfValue, justRestyling);
$rootScope.$broadcast("updateDiagrams", $scope.currentIndicatorMetadataAndGeoJSON, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitLevel, kommonitorDataExchangeService.selectedSpatialUnit.spatialUnitId, date, $scope.defaultBrew, $scope.gtMeasureOfValueBrew, $scope.ltMeasureOfValueBrew, $scope.dynamicIncreaseBrew, $scope.dynamicDecreaseBrew, kommonitorDataExchangeService.isMeasureOfValueChecked, kommonitorDataExchangeService.measureOfValue, justRestyling);
$rootScope.$broadcast("indicatortMapDisplayFinished");

$scope.map.invalidateSize(true);
});
Expand Down

0 comments on commit e8ceb36

Please sign in to comment.