Sfoglia il codice sorgente

💄 higlight the neccessity of zooming in

jmacura 3 anni fa
parent
commit
9494a5a730

+ 1 - 0
src/app/calculator/calculator.component.html

@@ -27,6 +27,7 @@
       <ng-template #noField>
         <div>
           <p class="p-1 text-info">{{ 'CALCULATOR.selectField' | translate}}</p>
+          <p class="p-1 text-warning" *ngIf="!lpisWfsVisible()"><i class="icon-warning-sign"></i>&nbsp;{{ 'CALCULATOR.zoomIn' | translate}}</p>
         </div>
       </ng-template>
       <div>

+ 4 - 0
src/app/calculator/calculator.component.ts

@@ -41,6 +41,10 @@ export class CalculatorComponent implements HsPanelComponent {
     return this.hsLayoutService.panelVisible('calculator');
   }
 
+  lpisWfsVisible(): boolean {
+    return this.calcService.lpisWfsVisible();
+  }
+
   noFieldSelected(): boolean {
     return this.fieldService.noFieldSelected();
   }

+ 19 - 1
src/app/calculator/calculator.service.ts

@@ -3,7 +3,13 @@ import {Injectable} from '@angular/core';
 import {Subject} from 'rxjs';
 import {catchError} from 'rxjs/operators';
 
-import {HsConfig, HsLanguageService, HsToastService} from 'hslayers-ng';
+import {
+  HsConfig,
+  HsEventBusService,
+  HsLanguageService,
+  HsMapService,
+  HsToastService,
+} from 'hslayers-ng';
 
 import {FieldService} from './field.service';
 import {ZonesService} from './zones.service';
@@ -31,7 +37,9 @@ export class CalculatorService {
   constructor(
     private fieldService: FieldService,
     private hsConfig: HsConfig,
+    private hsEventBus: HsEventBusService,
     private hsLanguageService: HsLanguageService,
+    private hsMapService: HsMapService,
     private hsToastService: HsToastService,
     private httpClient: HttpClient,
     private zonesService: ZonesService
@@ -46,6 +54,12 @@ export class CalculatorService {
       this.availableDates = undefined;
       this.selectedDate = undefined;
     });
+    this.hsEventBus.olMapLoads.subscribe((map) => {
+      console.log(map);
+    });
+    this.hsEventBus.mapExtentChanges.subscribe((obj) => {
+      console.log(obj);
+    })
   }
 
   noDates(): boolean {
@@ -156,6 +170,10 @@ export class CalculatorService {
     }
   }
 
+  lpisWfsVisible(): boolean {
+    return;
+  }
+
   /**
    * Updates WMS-t layer with the source image
    * @param date - ISO date

+ 6 - 4
src/app/translations.json

@@ -11,12 +11,13 @@
       "panelHeader": "Výpočet indexů pole",
       "selectBlur": "Chci vyhlazení",
       "selectDate": "Chci datum",
-      "selectField": "Pole vyberte kliknutím do mapy. Pro výběr pole je potřeba mapu přiblížit.",
+      "selectField": "Pole vyberte kliknutím do mapy.",
       "selectMore": "Více polí můžete vybrat podržením klávesy SHIFT",
       "selectedField": "Vybráno pole",
       "selectedFields": "Vybrána pole",
       "selectIndex": "Chci vypočítat index",
-      "selectQuantiles": "Chci {{quantileCount}} kvantilů"
+      "selectQuantiles": "Chci {{quantileCount}} kvantilů",
+      "zoomIn": "Pro výběr pole je potřeba mapu přiblížit."
     }
   },
   "en": {
@@ -31,12 +32,13 @@
       "panelHeader": "Field calculation",
       "selectBlur": "I want to blur by",
       "selectDate": "I want a date",
-      "selectField": "Select a field by clicking in the map. In order to select the field, you must zoom the map in.",
+      "selectField": "Select a field by clicking in the map.",
       "selectMore": "You can select more fields by press and holding the SHIFT key",
       "selectedField": "Selected field",
       "selectedFields": "Selected fields",
       "selectIndex": "I want to calculate index",
-      "selectQuantiles": "I want {{quantileCount}} quantiles"
+      "selectQuantiles": "I want {{quantileCount}} quantiles",
+      "zoomIn": "In order to select the field, you must zoom the map in."
     }
   }
 }