diff --git a/projects/common-map/src/fm-map/components/item-list-item-bofek/item-list-item-bofek.component.css b/projects/common-map/src/fm-map/components/item-list-item-bofek/item-list-item-bofek.component.css deleted file mode 100644 index 691958b..0000000 --- a/projects/common-map/src/fm-map/components/item-list-item-bofek/item-list-item-bofek.component.css +++ /dev/null @@ -1,24 +0,0 @@ -.head { - color: grey; - font-weight: bold; - /*border-bottom:1px solid black;*/ -} - -.body { - display: block; -} - -.widget { - display: block; - height: 100%; - width: 100%; -} - -.unit { - font-size: 0.8rem; - color: gray; -} - -.dateformat { - font-size: 0.8rem; -} diff --git a/projects/common-map/src/fm-map/components/item-list-item-bofek/item-list-item-bofek.component.html b/projects/common-map/src/fm-map/components/item-list-item-bofek/item-list-item-bofek.component.html deleted file mode 100644 index d33d712..0000000 --- a/projects/common-map/src/fm-map/components/item-list-item-bofek/item-list-item-bofek.component.html +++ /dev/null @@ -1,14 +0,0 @@ -
-
-
Bofek Bodem {{ feature?.bodem }}
-
- Periode:{{ feature?.periode }} - dmgdry/dmgwet:{{ feature?.dmgdry | number:'0.1-2'}}/{{ feature?.dmgwet | number:'0.1-2'}} - dmgind:{{ feature?.dmgind | number:'0.1-2'}} - gewas:{{ feature?.gewas}} - glg/ghg:{{ feature?.glg}}/{{ feature?.ghg}} - station:{{ feature?.station}} - hrvpotbio:{{ feature?.hrvpotbio}} -
-
-
diff --git a/projects/common-map/src/fm-map/components/item-list-item-bofek/item-list-item-bofek.component.ts b/projects/common-map/src/fm-map/components/item-list-item-bofek/item-list-item-bofek.component.ts deleted file mode 100644 index 71cfea4..0000000 --- a/projects/common-map/src/fm-map/components/item-list-item-bofek/item-list-item-bofek.component.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { Component, OnInit, Injectable } from '@angular/core'; -import { Input } from '@angular/core'; -import { Store } from '@ngrx/store'; -import * as mapReducers from '../../reducers/map.reducer'; -import { commonReducers, ItemTypeService, ItemService, IListItem } from '@farmmaps/common'; -import { AbstractItemListItemComponent } from '../item-list-item/item-list-item.component' -import { ForItemType } from '../for-item/for-itemtype.decorator'; -import { ForSourceTask } from '../for-item/for-sourcetask.decorator'; - -@ForItemType("vnd.farmmaps.itemtype.shape.processed") -@ForSourceTask("vnd.farmmaps.task.bofek") -@Injectable() -@Component({ - selector: 'fm-map-item-list-item-bofek', - templateUrl: './item-list-item-bofek.component.html', - styleUrls: ['./item-list-item-bofek.component.css'] -}) -export class ItemListItemBofekComponent extends AbstractItemListItemComponent implements OnInit { - @Input() item: IListItem; - feature; - - constructor(store: Store, itemTypeService: ItemTypeService, private itemService$: ItemService) { - super(store, itemTypeService); - } - ngOnInit() { - this.itemService$.getItem(this.item.code).subscribe(i => { - this.itemService$.getChildItemList(i.parentCode, "vnd.farmmaps.itemtype.trijntje").subscribe(t => { - if (t.length > 0) { - var data = t[0].data; - var bofekId = data["wwl-yieldloss-data"]["feature-with-largest-area"]; - var features = data["wwl-yieldloss-data"]["features"]; - for (var i = 0; i < features.length; i++) { - if (features[i]["bodem"] == bofekId) { - this.feature = features[i]; - return; - } - } - }; - }) - }) - }; -} diff --git a/projects/common-map/src/fm-map/components/item-list-item-height/item-list-item-height.component.css b/projects/common-map/src/fm-map/components/item-list-item-height/item-list-item-height.component.css deleted file mode 100644 index 629e747..0000000 --- a/projects/common-map/src/fm-map/components/item-list-item-height/item-list-item-height.component.css +++ /dev/null @@ -1,40 +0,0 @@ -.head { - color: grey; - font-weight: bold; - /*border-bottom:1px solid black;*/ -} - -.body { - display: block; -} - -.mean { - text-align: center; - font-weight: bold; - font-size: 2rem; - line-height: 7.5rem; - color: deeppink; - /*border-right:1px solid black;*/ -} - -.min { - /*border-bottom:1px solid black;*/ -} - -.min, .max { - vertical-align: middle; - line-height: 3.48rem; - color: gray; - font-size: 1rem; -} - -.widget { - display: block; - height: 100%; - width: 100%; -} - -.unit { - font-size: 0.6rem; - color: gray; -} diff --git a/projects/common-map/src/fm-map/components/item-list-item-height/item-list-item-height.component.html b/projects/common-map/src/fm-map/components/item-list-item-height/item-list-item-height.component.html deleted file mode 100644 index e98e6fb..0000000 --- a/projects/common-map/src/fm-map/components/item-list-item-height/item-list-item-height.component.html +++ /dev/null @@ -1,32 +0,0 @@ -
- -
-
-
-
Height
-
-
-
{{histogram.mean | number:'0.1-2'}}
-
- -
{{(histogram.max+histogram.min)/2 | number:'0.1-2'}}
-
-
-
{{histogram.min | number:'0.1-2'}}
-
{{histogram.max | number:'0.1-2'}}
-
-
-
-
-
-
- -
-
-
Height
-
-
No data available
-
-
-
-
diff --git a/projects/common-map/src/fm-map/components/item-list-item-height/item-list-item-height.component.ts b/projects/common-map/src/fm-map/components/item-list-item-height/item-list-item-height.component.ts deleted file mode 100644 index e2e89d4..0000000 --- a/projects/common-map/src/fm-map/components/item-list-item-height/item-list-item-height.component.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { Input, Injectable } from '@angular/core'; -import { Store } from '@ngrx/store'; -import * as mapReducers from '../../reducers/map.reducer'; -import { commonReducers, ItemTypeService, IItem, Item, ItemService, FolderService, IListItem } from '@farmmaps/common'; -import { ForItemType } from '../for-item/for-itemtype.decorator'; -import { ForSourceTask } from '../for-item/for-sourcetask.decorator'; -import { AbstractItemListItemComponent } from '../item-list-item/item-list-item.component' -import { withLatestFrom, switchMap, map, switchMapTo, catchError, mergeMap, delay } from 'rxjs/operators'; -import { Observable, of } from 'rxjs'; -import { ControlScaleLineComponent } from 'ngx-openlayers'; - - -@ForItemType("vnd.farmmaps.itemtype.geotiff.processed") -@ForSourceTask("vnd.farmmaps.task.ahn") -@Injectable() -@Component({ - selector: 'fm-map-item-list-item-height', - templateUrl: './item-list-item-height.component.html', - styleUrls: ['./item-list-item-height.component.css'] -}) -export class ItemListItemHeightComponent extends AbstractItemListItemComponent implements OnInit { - @Input() item: IListItem; - selectedItem: Observable; - - constructor(store: Store, itemTypeService: ItemTypeService, private itemService$: ItemService) { - super(store, itemTypeService); - } - ngOnInit() { - this.selectedItem = this.itemService$.getItem(this.item.code); - } -} diff --git a/projects/common-map/src/fm-map/components/item-list-item-shadow/item-list-item-shadow.component.html b/projects/common-map/src/fm-map/components/item-list-item-shadow/item-list-item-shadow.component.html deleted file mode 100644 index 0cf4ce9..0000000 --- a/projects/common-map/src/fm-map/components/item-list-item-shadow/item-list-item-shadow.component.html +++ /dev/null @@ -1,40 +0,0 @@ -
-
-
- Shadow index -
-
- - - - - - - - - - - - -
{{getMeanShadowValue(selectedItem) | number:'0.2-2'}}
-
-
-
diff --git a/projects/common-map/src/fm-map/components/item-list-item-shadow/item-list-item-shadow.component.scss b/projects/common-map/src/fm-map/components/item-list-item-shadow/item-list-item-shadow.component.scss deleted file mode 100644 index 718c4e2..0000000 --- a/projects/common-map/src/fm-map/components/item-list-item-shadow/item-list-item-shadow.component.scss +++ /dev/null @@ -1,17 +0,0 @@ -.head { - color: grey; - font-weight: bold; -} - -.mean { - text-align: center; - font-weight: bold; - font-size: 1.9rem; - color: deeppink; -} - -.widget { - display: block; - height: 100%; - width: 100%; -} diff --git a/projects/common-map/src/fm-map/components/item-list-item-shadow/item-list-item-shadow.component.ts b/projects/common-map/src/fm-map/components/item-list-item-shadow/item-list-item-shadow.component.ts deleted file mode 100644 index f3fb334..0000000 --- a/projects/common-map/src/fm-map/components/item-list-item-shadow/item-list-item-shadow.component.ts +++ /dev/null @@ -1,65 +0,0 @@ -import {Observable} from 'rxjs'; -import {Component, Injectable, Input, OnInit} from '@angular/core'; -import {Store} from '@ngrx/store'; -import * as mapReducers from '../../reducers/map.reducer'; -import {commonReducers, IItem, IListItem, ItemService, ItemTypeService} from '@farmmaps/common'; -import {ForItemType} from '../for-item/for-itemtype.decorator'; -import {ForSourceTask} from '../for-item/for-sourcetask.decorator'; -import {AbstractItemListItemComponent} from '../item-list-item/item-list-item.component' -import {map} from "rxjs/operators"; - -@ForItemType("vnd.farmmaps.itemtype.geotiff.processed") -@ForSourceTask("vnd.farmmaps.task.shadow") -@Injectable() -@Component({ - selector: 'fm-map-item-list-item-shadow', - templateUrl: './item-list-item-shadow.component.html', - styleUrls: ['./item-list-item-shadow.component.scss'] -}) -export class ItemListItemShadowComponent extends AbstractItemListItemComponent implements OnInit { - @Input() item: IListItem; - selectedItem: Observable; - - public sunCenter = {x: 235.9, y: 259.4}; - public sunStart = {x: 0, y: 0}; - public sunEndRelative = {x: 0, y: 0}; - public largeArc = 0; - public radius = 120; - - public sunColor = '#ffcc00'; - - constructor(store: Store, itemTypeService: ItemTypeService, - private itemService$: ItemService) { - super(store, itemTypeService); - } - - ngOnInit() { - this.selectedItem = this.itemService$.getItem(this.item.code) - .pipe(map(item => { - const shadowIndex = this.getMeanShadowValue(item); - this.calculateSunValues(shadowIndex); - return item; - })); - } - - calculateSunValues(shadowIndex) { - const dotProduct = shadowIndex * 2 - 1; - this.largeArc = dotProduct > 0 ? 1 : 0; - - const angle = Math.acos(dotProduct); - const yRadius = this.radius * Math.sin(-angle); - - this.sunStart.x = this.sunCenter.x + this.radius * dotProduct; - this.sunStart.y = this.sunCenter.y + yRadius; - this.sunEndRelative.x = this.sunStart.x; - this.sunEndRelative.y = this.sunCenter.y - yRadius; - } - - getSunShadowPath() { - return `M${this.sunStart.x} ${this.sunStart.y} A${this.radius},${this.radius} 0 ${this.largeArc},0 ${this.sunEndRelative.x} ${this.sunEndRelative.y}z`; - } - - getMeanShadowValue(item): number { - return item.data.layers[0].renderer.band.histogram.mean; - } -} diff --git a/projects/common-map/src/fm-map/components/item-list-item-temporal/item-list-item-temporal.component.css b/projects/common-map/src/fm-map/components/item-list-item-temporal/item-list-item-temporal.component.css deleted file mode 100644 index 6c43ffd..0000000 --- a/projects/common-map/src/fm-map/components/item-list-item-temporal/item-list-item-temporal.component.css +++ /dev/null @@ -1,42 +0,0 @@ -.head { - color: grey; - font-weight:bold; - /*border-bottom:1px solid black;*/ -} - -.body { - display: block; -} - -.mean { - text-align: center; - font-weight: bold; - font-size:2rem; - line-height: 7.5rem; - color:deeppink; - /*border-right:1px solid black;*/ -} -.min { - /*border-bottom:1px solid black;*/ -} -.min, .max { - vertical-align: middle; - line-height: 3.48rem; - color:gray; - font-size:1rem; -} - -.widget { - display: block; - height: 100%; - width: 100%; -} - -.unit { - font-size:0.8rem; - color:gray; -} - -.dateformat { - font-size: 0.8rem; -} diff --git a/projects/common-map/src/fm-map/components/item-list-item-temporal/item-list-item-temporal.component.html b/projects/common-map/src/fm-map/components/item-list-item-temporal/item-list-item-temporal.component.html deleted file mode 100644 index 6ca09f2..0000000 --- a/projects/common-map/src/fm-map/components/item-list-item-temporal/item-list-item-temporal.component.html +++ /dev/null @@ -1,22 +0,0 @@ -
-
-
-
-
Soil moisture (%)
-
{{lastChildItem.dataDate | date : 'shortDate'}}
-
-
-
{{histogram.mean/10 | number:'0.1-2'}}
-
- -
{{(histogram.max+histogram.min)/2 | number:'0.1-2'}}
-
-
-
{{histogram.min/10 | number:'0.1-2'}}
-
{{histogram.max/10 | number:'0.1-2'}}
-
-
-
-
-
-
diff --git a/projects/common-map/src/fm-map/components/item-list-item-temporal/item-list-item-temporal.component.ts b/projects/common-map/src/fm-map/components/item-list-item-temporal/item-list-item-temporal.component.ts deleted file mode 100644 index e7ddf86..0000000 --- a/projects/common-map/src/fm-map/components/item-list-item-temporal/item-list-item-temporal.component.ts +++ /dev/null @@ -1,42 +0,0 @@ -import {Component, Injectable, Input, OnInit} from '@angular/core'; -import {Store} from '@ngrx/store'; -import * as mapReducers from '../../reducers/map.reducer'; -import { commonReducers, ItemTypeService, IItem, ItemService, IListItem } from '@farmmaps/common'; -import { ForItemType } from '../for-item/for-itemtype.decorator'; -import { ForSourceTask } from '../for-item/for-sourcetask.decorator'; -import { AbstractItemListItemComponent } from '../item-list-item/item-list-item.component' -import { map, mergeMap } from 'rxjs/operators'; -import { Observable, of } from 'rxjs'; -import {Router} from "@angular/router"; - - -@ForItemType("vnd.farmmaps.itemtype.temporal") -@ForSourceTask("vnd.farmmaps.task.vandersat") -@Injectable() -@Component({ - selector: 'fm-map-item-list-item-temporal', - templateUrl: './item-list-item-temporal.component.html', - styleUrls: ['./item-list-item-temporal.component.css'] -}) -export class ItemListItemTemporalComponent extends AbstractItemListItemComponent implements OnInit { - @Input() item: IListItem; - lastTemporalItem$: Observable; - - constructor(store: Store, - itemTypeService: ItemTypeService, private itemService: ItemService, - private router: Router) { - super(store, itemTypeService); - } - ngOnInit() { - this.lastTemporalItem$ = this.itemService - .getChildItemList(this.item.code, "vnd.farmmaps.itemtype.geotiff.processed") - .pipe( - map(list => list.length>0? list.sort().slice(-1)[0]:null), - mergeMap(li => li==null?of(null):this.itemService.getItem(li.code))); - } - - onWidgetClicked() { - event.stopPropagation(); - this.router.navigate(['viewer/vandersat/item', this.item.code]); - } -} diff --git a/projects/common-map/src/fm-map/components/item-list-item-tipstar/item-list-item-tipstar.component.html b/projects/common-map/src/fm-map/components/item-list-item-tipstar/item-list-item-tipstar.component.html deleted file mode 100644 index 6fa1fb8..0000000 --- a/projects/common-map/src/fm-map/components/item-list-item-tipstar/item-list-item-tipstar.component.html +++ /dev/null @@ -1,13 +0,0 @@ -
- -
Yield forecast
-
-
(ton/ha)
-
{{dailyOutput.date | date : 'd/M/yy'}}
-
-
-
-
{{dailyOutput.tuberwt[1] | number:'0.1-1'}}
-
-
-
diff --git a/projects/common-map/src/fm-map/components/item-list-item-tipstar/item-list-item-tipstar.component.scss b/projects/common-map/src/fm-map/components/item-list-item-tipstar/item-list-item-tipstar.component.scss deleted file mode 100644 index 34fcda0..0000000 --- a/projects/common-map/src/fm-map/components/item-list-item-tipstar/item-list-item-tipstar.component.scss +++ /dev/null @@ -1,36 +0,0 @@ -.head { - color: grey; - font-weight: bold; - /*border-bottom:1px solid black;*/ -} - -.body { - display: block; -} - -.value { - text-align: center; - font-weight: bold; - font-size: 1.9rem; - color: deeppink; - /*border-right:1px solid black;*/ -} - -.widget { - display: block; - height: 100%; - width: 100%; -} - -.unit { - font-size: 0.8rem; - color: gray; -} - -.dateformat { - font-size: 0.8rem; -} - -.fm-potato { - color: saddlebrown; -} diff --git a/projects/common-map/src/fm-map/components/item-list-item-tipstar/item-list-item-tipstar.component.ts b/projects/common-map/src/fm-map/components/item-list-item-tipstar/item-list-item-tipstar.component.ts deleted file mode 100644 index 2af42c1..0000000 --- a/projects/common-map/src/fm-map/components/item-list-item-tipstar/item-list-item-tipstar.component.ts +++ /dev/null @@ -1,50 +0,0 @@ -import {Component, Injectable, Input, OnInit} from '@angular/core'; -import {Store} from '@ngrx/store'; -import * as mapReducers from '../../reducers/map.reducer'; -import {commonReducers, IItem, IListItem, ItemService, ItemTypeService} from '@farmmaps/common'; -import {ForItemType} from '../for-item/for-itemtype.decorator'; -import {ForSourceTask} from '../for-item/for-sourcetask.decorator'; -import {AbstractItemListItemComponent} from '../item-list-item/item-list-item.component' -import {Observable} from "rxjs"; -import {Router} from "@angular/router"; - -@ForItemType("vnd.farmmaps.itemtype.tipstar") -@ForSourceTask("vnd.farmmaps.task.tipstar") -@Injectable() -@Component({ - selector: 'fm-map-item-list-item-tipstar', - templateUrl: './item-list-item-tipstar.component.html', - styleUrls: ['./item-list-item-tipstar.component.scss'] -}) -export class ItemListItemTipstarComponent extends AbstractItemListItemComponent implements OnInit { - @Input() item: IListItem; - - item$: Observable; - - constructor(store: Store, itemTypeService: ItemTypeService, - private itemService$: ItemService, private router: Router) { - super(store, itemTypeService); - } - - ngOnInit() { - this.item$ = this.itemService$.getItem(this.item.code); - } - - onWidgetClicked(event: MouseEvent) { - event.stopPropagation(); - this.router.navigate(['viewer/tipstar/item', this.item.code]); - } - - getLastDailyOutput(item) { - if (item == null || item.data == null) { - return null; - } - - const itemData = item.data; - if (itemData.dailyOutput == null) { - return null; - } - - return itemData.dailyOutput[itemData.dailyOutput.length - 1] - } -} diff --git a/projects/common-map/src/fm-map/components/item-list-item-watbal/item-list-item-watbal.component.css b/projects/common-map/src/fm-map/components/item-list-item-watbal/item-list-item-watbal.component.css deleted file mode 100644 index d34a93a..0000000 --- a/projects/common-map/src/fm-map/components/item-list-item-watbal/item-list-item-watbal.component.css +++ /dev/null @@ -1,35 +0,0 @@ -.head { - color: grey; - font-weight: bold; - /*border-bottom:1px solid black;*/ -} - -.body { - display: block; -} - -.tpvocmet { - text-align: center; - font-weight: bold; - font-size: 1.9rem; - line-height: 7.2rem; - color: deeppink; - /*border-right:1px solid black;*/ -} - - - -.widget { - display: block; - height: 100%; - width: 100%; -} - -.unit { - font-size: 0.8rem; - color: gray; -} - -.dateformat { - font-size: 0.8rem; -} diff --git a/projects/common-map/src/fm-map/components/item-list-item-watbal/item-list-item-watbal.component.html b/projects/common-map/src/fm-map/components/item-list-item-watbal/item-list-item-watbal.component.html deleted file mode 100644 index 4d80809..0000000 --- a/projects/common-map/src/fm-map/components/item-list-item-watbal/item-list-item-watbal.component.html +++ /dev/null @@ -1,13 +0,0 @@ -
-
-
WatBal (kg/ha)
-
- Date:{{TPVOCMET?.Datum | date : 'shortDate'}} - Bedrijf/Perceel:{{TPVOCMET?.BedrijfID}}/{{TPVOCMET?.PerceelID}} - GewichtZonder:{{TPVOCMET?.GewichtZonder | number:'0.1-2'}} - GewichtGroDro:{{TPVOCMET?.GewichtGroDro | number:'0.1-2'}} - GewichtGroNat:{{TPVOCMET?.GewichtGroNat | number:'0.1-2'}} -
- -
-
diff --git a/projects/common-map/src/fm-map/components/item-list-item-watbal/item-list-item-watbal.component.ts b/projects/common-map/src/fm-map/components/item-list-item-watbal/item-list-item-watbal.component.ts deleted file mode 100644 index 5a37373..0000000 --- a/projects/common-map/src/fm-map/components/item-list-item-watbal/item-list-item-watbal.component.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { Observable, of } from 'rxjs'; -import { Component, OnInit } from '@angular/core'; -import { Input, Injectable } from '@angular/core'; -import { Store } from '@ngrx/store'; -import * as mapReducers from '../../reducers/map.reducer'; -import { commonReducers, ItemTypeService, IItem, Item, ItemService, IListItem } from '@farmmaps/common'; -import { ForItemType } from '../for-item/for-itemtype.decorator'; -import { ForSourceTask } from '../for-item/for-sourcetask.decorator'; -import { AbstractItemListItemComponent } from '../item-list-item/item-list-item.component' -import { Stage } from '../widget-status/widget-status.component'; - -@ForItemType("vnd.farmmaps.itemtype.watbal") -@ForSourceTask("vnd.farmmaps.task.watbal") -@Injectable() -@Component({ - selector: 'fm-map-item-list-item-watbal', - templateUrl: './item-list-item-watbal.component.html', - styleUrls: ['./item-list-item-watbal.component.css'] -}) -export class ItemListItemWatBalComponent extends AbstractItemListItemComponent implements OnInit { - @Input() item: IListItem; - TPVOCMET; - stage = Stage.DevelopmentPreAlpha; - - constructor(store: Store, itemTypeService: ItemTypeService, private itemService$: ItemService) { - super(store, itemTypeService); - } - ngOnInit() { - this.itemService$.getItem(this.item.code).subscribe(i => { - var data = i.data.HTAKKER_Input.TPVOCMET; - this.TPVOCMET = data[data.length - 1]; - }); - } -} diff --git a/projects/common-map/src/fm-map/components/item-widget-weather/item-widget-weather.component.html b/projects/common-map/src/fm-map/components/item-widget-weather/item-widget-weather.component.html deleted file mode 100644 index 5a18e7b..0000000 --- a/projects/common-map/src/fm-map/components/item-widget-weather/item-widget-weather.component.html +++ /dev/null @@ -1,4 +0,0 @@ -
-
{{currentweather.temp}}°
- -
diff --git a/projects/common-map/src/fm-map/components/item-widget-weather/item-widget-weather.component.scss b/projects/common-map/src/fm-map/components/item-widget-weather/item-widget-weather.component.scss deleted file mode 100644 index ef6f471..0000000 --- a/projects/common-map/src/fm-map/components/item-widget-weather/item-widget-weather.component.scss +++ /dev/null @@ -1,27 +0,0 @@ -@import "../../_theme.scss"; -@import "~bootstrap/scss/bootstrap.scss"; - -.widget { - padding:0.8rem; - height:100%; - width:100%; - color:#ffffff; - position:relative; -} - -.icon { - display:block; - font-size:6rem; - text-align:center; -} -.title { - display:block; - position:absolute; - width:calc(100% - 1.6rem ); - padding-top:0.5rem; - bottom:0.8rem; - height:2rem; - overflow:hidden; - white-space:nowrap; - text-overflow:ellipsis; -} diff --git a/projects/common-map/src/fm-map/components/item-widget-weather/item-widget-weather.component.ts b/projects/common-map/src/fm-map/components/item-widget-weather/item-widget-weather.component.ts deleted file mode 100644 index 9d0b562..0000000 --- a/projects/common-map/src/fm-map/components/item-widget-weather/item-widget-weather.component.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { Component, Input, Injectable } from '@angular/core'; -import { Store } from '@ngrx/store'; -import * as mapReducers from '../../reducers/map.reducer'; -import { Observable } from 'rxjs'; -import { mergeMap } from 'rxjs/operators'; -import { commonReducers, ItemTypeService, ItemService } from '@farmmaps/common'; -import { AbstractItemWidgetComponent} from '../item-list-item/item-list-item.component'; -import { ForItemType } from '../for-item/for-itemtype.decorator'; -import { HttpClient } from '@angular/common/http'; -import { GeoJSON } from 'ol/format'; -import { getCenter, Extent, createEmpty, extend } from 'ol/extent'; - -@Injectable() -@Component({ - selector: 'fm-map-item-widget-weather', - templateUrl: './item-widget-weather.component.html', - styleUrls: ['./item-widget-weather.component.scss'] -}) -export class ItemWidgetWeatherComponent extends AbstractItemWidgetComponent { - - private _format: GeoJSON; - - constructor(store: Store, itemTypeService: ItemTypeService, public http: HttpClient, private itemService$: ItemService) { - super(store, itemTypeService); - this._format = new GeoJSON(); - } - - public weather: Observable; - - ngOnInit() { - this.weather = this.itemService$.getItem(this.item.code).pipe(mergeMap(i => { - console.debug(i.geometry); - var geometry = this._format.readGeometry(i.geometry); - var centroid = getCenter(geometry.getExtent()); - var url = 'https://weather.akkerweb.nl/v2/data/currentobservation/?c=' + centroid[0] + ',' + centroid[1] + '&key=5f17ef36283b49e9b099a1f4064fbf3d'; - var cw = this.http.get(url); - return cw; - })); - } -}