- Timestamp:
- Feb 7, 2021, 12:15:26 PM (6 years ago)
- Branches:
- debian/bullseye, master
- Children:
- 4c267d7
- Parents:
- 8f1d0b7
- Location:
- src/mapservice-webclient/src/app
- Files:
-
- 11 edited
-
map/map.component.ts (modified) (10 diffs)
-
mygnuboat/deviceadd.component.ts (modified) (1 diff)
-
mygnuboat/gaugeedit.component.ts (modified) (1 diff)
-
mygnuboat/logadd.component.ts (modified) (12 diffs)
-
mygnuboat/wateradd.component.html (modified) (1 diff)
-
mygnuboat/wateradd.component.ts (modified) (8 diffs)
-
services/osmoverpass.service.ts (modified) (1 diff)
-
water/gauges.component.ts (modified) (3 diffs)
-
water/water.component.html (modified) (1 diff)
-
water/water.component.ts (modified) (2 diffs)
-
water/waterdetails.component.ts (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/mapservice-webclient/src/app/map/map.component.ts
r8f1d0b7 r0db5db4 3 3 import { first } from 'rxjs/operators'; 4 4 5 declare let L ;5 declare let L: any; 6 6 7 7 import { environment } from '../../environments/environment'; … … 16 16 }) 17 17 export class MapComponent implements OnInit, OnDestroy, OnChanges { 18 p rivate _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; 24 24 public static logsWaterDepthPalette : { [index: number]: string; } = { 0: '#00008B', 2: '#1E90FF', 6: ' #ADD8E6', 10: '#F0F8FF'}; 25 25 @Input() water: Water = undefined; … … 27 27 @Input() controlsShow = true; 28 28 @Input() logsShow = true; 29 @ViewChild('mapElement', { static: true }) mapElement ;29 @ViewChild('mapElement', { static: true }) mapElement: any; 30 30 @Output() clickedRight = new EventEmitter<GeoPoint>(); 31 31 … … 51 51 } 52 52 53 ngAfterViewInit(){ 54 if(!this.map){ 55 this.mapSetup(); 56 } 57 } 58 53 59 getMap(){ 54 60 return this.map; … … 58 64 set viewportStyleClass(styleClass: string){ 59 65 this._mapViewportStyleClass = styleClass; 60 if(!this.map){61 this.mapSetup();62 }63 setTimeout(value => { this.map.invalidateSize()}, 500);64 66 } 65 67 … … 71 73 }); 72 74 73 this.map.on('contextmenu', event=> {75 this.map.on('contextmenu', (event: any) => { 74 76 var point = {} as GeoPoint; 75 77 point.latitude = event.latlng.lat; … … 201 203 this.logsLayer = this.addGeoJsonLayer({ 202 204 style: MapComponent.logsStyle, 203 pointToLayer: function(feature , latlng){205 pointToLayer: function(feature: any, latlng: any){ 204 206 return L.circleMarker(latlng, { radius: 1.5 }); 205 207 } … … 232 234 } 233 235 234 gaugesMarker(feature , latlng){236 gaugesMarker(feature: any, latlng: any){ 235 237 /** var markerOptions = { 236 238 radius: 8, … … 250 252 } 251 253 252 gaugesMarkerPopup(feature , layer) {254 gaugesMarkerPopup(feature: any, layer: any) { 253 255 if (feature.properties && feature.properties.name) { 254 256 layer.bindPopup(feature.properties.name); … … 256 258 } 257 259 258 public static logsStyle(feature ){260 public static logsStyle(feature: any){ 259 261 return { 'color': MapComponent.waterDepthToColor(feature.properties.waterDepth) }; 260 262 } -
src/mapservice-webclient/src/app/mygnuboat/deviceadd.component.ts
r8f1d0b7 r0db5db4 14 14 export class DeviceAddComponent implements OnInit { 15 15 public currentUser:User; 16 p rivatedevicesForm: FormGroup;16 public devicesForm: FormGroup; 17 17 private currentUserSubscription: Subscription; 18 18 -
src/mapservice-webclient/src/app/mygnuboat/gaugeedit.component.ts
r8f1d0b7 r0db5db4 69 69 }); 70 70 } 71 } l71 } 72 72 73 73 addGauge(){ -
src/mapservice-webclient/src/app/mygnuboat/logadd.component.ts
r8f1d0b7 r0db5db4 28 28 currentUser: User = undefined; 29 29 @Output() cancel = new EventEmitter(); 30 @ViewChild('logFileInput' , { static: true }) logFileInput;31 32 p rivateisProcessingWater = false;33 p rivateisProcessingDevice = false;34 p rivateisProcessingGauge = false;35 p rivateisUploading = 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; 37 37 private currentUserSubscription: Subscription; 38 38 private routeSubcription: Subscription; … … 97 97 minLength: 3, 98 98 source: [], 99 select: (event , ui) => { this.waterSelected(event, ui); }99 select: (event: Event, ui: any) => { this.waterSelected(event, ui); } 100 100 }); 101 101 jQuery('#logEditDevice').autocomplete({ 102 102 minLength: 3, 103 103 source: [], 104 select: (event , ui) => { this.deviceSelected(event, ui); }104 select: (event: Event, ui: any) => { this.deviceSelected(event, ui); } 105 105 }); 106 106 jQuery('#logEditGauge').autocomplete({ 107 107 minLength: (this.water) ? 0 : 3, 108 108 source: [], 109 select: (event , ui) => { this.gaugeSelected(event, ui); }109 select: (event: Event, ui: any) => { this.gaugeSelected(event, ui); } 110 110 }); 111 111 if(this.water){ 112 var gaugeCompletion = [];112 var gaugeCompletion: ItemCompletion[] = []; 113 113 var gauges = this.water.originalObject['gauges'] 114 114 for(var i = 0; i < gauges.length; i++){ … … 117 117 gauge.value = gauges[i].name; 118 118 gauge.label = gauges[i].name; 119 gaugeCompletion.push(gauge .id, gauge);119 gaugeCompletion.push(gauge); 120 120 } 121 121 this.setupGaugeCompletion(gaugeCompletion); … … 238 238 } 239 239 240 getWaters(waters ) {241 var waterCompletion = [];240 getWaters(waters: Water[]) { 241 var waterCompletion: ItemCompletion[] = []; 242 242 for(var i = 0; i < waters.length; i++){ 243 243 var water = {} as ItemCompletion; … … 246 246 water.label = waters[i].name; 247 247 water.originalObject = waters[i]; 248 waterCompletion.push(water .id, water);248 waterCompletion.push(water); 249 249 } 250 250 // set the elements to the autocompletion list … … 254 254 } 255 255 256 waterSelected(event , ui) {256 waterSelected(event: Event, ui: any) { 257 257 this.water = ui.item; 258 258 this.logForm.updateValueAndValidity() 259 var gaugeCompletion = [];259 var gaugeCompletion: ItemCompletion[] = []; 260 260 for(var i = 0; i < ui.item.originalObject.gauges.length; i++){ 261 261 var gauge = {} as ItemCompletion; … … 263 263 gauge.value = ui.item.originalObject.gauges[i].name; 264 264 gauge.label = ui.item.originalObject.gauges[i].name; 265 gaugeCompletion.push(gauge .id, gauge);265 gaugeCompletion.push(gauge); 266 266 } 267 267 jQuery('#logEditGauge').autocomplete("option", "minLength", 0); … … 270 270 } 271 271 272 getDevices(devices ) {273 var deviceCompletion = [];272 getDevices(devices: Device[]) { 273 var deviceCompletion: ItemCompletion[] = []; 274 274 for(var i = 0; i < devices.length; i++){ 275 275 var device = {} as ItemCompletion; … … 277 277 device.value = devices[i].name; 278 278 device.label = devices[i].name; 279 deviceCompletion.push(device .id, device);279 deviceCompletion.push(device); 280 280 } 281 281 // set the elements to the autocompletion list … … 285 285 } 286 286 287 deviceSelected(event , ui) {287 deviceSelected(event: Event, ui: any) { 288 288 this.device = ui.item; 289 289 this.updateFormValues(); 290 290 } 291 291 292 getGauges(gauges ) {293 var gaugeCompletion = [];292 getGauges(gauges: Gauge[]) { 293 var gaugeCompletion: ItemCompletion[] = []; 294 294 for(var i = 0; i < gauges.length; i++){ 295 295 var gauge = {} as ItemCompletion; … … 297 297 gauge.value = gauges[i].name; 298 298 gauge.label = gauges[i].name; 299 gaugeCompletion.push(gauge .id, gauge);299 gaugeCompletion.push(gauge); 300 300 } 301 301 this.setupGaugeCompletion(gaugeCompletion); … … 309 309 } 310 310 311 gaugeSelected(event , ui) {311 gaugeSelected(event: Event, ui: any) { 312 312 this.gauge = ui.item; 313 313 this.updateFormValues(); -
src/mapservice-webclient/src/app/mygnuboat/wateradd.component.html
r8f1d0b7 r0db5db4 12 12 <input #waterNameInput id="waterNameAutocomplete" formControlName='name' type="text" i18n-placeholder placeholder="Name of Water" required> 13 13 <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> 15 15 </div> 16 16 <div class="pure-controls"> -
src/mapservice-webclient/src/app/mygnuboat/wateradd.component.ts
r8f1d0b7 r0db5db4 7 7 8 8 declare var jQuery: any; 9 declare let L ;9 declare let L: any; 10 10 11 11 import { User, OsmType, Water, WaterCreation, WatersService } from '../../../src-gen/gnuboat-mapservice'; … … 34 34 mapViewportStyleClass:string = 'water-add-map'; 35 35 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; 38 38 public Origin = Origin; 39 public waterChoosen: WaterCompletion = undefined;40 public currentUser: User;39 public waterChoosen: WaterCompletion = undefined; 40 public currentUser: User = undefined; 41 41 public isProcessingGnuBoat = false; 42 42 public isProcessingOverpass = false; … … 45 45 private filteredWatersGnuBoat = new Map<number, WaterCompletion>(); 46 46 private filteredWatersOverpass = new Map<number, WaterCompletion>(); 47 private map ;48 p rivatemapLogoShow = false;49 p rivatemapLogsShow = false;50 private geoJsonLayer = undefined;51 p rivatewatersForm: FormGroup;47 private map: any = undefined; 48 public mapLogoShow = false; 49 public mapLogsShow = false; 50 private geoJsonLayer: any = undefined; 51 public watersForm: FormGroup; 52 52 private currentUserSubscription: Subscription; 53 53 … … 76 76 minLength: 3, 77 77 source: [], 78 select: (event , ui) => { this.waterSelected(event, ui); }78 select: (event: any, ui: any) => { this.waterSelected(event, ui); } 79 79 }); 80 80 … … 117 117 } 118 118 119 getGnuBoatWaters(waters ) {119 getGnuBoatWaters(waters: Water[]) { 120 120 this.filteredWatersGnuBoat.clear(); 121 121 for(var i = 0; i < waters.length; i++){ … … 132 132 } 133 133 134 getOverpassWaters(geojson ) {134 getOverpassWaters(geojson: any) { 135 135 this.filteredWatersOverpass.clear(); 136 136 if('features' in geojson){ 137 geojson.features.forEach( feature=> {137 geojson.features.forEach((feature: any) => { 138 138 var water = {} as WaterCompletion; 139 139 water.value = feature.properties.name; … … 160 160 161 161 buildAutoCompletor() { 162 var waterCompletion = [];162 var waterCompletion : WaterCompletion[] = []; 163 163 this.filteredWatersGnuBoat.forEach((value, key) => { 164 164 waterCompletion.push(value); … … 173 173 } 174 174 175 waterSelected(event , ui) {175 waterSelected(event: any, ui: any) { 176 176 this.waterChoosen = ui.item; 177 177 if(!ui.item.osmId || !ui.item.osmType){ -
src/mapservice-webclient/src/app/services/osmoverpass.service.ts
r8f1d0b7 r0db5db4 8 8 9 9 import { environment } from '../../environments/environment'; 10 import { AlertService } from './ ';10 import { AlertService } from './alert.service'; 11 11 import { OsmType, User } from '../../../src-gen/gnuboat-mapservice'; 12 12 -
src/mapservice-webclient/src/app/water/gauges.component.ts
r8f1d0b7 r0db5db4 3 3 import { first } from 'rxjs/operators'; 4 4 5 declare let L ;5 declare let L: any; 6 6 7 7 import { User, Water, Gauge, GaugeGeoJson, WatersService, GeoJsonPoint, GaugeGeoJsonProperties } from '../../../src-gen/gnuboat-mapservice'; … … 26 26 currentUser: User = undefined; 27 27 private currentUserSubscription: Subscription; 28 gaugesLayer = undefined;29 28 30 29 constructor(private watersService: WatersService, … … 47 46 } 48 47 49 decimalDegreesToDegreesMinutesSeconds(decimalDegrees , coordinate: Coordinate){48 decimalDegreesToDegreesMinutesSeconds(decimalDegrees: number, coordinate: Coordinate){ 50 49 var degrees = Math.trunc(decimalDegrees); 51 50 var minutes = Math.trunc((decimalDegrees - degrees) * 60); -
src/mapservice-webclient/src/app/water/water.component.html
r8f1d0b7 r0db5db4 1 1 <div class="water"> 2 2 <div class="water-background"> 3 <gnuboat-map #mapComponent [viewportStyleClass]='mapViewportStyleClass' [controlsShow]='mapControlsShow' [logsShow]='map logsShow' [logoShow]='mapLogoShow' [water]='water'></gnuboat-map>3 <gnuboat-map #mapComponent [viewportStyleClass]='mapViewportStyleClass' [controlsShow]='mapControlsShow' [logsShow]='mapLogsShow' [logoShow]='mapLogoShow' [water]='water'></gnuboat-map> 4 4 </div> 5 5 <div class="water-content"> -
src/mapservice-webclient/src/app/water/water.component.ts
r8f1d0b7 r0db5db4 3 3 import { first } from 'rxjs/operators'; 4 4 5 declare let L ;5 declare let L: any; 6 6 7 7 import { User, Water } from '../../../src-gen/gnuboat-mapservice'; … … 17 17 @Input() water: Water; 18 18 @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; 24 24 25 constructor(p rivatelogParameter: LogParameter) {25 constructor(public logParameter: LogParameter) { 26 26 } 27 27 -
src/mapservice-webclient/src/app/water/waterdetails.component.ts
r8f1d0b7 r0db5db4 22 22 gaugeEditing: GaugeCreation = undefined; 23 23 waterId: number = undefined; 24 interval ;24 interval: any; 25 25 26 26 private currentUserSubscription: Subscription;
Note:
See TracChangeset
for help on using the changeset viewer.
