Changeset 0db5db4 for src


Ignore:
Timestamp:
Feb 7, 2021, 12:15:26 PM (6 years ago)
Author:
Joachim Langenbach <joachim.langenbach@…>
Branches:
debian/bullseye, master
Children:
4c267d7
Parents:
8f1d0b7
Message:

Fixed build errors with angular 11

Location:
src/mapservice-webclient/src/app
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • src/mapservice-webclient/src/app/map/map.component.ts

    r8f1d0b7 r0db5db4  
    33import { first } from 'rxjs/operators';
    44
    5 declare let L;
     5declare let L: any;
    66
    77import { environment } from '../../environments/environment';
    … …  
    1616})
    1717export class MapComponent implements OnInit, OnDestroy, OnChanges {
    18   private _mapViewportStyleClass:string;
    19   private map = undefined;
    20   private mapControl = undefined;
    21   private osmLayer = undefined;
    22   private gaugesLayer = undefined;
    23   private logsLayer = undefined;
     18  public _mapViewportStyleClass:string = "";
     19  private map: any = undefined;
     20  private mapControl: any = undefined;
     21  private osmLayer: any = undefined;
     22  private gaugesLayer: any = undefined;
     23  private logsLayer: any = undefined;
    2424  public static logsWaterDepthPalette : { [index: number]: string; } = { 0: '#00008B', 2: '#1E90FF', 6: ' #ADD8E6', 10: '#F0F8FF'};
    2525  @Input() water: Water = undefined;
    … …  
    2727  @Input() controlsShow = true;
    2828  @Input() logsShow = true;
    29   @ViewChild('mapElement', { static: true }) mapElement;
     29  @ViewChild('mapElement', { static: true }) mapElement: any;
    3030  @Output() clickedRight = new EventEmitter<GeoPoint>();
    3131
    … …  
    5151  }
    5252
     53  ngAfterViewInit(){
     54    if(!this.map){
     55      this.mapSetup();
     56    }
     57  }
     58
    5359  getMap(){
    5460    return this.map;
    … …  
    5864  set viewportStyleClass(styleClass: string){
    5965    this._mapViewportStyleClass = styleClass;
    60     if(!this.map){
    61       this.mapSetup();
    62     }
    63     setTimeout(value => { this.map.invalidateSize()}, 500);
    6466  }
    6567
    … …  
    7173    });
    7274
    73     this.map.on('contextmenu', event => {
     75    this.map.on('contextmenu', (event: any) => {
    7476      var point = {} as GeoPoint;
    7577      point.latitude = event.latlng.lat;
    … …  
    201203      this.logsLayer = this.addGeoJsonLayer({
    202204        style: MapComponent.logsStyle,
    203         pointToLayer: function(feature, latlng){
     205        pointToLayer: function(feature: any, latlng: any){
    204206          return L.circleMarker(latlng, { radius: 1.5 });
    205207        }
    … …  
    232234  }
    233235
    234   gaugesMarker(feature, latlng){
     236  gaugesMarker(feature: any, latlng: any){
    235237    /** var markerOptions = {
    236238      radius: 8,
    … …  
    250252  }
    251253
    252   gaugesMarkerPopup(feature, layer) {
     254  gaugesMarkerPopup(feature: any, layer: any) {
    253255    if (feature.properties && feature.properties.name) {
    254256        layer.bindPopup(feature.properties.name);
    … …  
    256258  }
    257259
    258   public static logsStyle(feature){
     260  public static logsStyle(feature: any){
    259261    return { 'color': MapComponent.waterDepthToColor(feature.properties.waterDepth) };
    260262  }
  • src/mapservice-webclient/src/app/mygnuboat/deviceadd.component.ts

    r8f1d0b7 r0db5db4  
    1414export class DeviceAddComponent implements OnInit {
    1515  public currentUser:User;
    16   private devicesForm: FormGroup;
     16  public devicesForm: FormGroup;
    1717  private currentUserSubscription: Subscription;
    1818
  • src/mapservice-webclient/src/app/mygnuboat/gaugeedit.component.ts

    r8f1d0b7 r0db5db4  
    6969      });
    7070    }
    71   }l
     71  }
    7272
    7373  addGauge(){
  • src/mapservice-webclient/src/app/mygnuboat/logadd.component.ts

    r8f1d0b7 r0db5db4  
    2828  currentUser: User = undefined;
    2929  @Output() cancel = new EventEmitter();
    30   @ViewChild('logFileInput', { static: true }) logFileInput;
    31 
    32   private isProcessingWater = false;
    33   private isProcessingDevice = false;
    34   private isProcessingGauge = false;
    35   private isUploading = false;
    36   logForm: FormGroup;
     30  @ViewChild('logFileInput') logFileInput: any;
     31
     32  public isProcessingWater = false;
     33  public isProcessingDevice = false;
     34  public isProcessingGauge = false;
     35  public isUploading = false;
     36  public logForm: FormGroup;
    3737  private currentUserSubscription: Subscription;
    3838  private routeSubcription: Subscription;
    … …  
    9797      minLength: 3,
    9898      source: [],
    99       select: (event, ui) => { this.waterSelected(event, ui); }
     99      select: (event: Event, ui: any) => { this.waterSelected(event, ui); }
    100100    });
    101101    jQuery('#logEditDevice').autocomplete({
    102102      minLength: 3,
    103103      source: [],
    104       select: (event, ui) => { this.deviceSelected(event, ui); }
     104      select: (event: Event, ui: any) => { this.deviceSelected(event, ui); }
    105105    });
    106106    jQuery('#logEditGauge').autocomplete({
    107107      minLength: (this.water) ? 0 : 3,
    108108      source: [],
    109       select: (event, ui) => { this.gaugeSelected(event, ui); }
     109      select: (event: Event, ui: any) => { this.gaugeSelected(event, ui); }
    110110    });
    111111    if(this.water){
    112       var gaugeCompletion = [];
     112      var gaugeCompletion: ItemCompletion[] = [];
    113113      var gauges = this.water.originalObject['gauges']
    114114      for(var i = 0; i < gauges.length; i++){
    … …  
    117117        gauge.value = gauges[i].name;
    118118        gauge.label = gauges[i].name;
    119         gaugeCompletion.push(gauge.id, gauge);
     119        gaugeCompletion.push(gauge);
    120120      }
    121121      this.setupGaugeCompletion(gaugeCompletion);
    … …  
    238238  }
    239239
    240   getWaters(waters) {
    241     var waterCompletion = [];
     240  getWaters(waters: Water[]) {
     241    var waterCompletion: ItemCompletion[] = [];
    242242    for(var i = 0; i < waters.length; i++){
    243243      var water = {} as ItemCompletion;
    … …  
    246246      water.label = waters[i].name;
    247247      water.originalObject = waters[i];
    248       waterCompletion.push(water.id, water);
     248      waterCompletion.push(water);
    249249    }
    250250    // set the elements to the autocompletion list
    … …  
    254254  }
    255255
    256   waterSelected(event, ui) {
     256  waterSelected(event: Event, ui: any) {
    257257    this.water = ui.item;
    258258    this.logForm.updateValueAndValidity()
    259     var gaugeCompletion = [];
     259    var gaugeCompletion: ItemCompletion[] = [];
    260260    for(var i = 0; i < ui.item.originalObject.gauges.length; i++){
    261261      var gauge = {} as ItemCompletion;
    … …  
    263263      gauge.value = ui.item.originalObject.gauges[i].name;
    264264      gauge.label = ui.item.originalObject.gauges[i].name;
    265       gaugeCompletion.push(gauge.id, gauge);
     265      gaugeCompletion.push(gauge);
    266266    }
    267267    jQuery('#logEditGauge').autocomplete("option", "minLength", 0);
    … …  
    270270  }
    271271
    272   getDevices(devices) {
    273     var deviceCompletion = [];
     272  getDevices(devices: Device[]) {
     273    var deviceCompletion: ItemCompletion[] = [];
    274274    for(var i = 0; i < devices.length; i++){
    275275      var device = {} as ItemCompletion;
    … …  
    277277      device.value = devices[i].name;
    278278      device.label = devices[i].name;
    279       deviceCompletion.push(device.id, device);
     279      deviceCompletion.push(device);
    280280    }
    281281    // set the elements to the autocompletion list
    … …  
    285285  }
    286286
    287   deviceSelected(event, ui) {
     287  deviceSelected(event: Event, ui: any) {
    288288    this.device = ui.item;
    289289    this.updateFormValues();
    290290  }
    291291
    292   getGauges(gauges) {
    293     var gaugeCompletion = [];
     292  getGauges(gauges: Gauge[]) {
     293    var gaugeCompletion: ItemCompletion[] = [];
    294294    for(var i = 0; i < gauges.length; i++){
    295295      var gauge = {} as ItemCompletion;
    … …  
    297297      gauge.value = gauges[i].name;
    298298      gauge.label = gauges[i].name;
    299       gaugeCompletion.push(gauge.id, gauge);
     299      gaugeCompletion.push(gauge);
    300300    }
    301301    this.setupGaugeCompletion(gaugeCompletion);
    … …  
    309309  }
    310310
    311   gaugeSelected(event, ui) {
     311  gaugeSelected(event: Event, ui: any) {
    312312    this.gauge = ui.item;
    313313    this.updateFormValues();
  • src/mapservice-webclient/src/app/mygnuboat/wateradd.component.html

    r8f1d0b7 r0db5db4  
    1212            <input #waterNameInput id="waterNameAutocomplete" formControlName='name' type="text" i18n-placeholder placeholder="Name of Water" required>
    1313            <img *ngIf="isProcessingGnuBoat || isProcessingOverpass" class="processing" src="/resources/processing.svg" />
    14             <span *ngIf="submitted && watersForm.name.errors" class="pure-form-message-inline" i18n="@@waterNameRequired">Watername is required.</span>
     14            <span *ngIf="watersForm.controls['name'].errors" class="pure-form-message-inline" i18n="@@waterNameRequired">Watername is required.</span>
    1515          </div>
    1616          <div class="pure-controls">
  • src/mapservice-webclient/src/app/mygnuboat/wateradd.component.ts

    r8f1d0b7 r0db5db4  
    77
    88declare var jQuery: any;
    9 declare let L;
     9declare let L: any;
    1010
    1111import { User, OsmType, Water, WaterCreation, WatersService } from '../../../src-gen/gnuboat-mapservice';
    … …  
    3434  mapViewportStyleClass:string = 'water-add-map';
    3535  mapControlsShow:boolean = false;
    36   @ViewChild('mapComponent', { static: true }) mapComponent: MapComponent;
    37   @ViewChild('waterNameInput', { static: true }) waterNameInput;
     36  @ViewChild('mapComponent') mapComponent: MapComponent;
     37  @ViewChild('waterNameInput') waterNameInput: any;
    3838  public Origin = Origin;
    39   public waterChoosen:WaterCompletion = undefined;
    40   public currentUser:User;
     39  public waterChoosen: WaterCompletion = undefined;
     40  public currentUser: User = undefined;
    4141  public isProcessingGnuBoat = false;
    4242  public isProcessingOverpass = false;
    … …  
    4545  private filteredWatersGnuBoat = new Map<number, WaterCompletion>();
    4646  private filteredWatersOverpass = new Map<number, WaterCompletion>();
    47   private map;
    48   private mapLogoShow = false;
    49   private mapLogsShow = false;
    50   private geoJsonLayer = undefined;
    51   private watersForm: FormGroup;
     47  private map: any = undefined;
     48  public mapLogoShow = false;
     49  public mapLogsShow = false;
     50  private geoJsonLayer: any = undefined;
     51  public watersForm: FormGroup;
    5252  private currentUserSubscription: Subscription;
    5353
    … …  
    7676      minLength: 3,
    7777      source: [],
    78       select: (event, ui) => { this.waterSelected(event, ui); }
     78      select: (event: any, ui: any) => { this.waterSelected(event, ui); }
    7979    });
    8080
    … …  
    117117  }
    118118
    119   getGnuBoatWaters(waters) {
     119  getGnuBoatWaters(waters: Water[]) {
    120120    this.filteredWatersGnuBoat.clear();
    121121    for(var i = 0; i < waters.length; i++){
    … …  
    132132  }
    133133
    134   getOverpassWaters(geojson) {
     134  getOverpassWaters(geojson: any) {
    135135    this.filteredWatersOverpass.clear();
    136136    if('features' in geojson){
    137       geojson.features.forEach(feature => {
     137      geojson.features.forEach((feature: any) => {
    138138        var water = {} as WaterCompletion;
    139139        water.value = feature.properties.name;
    … …  
    160160
    161161  buildAutoCompletor() {
    162     var waterCompletion = [];
     162    var waterCompletion : WaterCompletion[] = [];
    163163    this.filteredWatersGnuBoat.forEach((value, key) => {
    164164      waterCompletion.push(value);
    … …  
    173173  }
    174174
    175   waterSelected(event, ui) {
     175  waterSelected(event: any, ui: any) {
    176176    this.waterChoosen = ui.item;
    177177    if(!ui.item.osmId || !ui.item.osmType){
  • src/mapservice-webclient/src/app/services/osmoverpass.service.ts

    r8f1d0b7 r0db5db4  
    88
    99import { environment } from '../../environments/environment';
    10 import { AlertService } from './';
     10import { AlertService } from './alert.service';
    1111import { OsmType, User } from '../../../src-gen/gnuboat-mapservice';
    1212
  • src/mapservice-webclient/src/app/water/gauges.component.ts

    r8f1d0b7 r0db5db4  
    33import { first } from 'rxjs/operators';
    44
    5 declare let L;
     5declare let L: any;
    66
    77import { User, Water, Gauge, GaugeGeoJson, WatersService, GeoJsonPoint, GaugeGeoJsonProperties } from '../../../src-gen/gnuboat-mapservice';
    … …  
    2626  currentUser: User = undefined;
    2727  private currentUserSubscription: Subscription;
    28   gaugesLayer = undefined;
    2928
    3029  constructor(private watersService: WatersService,
    … …  
    4746  }
    4847
    49   decimalDegreesToDegreesMinutesSeconds(decimalDegrees, coordinate: Coordinate){
     48  decimalDegreesToDegreesMinutesSeconds(decimalDegrees: number, coordinate: Coordinate){
    5049    var degrees = Math.trunc(decimalDegrees);
    5150    var minutes = Math.trunc((decimalDegrees - degrees) * 60);
  • src/mapservice-webclient/src/app/water/water.component.html

    r8f1d0b7 r0db5db4  
    11<div class="water">
    22        <div class="water-background">
    3                 <gnuboat-map #mapComponent [viewportStyleClass]='mapViewportStyleClass' [controlsShow]='mapControlsShow' [logsShow]='maplogsShow' [logoShow]='mapLogoShow' [water]='water'></gnuboat-map>
     3                <gnuboat-map #mapComponent [viewportStyleClass]='mapViewportStyleClass' [controlsShow]='mapControlsShow' [logsShow]='mapLogsShow' [logoShow]='mapLogoShow' [water]='water'></gnuboat-map>
    44        </div>
    55        <div class="water-content">
  • src/mapservice-webclient/src/app/water/water.component.ts

    r8f1d0b7 r0db5db4  
    33import { first } from 'rxjs/operators';
    44
    5 declare let L;
     5declare let L: any;
    66
    77import { User, Water } from '../../../src-gen/gnuboat-mapservice';
    … …  
    1717  @Input() water: Water;
    1818  @Input() user: User;
    19   mapViewportStyleClass:string = "water-map";
    20   mapLogo = false;
    21   mapControlsShow = false;
    22   maplogsShow = false;
    23   @ViewChild('mapComponent', { static: true }) mapComponent: MapComponent;
     19  public mapViewportStyleClass:string = "water-map";
     20  public mapControlsShow = false;
     21  public mapLogsShow = false;
     22  public mapLogoShow = false;
     23  @ViewChild('mapComponent') mapComponent: MapComponent;
    2424
    25   constructor(private logParameter: LogParameter) {
     25  constructor(public logParameter: LogParameter) {
    2626  }
    2727
  • src/mapservice-webclient/src/app/water/waterdetails.component.ts

    r8f1d0b7 r0db5db4  
    2222  gaugeEditing: GaugeCreation = undefined;
    2323  waterId: number = undefined;
    24   interval;
     24  interval: any;
    2525
    2626  private currentUserSubscription: Subscription;
Note: See TracChangeset for help on using the changeset viewer.