Compare commits
No commits in common. "78ca3044cf68965986431db577e58191b90f4637" and "af0a3dca2d3bd6a113e07af2ba39b0d1dfd8c1d0" have entirely different histories.
78ca3044cf
...
af0a3dca2d
@ -1,9 +1,8 @@
|
|||||||
import { Location } from '@angular/common';
|
import { Location } from '@angular/common';
|
||||||
import { Component, Injectable, OnDestroy } from '@angular/core';
|
import { Component, Injectable } from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { commonReducers, FolderService, IItem, IItemLinkType, ItemService, ItemTypeService, IUrlType } from '@farmmaps/common';
|
import { commonReducers, FolderService, IItem, IItemLinkType, ItemService, ItemTypeService, IUrlType } from '@farmmaps/common';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { Subscription } from 'rxjs';
|
|
||||||
import * as mapActions from '../../actions/map.actions';
|
import * as mapActions from '../../actions/map.actions';
|
||||||
import * as mapReducers from '../../reducers/map.reducer';
|
import * as mapReducers from '../../reducers/map.reducer';
|
||||||
import { ForItemType } from '../for-item/for-itemtype.decorator';
|
import { ForItemType } from '../for-item/for-itemtype.decorator';
|
||||||
@ -17,17 +16,12 @@ import { AbstractSelectedItemComponent } from '../selected-item/selected-item.co
|
|||||||
templateUrl: './selected-item-geotiff.component.html',
|
templateUrl: './selected-item-geotiff.component.html',
|
||||||
styleUrls: ['./selected-item-geotiff.component.scss']
|
styleUrls: ['./selected-item-geotiff.component.scss']
|
||||||
})
|
})
|
||||||
export class SelectedItemGeotiffComponent extends AbstractSelectedItemComponent implements OnDestroy {
|
export class SelectedItemGeotiffComponent extends AbstractSelectedItemComponent {
|
||||||
sub: Subscription;
|
|
||||||
|
|
||||||
constructor(store: Store<mapReducers.State | commonReducers.State>, public itemService: ItemService, itemTypeService: ItemTypeService, location: Location, router: Router, private itemService$: ItemService,private folderService$: FolderService) {
|
constructor(store: Store<mapReducers.State | commonReducers.State>, public itemService: ItemService, itemTypeService: ItemTypeService, location: Location, router: Router, private itemService$: ItemService,private folderService$: FolderService) {
|
||||||
super(store, itemTypeService,location,router);
|
super(store, itemTypeService,location,router);
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy(): void {
|
|
||||||
if (this.sub) this.sub.unsubscribe();
|
|
||||||
}
|
|
||||||
|
|
||||||
onLayerChanged(layerIndex: number) {
|
onLayerChanged(layerIndex: number) {
|
||||||
this.store.dispatch(new mapActions.SetLayerIndex(layerIndex));
|
this.store.dispatch(new mapActions.SetLayerIndex(layerIndex));
|
||||||
}
|
}
|
||||||
@ -40,7 +34,7 @@ export class SelectedItemGeotiffComponent extends AbstractSelectedItemComponent
|
|||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
const itemLink : IItemLinkType = {itemcode:item.code,query:`layer=${this.layer(layers,layerIndex).name}`,pathsuffix:"download", validminutes:10}
|
const itemLink : IItemLinkType = {itemcode:item.code,query:`layer=${this.layer(layers,layerIndex).name}`,pathsuffix:"download", validminutes:10}
|
||||||
this.sub = this.itemService.getItemLink(itemLink).subscribe((itemLinkUrl:IUrlType) => {
|
const foo = this.itemService.getItemLink(itemLink).subscribe((itemLinkUrl:IUrlType) => {
|
||||||
window.location.href = itemLinkUrl.url;
|
window.location.href = itemLinkUrl.url;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -7,8 +7,7 @@
|
|||||||
<h2 *ngIf="parentOfItemType('vnd.farmmaps.itemtype.cropfield')">{{parentItem.name}}</h2>
|
<h2 *ngIf="parentOfItemType('vnd.farmmaps.itemtype.cropfield')">{{parentItem.name}}</h2>
|
||||||
<h1>{{item.name}}</h1>
|
<h1>{{item.name}}</h1>
|
||||||
</div>
|
</div>
|
||||||
<ng-container *ngIf="item?.data.layers;let layers">
|
<div class="legend-container" *ngIf="item?.data.layers;let layers">
|
||||||
<div class="legend-container">
|
|
||||||
<div class="card menu-card">
|
<div class="card menu-card">
|
||||||
<div *ngIf="layers.length>1">
|
<div *ngIf="layers.length>1">
|
||||||
<select (change)="onLayerChanged($event.target.value)">
|
<select (change)="onLayerChanged($event.target.value)">
|
||||||
@ -25,10 +24,8 @@
|
|||||||
<li *ngIf="!getItemLayer(item,itemLayer.layerIndex)"><a href="#" (click)="handleAddAsLayer(item,itemLayer.layerIndex)" ><i class="fas fa-layer-olus" aria-hidden="true" i18n-title title="Add as layer"></i> <span i18n>Add as overlay</span></a></li>
|
<li *ngIf="!getItemLayer(item,itemLayer.layerIndex)"><a href="#" (click)="handleAddAsLayer(item,itemLayer.layerIndex)" ><i class="fas fa-layer-olus" aria-hidden="true" i18n-title title="Add as layer"></i> <span i18n>Add as overlay</span></a></li>
|
||||||
<li *ngIf="getItemLayer(item,itemLayer.layerIndex)"><a href="#" (click)="handleRemoveLayer(item,itemLayer.layerIndex)" ><i class="fas fa-layer-minus" aria-hidden="true" i18n-title title="Remove overlay"></i> <span i18n>Remove overlay</span></a></li>
|
<li *ngIf="getItemLayer(item,itemLayer.layerIndex)"><a href="#" (click)="handleRemoveLayer(item,itemLayer.layerIndex)" ><i class="fas fa-layer-minus" aria-hidden="true" i18n-title title="Remove overlay"></i> <span i18n>Remove overlay</span></a></li>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<li><a href="#" (click)="download($event,item,layers,itemLayer.layerIndex)"><i class="fal fa-download" aria-hidden="true" i18n-title title="Download"></i> <span i18n>Download</span></a></li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</ng-container>
|
|
||||||
<fm-map-zoom-to-show-alert [layer]="itemLayer?.layer"></fm-map-zoom-to-show-alert>
|
<fm-map-zoom-to-show-alert [layer]="itemLayer?.layer"></fm-map-zoom-to-show-alert>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
|
import { Component, Input, Injectable, OnInit } from '@angular/core';
|
||||||
import { Location } from '@angular/common';
|
import { Location } from '@angular/common';
|
||||||
import { Component, Injectable, OnDestroy } from '@angular/core';
|
import { Feature } from 'ol';
|
||||||
import { Router } from '@angular/router';
|
|
||||||
import { commonReducers, FolderService, IItem, IItemLinkType, ItemService, ItemTypeService, IUrlType } from '@farmmaps/common';
|
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import * as mapActions from '../../actions/map.actions';
|
|
||||||
import * as mapReducers from '../../reducers/map.reducer';
|
import * as mapReducers from '../../reducers/map.reducer';
|
||||||
|
import { commonReducers, ItemTypeService, IItem, Item, ItemService, FolderService, IListItem} from '@farmmaps/common';
|
||||||
|
import * as mapActions from '../../actions/map.actions';
|
||||||
|
import { Router, ActivatedRoute, ParamMap, Event } from '@angular/router';
|
||||||
import { ForItemType } from '../for-item/for-itemtype.decorator';
|
import { ForItemType } from '../for-item/for-itemtype.decorator';
|
||||||
import { AbstractSelectedItemComponent } from '../selected-item/selected-item.component';
|
import { AbstractSelectedItemComponent } from '../selected-item/selected-item.component';
|
||||||
import { Subscription } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
|
|
||||||
@ForItemType("vnd.farmmaps.itemtype.shape.processed")
|
@ForItemType("vnd.farmmaps.itemtype.shape.processed")
|
||||||
@ -17,17 +18,12 @@ import { Subscription } from 'rxjs';
|
|||||||
templateUrl: './selected-item-shape.component.html',
|
templateUrl: './selected-item-shape.component.html',
|
||||||
styleUrls: ['./selected-item-shape.component.scss']
|
styleUrls: ['./selected-item-shape.component.scss']
|
||||||
})
|
})
|
||||||
export class SelectedItemShapeComponent extends AbstractSelectedItemComponent implements OnDestroy {
|
export class SelectedItemShapeComponent extends AbstractSelectedItemComponent {
|
||||||
public selectedLayer = 0;
|
|
||||||
sub: Subscription;
|
|
||||||
|
|
||||||
constructor(store: Store<mapReducers.State | commonReducers.State>, public itemService: ItemService, itemTypeService: ItemTypeService, location: Location, router: Router, private itemService$: ItemService,private folderService$: FolderService) {
|
constructor(store: Store<mapReducers.State | commonReducers.State>, itemTypeService: ItemTypeService, location: Location, router: Router, private itemService$: ItemService,private folderService$: FolderService) {
|
||||||
super(store, itemTypeService,location,router);
|
super(store, itemTypeService,location,router);
|
||||||
}
|
}
|
||||||
|
public selectedLayer = 0;
|
||||||
ngOnDestroy(): void {
|
|
||||||
if (this.sub) this.sub.unsubscribe();
|
|
||||||
}
|
|
||||||
|
|
||||||
onLayerChanged(layerIndex: number) {
|
onLayerChanged(layerIndex: number) {
|
||||||
this.store.dispatch(new mapActions.SetLayerIndex(layerIndex));
|
this.store.dispatch(new mapActions.SetLayerIndex(layerIndex));
|
||||||
@ -36,13 +32,4 @@ export class SelectedItemShapeComponent extends AbstractSelectedItemComponent im
|
|||||||
layer(layers:any,layerIndex:number) {
|
layer(layers:any,layerIndex:number) {
|
||||||
return layers.find(l => l.index == layerIndex);
|
return layers.find(l => l.index == layerIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
download(event:MouseEvent,item:IItem,layers:any,layerIndex:number) {
|
|
||||||
event.stopPropagation();
|
|
||||||
event.preventDefault();
|
|
||||||
const itemLink : IItemLinkType = {itemcode:item.code,query:`layer=${this.layer(layers,layerIndex).name}`,pathsuffix:"download", validminutes:10}
|
|
||||||
this.sub = this.itemService.getItemLink(itemLink).subscribe((itemLinkUrl:IUrlType) => {
|
|
||||||
window.location.href = itemLinkUrl.url;
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
|
import { Component, Injectable } from '@angular/core';
|
||||||
import { Location } from '@angular/common';
|
import { Location } from '@angular/common';
|
||||||
import { Component, Injectable, OnDestroy } from '@angular/core';
|
|
||||||
import { Router } from '@angular/router';
|
|
||||||
import { commonReducers, IItem, IItemLinkType, ItemService, ItemTypeService, IUrlType } from '@farmmaps/common';
|
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { Subscription } from 'rxjs';
|
|
||||||
import * as mapActions from '../../actions/map.actions';
|
|
||||||
import { IItemLayer, ITemporalItemLayer } from '../../models/item.layer';
|
|
||||||
import * as mapReducers from '../../reducers/map.reducer';
|
import * as mapReducers from '../../reducers/map.reducer';
|
||||||
import { TemporalService } from '../../services/temporal.service';
|
import { commonReducers, ItemTypeService, IItem, ItemService, IItemLinkType, IUrlType } from '@farmmaps/common';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
import { ForItemType } from '../for-item/for-itemtype.decorator';
|
import { ForItemType } from '../for-item/for-itemtype.decorator';
|
||||||
import { AbstractSelectedItemComponent } from '../selected-item/selected-item.component';
|
import { AbstractSelectedItemComponent } from '../selected-item/selected-item.component';
|
||||||
|
import { ITemporalItemLayer} from '../../models/item.layer';
|
||||||
|
import * as mapActions from '../../actions/map.actions';
|
||||||
|
import { IItemLayer } from '../../models/item.layer';
|
||||||
|
import {TemporalService} from '../../services/temporal.service';
|
||||||
|
|
||||||
@ForItemType("vnd.farmmaps.itemtype.temporal")
|
@ForItemType("vnd.farmmaps.itemtype.temporal")
|
||||||
@Injectable()
|
@Injectable()
|
||||||
@ -18,17 +18,12 @@ import { AbstractSelectedItemComponent } from '../selected-item/selected-item.co
|
|||||||
templateUrl: './selected-item-temporal.component.html',
|
templateUrl: './selected-item-temporal.component.html',
|
||||||
styleUrls: ['./selected-item-temporal.component.scss']
|
styleUrls: ['./selected-item-temporal.component.scss']
|
||||||
})
|
})
|
||||||
export class SelectedItemTemporalComponent extends AbstractSelectedItemComponent implements OnDestroy {
|
export class SelectedItemTemporalComponent extends AbstractSelectedItemComponent {
|
||||||
sub: Subscription;
|
|
||||||
|
|
||||||
constructor(store: Store<mapReducers.State | commonReducers.State>, public itemService: ItemService, itemTypeService: ItemTypeService, location: Location, router: Router,public temporalService:TemporalService) {
|
constructor(store: Store<mapReducers.State | commonReducers.State>, public itemService: ItemService, itemTypeService: ItemTypeService, location: Location, router: Router,public temporalService:TemporalService) {
|
||||||
super(store, itemTypeService,location,router);
|
super(store, itemTypeService,location,router);
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy(): void {
|
|
||||||
if (this.sub) this.sub.unsubscribe();
|
|
||||||
}
|
|
||||||
|
|
||||||
onLayerChanged(layerIndex: number) {
|
onLayerChanged(layerIndex: number) {
|
||||||
this.store.dispatch(new mapActions.SetLayerIndex(layerIndex));
|
this.store.dispatch(new mapActions.SetLayerIndex(layerIndex));
|
||||||
}
|
}
|
||||||
@ -37,6 +32,8 @@ export class SelectedItemTemporalComponent extends AbstractSelectedItemComponent
|
|||||||
return (this.itemLayer as ITemporalItemLayer)?.selectedItemLayer
|
return (this.itemLayer as ITemporalItemLayer)?.selectedItemLayer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
handleNextTemporal(event:MouseEvent) {
|
handleNextTemporal(event:MouseEvent) {
|
||||||
this.store.dispatch(new mapActions.NextTemporal());
|
this.store.dispatch(new mapActions.NextTemporal());
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
@ -68,7 +65,7 @@ export class SelectedItemTemporalComponent extends AbstractSelectedItemComponent
|
|||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
const itemLink : IItemLinkType = {itemcode:item.code,query:`layer=${this.layer(layers,layerIndex).name}`,pathsuffix:"download", validminutes:10}
|
const itemLink : IItemLinkType = {itemcode:item.code,query:`layer=${this.layer(layers,layerIndex).name}`,pathsuffix:"download", validminutes:10}
|
||||||
this.sub = this.itemService.getItemLink(itemLink).subscribe((itemLinkUrl:IUrlType) => {
|
const foo = this.itemService.getItemLink(itemLink).subscribe((itemLinkUrl:IUrlType) => {
|
||||||
window.location.href = itemLinkUrl.url;
|
window.location.href = itemLinkUrl.url;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user