AW-6046 Angular improvement
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
				
			This commit is contained in:
		@@ -1,10 +1,9 @@
 | 
			
		||||
import { Component, Input, OnDestroy, OnInit, EventEmitter, Output, Inject } from '@angular/core';
 | 
			
		||||
import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core';
 | 
			
		||||
import { MapComponent } from 'ng-openlayers';
 | 
			
		||||
 | 
			
		||||
import * as proj  from 'ol/proj';
 | 
			
		||||
import {Point,Geometry} from 'ol/geom';
 | 
			
		||||
import { Feature } from 'ol';
 | 
			
		||||
import { GeoJSON } from 'ol/format';
 | 
			
		||||
import { Feature} from 'ol';
 | 
			
		||||
import { Geometry, Point } from 'ol/geom';
 | 
			
		||||
 | 
			
		||||
export interface IDroppedFile {
 | 
			
		||||
  files: any,
 | 
			
		||||
@@ -28,7 +27,6 @@ export class FileDropTargetComponent implements OnInit, OnDestroy {
 | 
			
		||||
 | 
			
		||||
  ngOnInit() {
 | 
			
		||||
    this.element = this.map.instance.getViewport();
 | 
			
		||||
    const other = this;
 | 
			
		||||
    this.element.addEventListener('drop', this.onDrop, false);
 | 
			
		||||
    this.element.addEventListener('dragover', this.preventDefault, false);
 | 
			
		||||
    this.element.addEventListener('dragenter', this.preventDefault, false);
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
import { Component, OnInit, Input, ViewChild, ElementRef, OnChanges, SimpleChanges ,Host} from '@angular/core';
 | 
			
		||||
import { Component, ElementRef, Input, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core';
 | 
			
		||||
import { MapComponent } from 'ng-openlayers';
 | 
			
		||||
import  Overlay  from 'ol/Overlay';
 | 
			
		||||
import { fromLonLat, toLonLat } from 'ol/proj';
 | 
			
		||||
import Overlay from 'ol/Overlay';
 | 
			
		||||
import { fromLonLat } from 'ol/proj';
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
 
 | 
			
		||||
@@ -1,25 +1,21 @@
 | 
			
		||||
import { Component, Host, Input, Output, EventEmitter,OnDestroy, OnInit, OnChanges, SimpleChanges, forwardRef } from '@angular/core';
 | 
			
		||||
import { Component, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, forwardRef } from '@angular/core';
 | 
			
		||||
import { AppConfig, IItem, ItemService } from '@farmmaps/common';
 | 
			
		||||
import { LayerGroupComponent, MapComponent } from 'ng-openlayers';
 | 
			
		||||
import { ItemService,IItem,AppConfig } from '@farmmaps/common';
 | 
			
		||||
import { IItemLayer, ITemporalItemLayer} from '../../../models/item.layer';
 | 
			
		||||
import { ILayerData} from '../../../models/layer.data';
 | 
			
		||||
import { IRenderoutputTiles,IRenderoutputImage,IGradientstop,ILayer,IHistogram,IColor} from '../../../models/color.map';
 | 
			
		||||
import {Extent} from 'ol/extent';
 | 
			
		||||
import Projection from 'ol/proj/Projection';
 | 
			
		||||
import * as proj from 'ol/proj';
 | 
			
		||||
import * as loadingstrategy from 'ol/loadingstrategy';
 | 
			
		||||
import * as style from 'ol/style';
 | 
			
		||||
import {Tile,Layer,Image} from 'ol/layer';
 | 
			
		||||
import {XYZ,ImageStatic,OSM,BingMaps,TileWMS,TileArcGISRest,TileJSON,Source} from 'ol/source';
 | 
			
		||||
import {Vector as VectorSource} from 'ol/source';
 | 
			
		||||
import { Vector as VectorLayer } from 'ol/layer';
 | 
			
		||||
import { VectorImage as VectorImageLayer } from 'ol/layer';
 | 
			
		||||
import VectorTileSource from 'ol/source/VectorTile';
 | 
			
		||||
import VectorTileLayer from 'ol/layer/VectorTile';
 | 
			
		||||
import {GeoJSON,MVT} from 'ol/format';
 | 
			
		||||
import { Geometry } from 'ol/geom';
 | 
			
		||||
import BaseLayer from 'ol/layer/Base';
 | 
			
		||||
import Feature from 'ol/Feature';
 | 
			
		||||
import { Extent } from 'ol/extent';
 | 
			
		||||
import { GeoJSON, MVT } from 'ol/format';
 | 
			
		||||
import { Geometry } from 'ol/geom';
 | 
			
		||||
import { Image, Layer, Tile, VectorImage as VectorImageLayer, Vector as VectorLayer } from 'ol/layer';
 | 
			
		||||
import VectorTileLayer from 'ol/layer/VectorTile';
 | 
			
		||||
import * as loadingstrategy from 'ol/loadingstrategy';
 | 
			
		||||
import * as proj from 'ol/proj';
 | 
			
		||||
import Projection from 'ol/proj/Projection';
 | 
			
		||||
import { BingMaps, ImageStatic, OSM, Source, TileArcGISRest, TileJSON, TileWMS, Vector as VectorSource, XYZ } from 'ol/source';
 | 
			
		||||
import VectorTileSource from 'ol/source/VectorTile';
 | 
			
		||||
import * as style from 'ol/style';
 | 
			
		||||
import { IColor, IGradientstop, IHistogram, ILayer, IRenderoutputImage, IRenderoutputTiles } from '../../../models/color.map';
 | 
			
		||||
import { IItemLayer, ITemporalItemLayer } from '../../../models/item.layer';
 | 
			
		||||
import { ILayerData } from '../../../models/layer.data';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'fm-map-item-layers',
 | 
			
		||||
@@ -94,7 +90,7 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange
 | 
			
		||||
    return color;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  getColor(item: IItem, layer: ILayer, feature): style.Style {
 | 
			
		||||
  getColor(item: IItem, layer: any, feature): style.Style {
 | 
			
		||||
    const value = layer.indexKey ? feature.get(layer.indexKey) : feature.get(layer.name);
 | 
			
		||||
    const key = item.code + "_" + value;
 | 
			
		||||
    if (!this.styleCache[key]) {
 | 
			
		||||
@@ -153,7 +149,7 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange
 | 
			
		||||
    const data = item.data;
 | 
			
		||||
    const l:ILayer = (data && data.layers && data.layers.length > 0) ? data.layers[layerIndex] : null;
 | 
			
		||||
    if (l && l.rendering && l.rendering.renderoutputType == "VectorTiles") {
 | 
			
		||||
      var rt = l.rendering as IRenderoutputTiles;
 | 
			
		||||
      const rt = l.rendering as IRenderoutputTiles;
 | 
			
		||||
      layer = new VectorTileLayer({
 | 
			
		||||
        declutter: true,
 | 
			
		||||
        source: new VectorTileSource({
 | 
			
		||||
@@ -167,7 +163,7 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange
 | 
			
		||||
        }
 | 
			
		||||
      })
 | 
			
		||||
    } else if (l && l.rendering && l.rendering.renderoutputType == "Tiles") {
 | 
			
		||||
      var rt = l.rendering as IRenderoutputTiles;
 | 
			
		||||
      const rt = l.rendering as IRenderoutputTiles;
 | 
			
		||||
      layer = new Tile({
 | 
			
		||||
        source: new XYZ({
 | 
			
		||||
          maxZoom: rt.maxzoom,
 | 
			
		||||
@@ -176,11 +172,12 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange
 | 
			
		||||
        })
 | 
			
		||||
      });
 | 
			
		||||
    } else {
 | 
			
		||||
      // eslint-disable-next-line @typescript-eslint/no-this-alias
 | 
			
		||||
      const __this = this;
 | 
			
		||||
      const format = new GeoJSON();
 | 
			
		||||
      const source = new VectorSource({
 | 
			
		||||
        strategy: loadingstrategy.bbox,
 | 
			
		||||
        loader: function (extent: Extent, resolution: number, projection: Projection) {
 | 
			
		||||
        loader: function (extent: Extent, _resolution: number, projection: Projection) {
 | 
			
		||||
          const source = this as VectorSource<Feature<Geometry>>;
 | 
			
		||||
          __this.itemService.getItemFeatures(item.code, extent, projection.getCode(), layerIndex).subscribe(function (data) {
 | 
			
		||||
            const features = format.readFeatures(data).filter(feature => feature instanceof Feature) as Feature[];
 | 
			
		||||
@@ -237,7 +234,6 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange
 | 
			
		||||
 | 
			
		||||
  createSelectionLayer(itemLayer:IItemLayer):Layer<Source> {
 | 
			
		||||
    let layerIndex = -1;
 | 
			
		||||
    const layer: Layer<Source> = null; 
 | 
			
		||||
    layerIndex = itemLayer.layerIndex != -1 ? itemLayer.layerIndex : itemLayer.item.data.layers[0].index;
 | 
			
		||||
    const data = itemLayer.item.data;
 | 
			
		||||
    const l:ILayer = (data && data.layers && data.layers.length > 0) ? data.layers[layerIndex] : null;
 | 
			
		||||
@@ -265,7 +261,8 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange
 | 
			
		||||
    return null;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  createExternalLayer(item:IItem,itemLayer:IItemLayer):Layer<Source> {
 | 
			
		||||
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
 | 
			
		||||
  createExternalLayer(item:IItem,_itemLayer:IItemLayer):Layer<Source> {
 | 
			
		||||
    const data = item.data as ILayerData;
 | 
			
		||||
    let layer: Layer<Source> = null; 
 | 
			
		||||
    switch (data.interfaceType) {
 | 
			
		||||
@@ -319,7 +316,6 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange
 | 
			
		||||
 | 
			
		||||
  createLayer(itemLayer: IItemLayer): Layer<Source> {
 | 
			
		||||
    let layer: Layer<Source> = null;   
 | 
			
		||||
    const layerIndex = -1;
 | 
			
		||||
    if (itemLayer.item.itemType == 'vnd.farmmaps.itemtype.geotiff.processed') {
 | 
			
		||||
      layer = this.createGeotiffLayer(itemLayer.item,itemLayer);
 | 
			
		||||
    } else if (itemLayer.item.itemType == 'vnd.farmmaps.itemtype.shape.processed') {
 | 
			
		||||
@@ -379,10 +375,6 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange
 | 
			
		||||
    if(this.topLayerPrerenderEventhandlerInstalled && this.onPrerender.observers.length > 0 )
 | 
			
		||||
    {
 | 
			
		||||
      if(this.instance.getVisible()) {
 | 
			
		||||
        const olLayers = this.instance.getLayers().getArray().forEach((l:any) => {
 | 
			
		||||
          l.un('prerender',this.topLayerPrerenderEventhandler);
 | 
			
		||||
          l.un('postrender',this.topLayerPostrenderEventhandler);
 | 
			
		||||
        });
 | 
			
		||||
        this.topLayerPrerenderEventhandlerInstalled = false;
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
@@ -415,17 +407,15 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange
 | 
			
		||||
 | 
			
		||||
  updateLayers(itemLayers: IItemLayer[] | IItemLayer) {
 | 
			
		||||
    this.unInstallTopLayerPrerenderEventhandler();
 | 
			
		||||
    let dataLayer = false;
 | 
			
		||||
    let ils:IItemLayer[] = [];
 | 
			
		||||
    if(Array.isArray(itemLayers)) {
 | 
			
		||||
       ils = itemLayers;
 | 
			
		||||
    } else {
 | 
			
		||||
      dataLayer=true;
 | 
			
		||||
       ils=[itemLayers];
 | 
			
		||||
    }
 | 
			
		||||
    const newLayers: Layer<Source>[] = [];
 | 
			
		||||
    if (ils) {
 | 
			
		||||
      ils.forEach((itemLayer, index) => {
 | 
			
		||||
      ils.forEach((itemLayer) => {
 | 
			
		||||
        if(itemLayer.item.itemType ==  'vnd.farmmaps.itemtype.temporal') {
 | 
			
		||||
          const il = itemLayer as ITemporalItemLayer;
 | 
			
		||||
          const previousLayer = this.addOrUpdateOlLayer(il.previousItemLayer,newLayers.length);          
 | 
			
		||||
 
 | 
			
		||||
@@ -1,25 +1,22 @@
 | 
			
		||||
import { Component, Host, Input, Output, EventEmitter, OnInit, OnChanges, SimpleChanges, forwardRef, Inject, InjectionToken, OnDestroy, LOCALE_ID } from '@angular/core';
 | 
			
		||||
import { LayerVectorComponent, SourceVectorComponent, MapComponent } from 'ng-openlayers';
 | 
			
		||||
import { ItemService, ItemTypeService, IItem, IItemType, FolderService } from '@farmmaps/common';
 | 
			
		||||
import { Component, EventEmitter, Host, Inject, Input, LOCALE_ID, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, forwardRef } from '@angular/core';
 | 
			
		||||
import { FolderService, IItem, ItemService, ItemTypeService } from '@farmmaps/common';
 | 
			
		||||
import { LayerVectorComponent, MapComponent, SourceVectorComponent } from 'ng-openlayers';
 | 
			
		||||
 | 
			
		||||
import { Feature } from 'ol';
 | 
			
		||||
import { Point, Geometry } from 'ol/geom';
 | 
			
		||||
import { MapBrowserEvent } from 'ol';
 | 
			
		||||
import { Types } from 'ol/MapBrowserEventType';
 | 
			
		||||
import * as style from 'ol/style';
 | 
			
		||||
import { formatNumber } from '@angular/common';
 | 
			
		||||
import { Feature, MapBrowserEvent } from 'ol';
 | 
			
		||||
import * as color from 'ol/color';
 | 
			
		||||
import * as loadingstrategy from 'ol/loadingstrategy';
 | 
			
		||||
import * as condition from 'ol/events/condition';
 | 
			
		||||
import * as extent from 'ol/extent';
 | 
			
		||||
import { Vector, Cluster, Source } from 'ol/source';
 | 
			
		||||
import { Layer } from 'ol/layer';
 | 
			
		||||
import { getCenter } from 'ol/extent';
 | 
			
		||||
import { GeoJSON } from 'ol/format';
 | 
			
		||||
import { Geometry, Point } from 'ol/geom';
 | 
			
		||||
import { Select } from 'ol/interaction';
 | 
			
		||||
import { Layer } from 'ol/layer';
 | 
			
		||||
import * as loadingstrategy from 'ol/loadingstrategy';
 | 
			
		||||
import { Source, Vector } from 'ol/source';
 | 
			
		||||
import * as style from 'ol/style';
 | 
			
		||||
import { Subscription } from 'rxjs';
 | 
			
		||||
import { IStyles } from '../../../models/style.cache';
 | 
			
		||||
import { FeatureIconService } from '../../../services/feature-icon.service';
 | 
			
		||||
import { Subscription } from 'rxjs';
 | 
			
		||||
import { getCenter } from 'ol/extent';
 | 
			
		||||
import { formatNumber } from '@angular/common';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'fm-map-item-source-vector',
 | 
			
		||||
@@ -30,10 +27,8 @@ import { formatNumber } from '@angular/common';
 | 
			
		||||
})
 | 
			
		||||
export class ItemVectorSourceComponent extends SourceVectorComponent implements OnInit, OnDestroy, OnChanges {
 | 
			
		||||
  instance: Vector<Feature<Geometry>>;
 | 
			
		||||
  private _format: GeoJSON;
 | 
			
		||||
  private _select: Select;
 | 
			
		||||
  private _hoverSelect: Select;
 | 
			
		||||
  private _iconScale = 0.05;
 | 
			
		||||
  @Input() features: Array<Feature<Geometry>>;
 | 
			
		||||
  @Input() selectedFeature: Feature<Geometry>;
 | 
			
		||||
  @Input() selectedItem: IItem;
 | 
			
		||||
@@ -46,7 +41,6 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements
 | 
			
		||||
 | 
			
		||||
  constructor(@Host() private layer: LayerVectorComponent, private itemService: ItemService, private map: MapComponent, private itemTypeService: ItemTypeService, private featureIconService$: FeatureIconService, private folderService: FolderService, @Inject(LOCALE_ID) private locale: string) {
 | 
			
		||||
    super(layer);
 | 
			
		||||
    this._format = new GeoJSON();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  geometry(feature: Feature<Geometry>) {
 | 
			
		||||
@@ -204,6 +198,7 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements
 | 
			
		||||
    if (changes["styles"]) {
 | 
			
		||||
      const styles = changes["styles"].currentValue;
 | 
			
		||||
      for (const key in styles) {
 | 
			
		||||
        // eslint-disable-next-line no-prototype-builtins
 | 
			
		||||
        if (styles.hasOwnProperty(key)) {
 | 
			
		||||
          this.stylesCache[key] = styles[key];
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
@@ -1,17 +1,16 @@
 | 
			
		||||
import { Component, OnInit, Input, ViewChild, ElementRef, AfterViewInit } from '@angular/core';
 | 
			
		||||
import { IItemLayer } from '../../../models/item.layer';
 | 
			
		||||
import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
 | 
			
		||||
import { Store } from '@ngrx/store';
 | 
			
		||||
import * as mapReducers from '../../../reducers/map.reducer';
 | 
			
		||||
import * as mapActions from '../../../actions/map.actions';
 | 
			
		||||
import { MapComponent } from 'ng-openlayers';
 | 
			
		||||
import { ILayervalue } from '../../../models/layer.value';
 | 
			
		||||
import { Observable, interval, Subject } from 'rxjs';
 | 
			
		||||
import { debounce, throttle } from 'rxjs/operators';
 | 
			
		||||
import { toLonLat } from 'ol/proj';
 | 
			
		||||
import { ClipboardService } from 'ngx-clipboard';
 | 
			
		||||
import { toStringHDMS } from 'ol/coordinate';
 | 
			
		||||
import { ClipboardService } from 'ngx-clipboard'
 | 
			
		||||
import { GeoJSON, WKT } from 'ol/format';
 | 
			
		||||
import { WKT } from 'ol/format';
 | 
			
		||||
import { Point } from 'ol/geom';
 | 
			
		||||
import { toLonLat } from 'ol/proj';
 | 
			
		||||
import { Observable, Subject, interval } from 'rxjs';
 | 
			
		||||
import { throttle } from 'rxjs/operators';
 | 
			
		||||
import * as mapActions from '../../../actions/map.actions';
 | 
			
		||||
import { ILayervalue } from '../../../models/layer.value';
 | 
			
		||||
import * as mapReducers from '../../../reducers/map.reducer';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'fm-map-layer-values',
 | 
			
		||||
@@ -45,7 +44,7 @@ export class LayerValuesComponent implements OnInit, AfterViewInit {
 | 
			
		||||
    this.map.instance.on('moveend', () => {
 | 
			
		||||
      this.moveEndSubject.next({});
 | 
			
		||||
    });
 | 
			
		||||
    this.moveEndSubject.pipe(throttle(ev => interval(100))).subscribe(() => this.updateValuesLocation());
 | 
			
		||||
    this.moveEndSubject.pipe(throttle(() => interval(100))).subscribe(() => this.updateValuesLocation());
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  updateValuesLocation() {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
import { Component, OnInit, Input, Host, OnChanges, SimpleChanges,ChangeDetectorRef } from '@angular/core';
 | 
			
		||||
import { ChangeDetectorRef, Component, Host, Input, OnChanges, OnInit } from '@angular/core';
 | 
			
		||||
import { MapComponent } from 'ng-openlayers';
 | 
			
		||||
import {IMapState} from '../../../models/map.state'
 | 
			
		||||
import {View} from 'ol';
 | 
			
		||||
import { View } from 'ol';
 | 
			
		||||
import { fromLonLat } from 'ol/proj';
 | 
			
		||||
import { IMapState } from '../../../models/map.state';
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
@@ -29,7 +29,7 @@ export class PanToLocation  implements OnInit,OnChanges{
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  ngOnChanges(changes: SimpleChanges) {
 | 
			
		||||
  ngOnChanges() {
 | 
			
		||||
    // if (changes.position && this.instance) {
 | 
			
		||||
    //   var p = changes.position.currentValue as Position;
 | 
			
		||||
    //   this.instance.setPosition(fromLonLat([p.coords.longitude, p.coords.latitude]));
 | 
			
		||||
@@ -64,17 +64,17 @@ export class PanToLocation  implements OnInit,OnChanges{
 | 
			
		||||
      const newCenter = fromLonLat([this.position.coords.longitude,this.position.coords.latitude]);
 | 
			
		||||
      const extent = [newCenter[0]-500,newCenter[1]-500,newCenter[0]+500,newCenter[1]+500];
 | 
			
		||||
      const options = { padding: [0, 0, 0, 0],minResolution:1 };
 | 
			
		||||
      const size = this.map.instance.getSize();
 | 
			
		||||
      const rem = parseFloat(getComputedStyle(document.documentElement).fontSize);
 | 
			
		||||
      const threshold = 44 * rem;
 | 
			
		||||
      let left = 1 * rem;
 | 
			
		||||
      const right = 1 * rem;
 | 
			
		||||
      let bottom = Math.round(size[1] / 2);
 | 
			
		||||
      const top = 1 * rem;
 | 
			
		||||
      if (size[0] > threshold) {
 | 
			
		||||
        bottom = 1 * rem;
 | 
			
		||||
        left = 23 * rem;
 | 
			
		||||
      }
 | 
			
		||||
      //const size = this.map.instance.getSize();
 | 
			
		||||
      //const rem = parseFloat(getComputedStyle(document.documentElement).fontSize);
 | 
			
		||||
      //const threshold = 44 * rem;
 | 
			
		||||
      //let left = 1 * rem;
 | 
			
		||||
      //const right = 1 * rem;
 | 
			
		||||
      //let bottom = Math.round(size[1] / 2);
 | 
			
		||||
      //const top = 1 * rem;
 | 
			
		||||
      //if (size[0] > threshold) {
 | 
			
		||||
      //  bottom = 1 * rem;
 | 
			
		||||
      //  left = 23 * rem;
 | 
			
		||||
      //}
 | 
			
		||||
      //options.padding = [top, right, bottom, left];
 | 
			
		||||
      if (this.animate) options["duration"] = 2000;
 | 
			
		||||
      view.fit(extent, options);  
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
import { Component, Host, Input, OnInit, ChangeDetectorRef  } from '@angular/core';
 | 
			
		||||
import { ViewComponent, MapComponent } from 'ng-openlayers';
 | 
			
		||||
import { ChangeDetectorRef, Component, OnInit } from '@angular/core';
 | 
			
		||||
import { MapComponent } from 'ng-openlayers';
 | 
			
		||||
 | 
			
		||||
import {View} from 'ol';
 | 
			
		||||
import { View } from 'ol';
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
import { Component, Host, Input, OnInit, OnChanges, SimpleChanges, forwardRef } from '@angular/core';
 | 
			
		||||
import { ActivatedRoute  } from '@angular/router';
 | 
			
		||||
import { ViewComponent, MapComponent } from 'ng-openlayers';
 | 
			
		||||
import { Component, Host, Input, OnChanges } from '@angular/core';
 | 
			
		||||
import { ActivatedRoute } from '@angular/router';
 | 
			
		||||
import { MapComponent, ViewComponent } from 'ng-openlayers';
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@Component({
 | 
			
		||||
@@ -30,7 +30,7 @@ export class ZoomToExtentComponent implements OnChanges {
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  ngOnChanges(changes: SimpleChanges) {
 | 
			
		||||
  ngOnChanges() {
 | 
			
		||||
    if (this.extent) {
 | 
			
		||||
      const options = { padding: [0, 0, 0, 0],minResolution:1 };
 | 
			
		||||
      const size = this.map.instance.getSize();
 | 
			
		||||
 
 | 
			
		||||
@@ -1,13 +1,13 @@
 | 
			
		||||
import { Component, Input, OnInit, ComponentFactoryResolver, ViewChild, SimpleChanges, ComponentFactory, Inject} from '@angular/core';
 | 
			
		||||
import { Feature } from 'ol';
 | 
			
		||||
import { Geometry} from 'ol/geom';
 | 
			
		||||
import { FeatureListComponent,AbstractFeatureListComponent } from '../feature-list/feature-list.component';
 | 
			
		||||
import { WidgetHostDirective } from '../widget-host/widget-host.directive';
 | 
			
		||||
import  {IQueryState,PackageService } from '@farmmaps/common';
 | 
			
		||||
import * as mapReducers from '../../reducers/map.reducer';
 | 
			
		||||
import * as mapActions from '../../actions/map.actions';
 | 
			
		||||
import { Component, ComponentFactory, ComponentFactoryResolver, Inject, Input, SimpleChanges, ViewChild } from '@angular/core';
 | 
			
		||||
import { IQueryState } from '@farmmaps/common';
 | 
			
		||||
import { Store } from '@ngrx/store';
 | 
			
		||||
import { Feature } from 'ol';
 | 
			
		||||
import { Geometry } from 'ol/geom';
 | 
			
		||||
import { Observable } from 'rxjs';
 | 
			
		||||
import * as mapActions from '../../actions/map.actions';
 | 
			
		||||
import * as mapReducers from '../../reducers/map.reducer';
 | 
			
		||||
import { AbstractFeatureListComponent, FeatureListComponent } from '../feature-list/feature-list.component';
 | 
			
		||||
import { WidgetHostDirective } from '../widget-host/widget-host.directive';
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
@@ -17,7 +17,7 @@ import { Observable } from 'rxjs';
 | 
			
		||||
})
 | 
			
		||||
export class FeatureListContainerComponent {
 | 
			
		||||
 | 
			
		||||
  constructor(private store: Store<mapReducers.State>,private componentFactoryResolver: ComponentFactoryResolver, @Inject(AbstractFeatureListComponent) public featureLists: AbstractFeatureListComponent[],private packageService:PackageService ) {
 | 
			
		||||
  constructor(private store: Store<mapReducers.State>,private componentFactoryResolver: ComponentFactoryResolver, @Inject(AbstractFeatureListComponent) public featureLists: AbstractFeatureListComponent[]) {
 | 
			
		||||
    this.featureLists = [...this.featureLists].reverse();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -5,7 +5,7 @@
 | 
			
		||||
    <h3>{{schemeItem.name}}</h3>
 | 
			
		||||
    <div *ngIf="features;let features">
 | 
			
		||||
        <div class="cropfields">
 | 
			
		||||
          <div class="row m-0 ps-3 pe-3" *ngFor="let feature of features" [ngClass]="{'selected':isFeatureSelected(feature)}" (click)="handleFeatureClick(feature)" (mouseenter)="handleFeatureMouseEnter(feature)" (mouseleave)="handleFeatureMouseLeave(feature)">
 | 
			
		||||
          <div class="row m-0 ps-3 pe-3" *ngFor="let feature of features" [ngClass]="{'selected':isFeatureSelected(feature)}" (click)="handleFeatureClick(feature)" (mouseenter)="handleFeatureMouseEnter(feature)" (mouseleave)="handleFeatureMouseLeave()">
 | 
			
		||||
          <fm-map-feature-list-feature-container [feature]="feature"></fm-map-feature-list-feature-container>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,12 +1,12 @@
 | 
			
		||||
import { Component, Injectable,AfterViewInit, OnInit,SimpleChanges, ChangeDetectorRef} from '@angular/core';
 | 
			
		||||
import { Location } from '@angular/common';
 | 
			
		||||
import { AbstractFeatureListComponent } from '../feature-list/feature-list.component';
 | 
			
		||||
import {ForItemType } from '../for-item/for-itemtype.decorator';
 | 
			
		||||
import {ForChild } from '../for-item/for-child.decorator';
 | 
			
		||||
import { Component, Injectable, OnInit } from '@angular/core';
 | 
			
		||||
import { IItem, ItemService, ItemTypeService, commonReducers } from '@farmmaps/common';
 | 
			
		||||
import { Store } from '@ngrx/store';
 | 
			
		||||
import * as mapReducers from '../../reducers/map.reducer';
 | 
			
		||||
import { commonReducers, ItemTypeService, IItem,ItemService } from '@farmmaps/common';
 | 
			
		||||
import { Observable } from 'rxjs';
 | 
			
		||||
import * as mapReducers from '../../reducers/map.reducer';
 | 
			
		||||
import { AbstractFeatureListComponent } from '../feature-list/feature-list.component';
 | 
			
		||||
import { ForChild } from '../for-item/for-child.decorator';
 | 
			
		||||
import { ForItemType } from '../for-item/for-itemtype.decorator';
 | 
			
		||||
 | 
			
		||||
@ForChild()
 | 
			
		||||
@ForItemType("vnd.farmmaps.itemtype.cropfield")
 | 
			
		||||
 
 | 
			
		||||
@@ -4,7 +4,7 @@
 | 
			
		||||
      <h3><i class="far fa-farm"></i> <span i18n>Farms</span></h3>
 | 
			
		||||
      <div *ngIf="features;let features">
 | 
			
		||||
      <div class="farms">
 | 
			
		||||
        <div class="row m-0 ps-3 pe-3" *ngFor="let feature of features"[ngClass]="{'selected':isFeatureSelected(feature)}" (click)="handleFeatureClick(feature)" (mouseenter)="handleFeatureMouseEnter(feature)" (mouseleave)="handleFeatureMouseLeave(feature)">
 | 
			
		||||
        <div class="row m-0 ps-3 pe-3" *ngFor="let feature of features"[ngClass]="{'selected':isFeatureSelected(feature)}" (click)="handleFeatureClick(feature)" (mouseenter)="handleFeatureMouseEnter(feature)" (mouseleave)="handleFeatureMouseLeave()">
 | 
			
		||||
          <fm-map-feature-list-feature-container [feature]="feature"></fm-map-feature-list-feature-container>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>      
 | 
			
		||||
 
 | 
			
		||||
@@ -1,15 +1,14 @@
 | 
			
		||||
import { Component, Injectable } from '@angular/core';
 | 
			
		||||
import { Location } from '@angular/common';
 | 
			
		||||
import { Component, Injectable } from '@angular/core';
 | 
			
		||||
import { ItemTypeService, commonReducers } from '@farmmaps/common';
 | 
			
		||||
import { Action, Store } from '@ngrx/store';
 | 
			
		||||
import { Feature } from 'ol';
 | 
			
		||||
import { Geometry } from 'ol/geom';
 | 
			
		||||
import { tassign } from 'tassign';
 | 
			
		||||
import * as mapActions from '../../actions/map.actions';
 | 
			
		||||
import * as mapReducers from '../../reducers/map.reducer';
 | 
			
		||||
import { AbstractFeatureListComponent } from '../feature-list/feature-list.component';
 | 
			
		||||
import { ForItemType } from '../for-item/for-itemtype.decorator';
 | 
			
		||||
import { Store,Action } from '@ngrx/store';
 | 
			
		||||
import * as mapReducers from '../../reducers/map.reducer';
 | 
			
		||||
import { commonReducers, ItemTypeService } from '@farmmaps/common';
 | 
			
		||||
import * as mapActions from '../../actions/map.actions';
 | 
			
		||||
import { tassign } from 'tassign';
 | 
			
		||||
import { Router } from '@angular/router';
 | 
			
		||||
import { Feature } from 'ol';
 | 
			
		||||
import { Geometry} from 'ol/geom';
 | 
			
		||||
 | 
			
		||||
@ForItemType("vnd.farmmaps.itemtype.croppingscheme")
 | 
			
		||||
@Injectable()
 | 
			
		||||
@@ -20,7 +19,7 @@ import { Geometry} from 'ol/geom';
 | 
			
		||||
})
 | 
			
		||||
export class FeatureListCroppingschemeComponent extends AbstractFeatureListComponent {
 | 
			
		||||
 | 
			
		||||
    constructor(store: Store<mapReducers.State | commonReducers.State>, itemTypeService: ItemTypeService, location: Location, private router: Router) {
 | 
			
		||||
    constructor(store: Store<mapReducers.State | commonReducers.State>, itemTypeService: ItemTypeService, location: Location) {
 | 
			
		||||
        super(store, itemTypeService, location);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
import { Component, Input, OnInit, ComponentFactoryResolver, ViewChild, SimpleChanges, ComponentFactory, Inject, Type} from '@angular/core';
 | 
			
		||||
import { Component, ComponentFactory, ComponentFactoryResolver, Inject, Input, SimpleChanges, ViewChild } from '@angular/core';
 | 
			
		||||
import { Feature } from 'ol';
 | 
			
		||||
import { Geometry } from 'ol/geom';
 | 
			
		||||
import { AbstractFeatureListFeatureComponent,FeatureListFeatureComponent } from '../feature-list-feature/feature-list-feature.component';
 | 
			
		||||
import { AbstractFeatureListFeatureComponent, FeatureListFeatureComponent } from '../feature-list-feature/feature-list-feature.component';
 | 
			
		||||
import { WidgetHostDirective } from '../widget-host/widget-host.directive';
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,12 +1,12 @@
 | 
			
		||||
import { Component, Injectable,ViewChild,AfterViewInit} from '@angular/core';
 | 
			
		||||
import { Component, Injectable } from '@angular/core';
 | 
			
		||||
import { AppConfig, ItemTypeService, commonReducers } from '@farmmaps/common';
 | 
			
		||||
import { Store } from '@ngrx/store';
 | 
			
		||||
import { Feature } from 'ol';
 | 
			
		||||
import { Geometry } from 'ol/geom';
 | 
			
		||||
import { Store } from '@ngrx/store';
 | 
			
		||||
import { getArea } from 'ol/sphere';
 | 
			
		||||
import * as mapReducers from '../../reducers/map.reducer';
 | 
			
		||||
import { commonReducers,ItemTypeService,AppConfig } from '@farmmaps/common';
 | 
			
		||||
import { AbstractFeatureListFeatureComponent } from '../feature-list-feature/feature-list-feature.component';
 | 
			
		||||
import { ForItemType } from '../for-item/for-itemtype.decorator';
 | 
			
		||||
import {getArea} from 'ol/sphere';
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,7 @@
 | 
			
		||||
import { Component, Input, Injectable} from '@angular/core';
 | 
			
		||||
import { Feature } from 'ol';
 | 
			
		||||
import { Component, Injectable } from '@angular/core';
 | 
			
		||||
import { AppConfig, ItemTypeService, commonReducers } from '@farmmaps/common';
 | 
			
		||||
import { Store } from '@ngrx/store';
 | 
			
		||||
import * as mapReducers from '../../reducers/map.reducer';
 | 
			
		||||
import { commonReducers,ItemTypeService,AppConfig } from '@farmmaps/common';
 | 
			
		||||
import { AbstractFeatureListFeatureComponent } from '../feature-list-feature/feature-list-feature.component';
 | 
			
		||||
import { ForItemType } from '../for-item/for-itemtype.decorator';
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
<div *ngIf="features;let features">
 | 
			
		||||
  <fm-back-button></fm-back-button>
 | 
			
		||||
  <div class="row m-0 ps-3 pe-3" *ngFor="let feature of features" [ngClass]="{'selected':isFeatureSelected(feature)}" (click)="handleFeatureClick(feature)" (mouseenter)="handleFeatureMouseEnter(feature)" (mouseleave)="handleFeatureMouseLeave(feature)">
 | 
			
		||||
  <div class="row m-0 ps-3 pe-3" *ngFor="let feature of features" [ngClass]="{'selected':isFeatureSelected(feature)}" (click)="handleFeatureClick(feature)" (mouseenter)="handleFeatureMouseEnter(feature)" (mouseleave)="handleFeatureMouseLeave()">
 | 
			
		||||
    <fm-map-feature-list-feature-container [feature]="feature"></fm-map-feature-list-feature-container>
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,15 +1,12 @@
 | 
			
		||||
import { Component, Input, Injectable,Directive,SimpleChanges } from '@angular/core';
 | 
			
		||||
import { Location } from '@angular/common';
 | 
			
		||||
import { Component, Directive, Injectable, Input } from '@angular/core';
 | 
			
		||||
import { IQueryState, ItemTypeService, commonReducers } from '@farmmaps/common';
 | 
			
		||||
import { Action, Store } from '@ngrx/store';
 | 
			
		||||
import { Feature } from 'ol';
 | 
			
		||||
import { Geometry} from 'ol/geom';
 | 
			
		||||
import { Store,Action} from '@ngrx/store';
 | 
			
		||||
import * as mapReducers from '../../reducers/map.reducer';
 | 
			
		||||
import { commonReducers,ItemTypeService, IItem, Item } from '@farmmaps/common';
 | 
			
		||||
import * as mapActions from '../../actions/map.actions';
 | 
			
		||||
import { Observable, from } from 'rxjs';
 | 
			
		||||
import { withLatestFrom } from 'rxjs/operators';
 | 
			
		||||
import { Geometry } from 'ol/geom';
 | 
			
		||||
import { tassign } from 'tassign';
 | 
			
		||||
import { IQueryState } from '@farmmaps/common';
 | 
			
		||||
import * as mapActions from '../../actions/map.actions';
 | 
			
		||||
import * as mapReducers from '../../reducers/map.reducer';
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@Injectable()
 | 
			
		||||
@@ -37,11 +34,11 @@ export abstract class AbstractFeatureListComponent {
 | 
			
		||||
      return new mapActions.DoQuery(newQuery)  
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  handleFeatureMouseEnter(feature) {
 | 
			
		||||
  handleFeatureMouseEnter(feature:Feature<Geometry>) {
 | 
			
		||||
    this.store.dispatch(new mapActions.SelectFeature(feature));
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  handleFeatureMouseLeave(feature) {
 | 
			
		||||
  handleFeatureMouseLeave() {
 | 
			
		||||
    this.store.dispatch(new mapActions.SelectFeature(null));
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
import { Component, Input, AfterViewInit, ViewChild } from '@angular/core';
 | 
			
		||||
import { Feature} from 'ol';
 | 
			
		||||
import { Geometry,Polygon,MultiPolygon } from 'ol/geom';
 | 
			
		||||
import { AfterViewInit, Component, Input, ViewChild } from '@angular/core';
 | 
			
		||||
import { Feature } from 'ol';
 | 
			
		||||
import * as extent from 'ol/extent';
 | 
			
		||||
import { Geometry, Polygon } from 'ol/geom';
 | 
			
		||||
import * as render from 'ol/render';
 | 
			
		||||
import * as style from 'ol/style';
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
import { Directive, ViewContainerRef,TemplateRef,OnInit,Input, OnChanges } from '@angular/core';
 | 
			
		||||
import { Directive, Input, OnInit, TemplateRef, ViewContainerRef } from '@angular/core';
 | 
			
		||||
import { MapComponent } from 'ng-openlayers';
 | 
			
		||||
import { Layer } from 'ol/layer';
 | 
			
		||||
import { Source } from 'ol/source';
 | 
			
		||||
import { MapComponent } from 'ng-openlayers';
 | 
			
		||||
 | 
			
		||||
@Directive({
 | 
			
		||||
  selector: '[fmMapIfZoomToShow]',
 | 
			
		||||
@@ -36,7 +36,7 @@ export class ifZoomToShowDirective  implements OnInit {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  ngOnInit() {    
 | 
			
		||||
    this.map$.instance.on('moveend', (e) => {
 | 
			
		||||
    this.map$.instance.on('moveend', () => {
 | 
			
		||||
      this.checkZoom();     
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
import { Component, Input, OnInit, ComponentFactoryResolver, ViewChild, SimpleChanges, ComponentFactory, Inject, Type} from '@angular/core';
 | 
			
		||||
import { AbstractItemListItemComponent,ItemListItemComponent } from '../item-list-item/item-list-item.component';
 | 
			
		||||
import { Component, ComponentFactory, ComponentFactoryResolver, Inject, Input, SimpleChanges, ViewChild } from '@angular/core';
 | 
			
		||||
import { IListItem } from '@farmmaps/common';
 | 
			
		||||
import { AbstractItemListItemComponent, ItemListItemComponent } from '../item-list-item/item-list-item.component';
 | 
			
		||||
import { WidgetHostDirective } from '../widget-host/widget-host.directive';
 | 
			
		||||
import { IItem, IListItem } from '@farmmaps/common';
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
@@ -27,7 +27,6 @@ export class ItemListItemContainerComponent {
 | 
			
		||||
 | 
			
		||||
    let selected = -1;
 | 
			
		||||
    let maxMatches =0;
 | 
			
		||||
    const showItem = true;
 | 
			
		||||
    for (let i = 0; i < this.itemComponentList.length; i++) {
 | 
			
		||||
      let matches=0;
 | 
			
		||||
      let criteria=0;
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
import { Component, Input, Injectable, Inject, Optional,ComponentFactoryResolver, ViewContainerRef, QueryList, ComponentFactory, ViewChildren,AfterViewInit } from '@angular/core';
 | 
			
		||||
import { Location } from '@angular/common';
 | 
			
		||||
import { AfterViewInit, Component, ComponentFactory, ComponentFactoryResolver, Inject, Injectable, Input, Optional, QueryList, ViewChildren, ViewContainerRef } from '@angular/core';
 | 
			
		||||
import { IListItem, ItemTypeService, commonReducers } from '@farmmaps/common';
 | 
			
		||||
import { Store } from '@ngrx/store';
 | 
			
		||||
import * as mapReducers from '../../reducers/map.reducer';
 | 
			
		||||
import { commonReducers,ItemTypeService, IItem, Item,IListItem } from '@farmmaps/common';
 | 
			
		||||
import { AbstractItemWidgetComponent } from '../item-list-item/item-list-item.component';
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,10 +1,10 @@
 | 
			
		||||
import { Component, OnInit,  OnChanges, SimpleChanges } from '@angular/core';
 | 
			
		||||
import {IItemLayer} from '../../models/item.layer';
 | 
			
		||||
import { Component, OnChanges, OnInit } from '@angular/core';
 | 
			
		||||
import { Store } from '@ngrx/store';
 | 
			
		||||
import * as mapReducers from '../../reducers/map.reducer';
 | 
			
		||||
import * as mapActions from '../../actions/map.actions';
 | 
			
		||||
import {createEmpty,extend } from 'ol/extent';
 | 
			
		||||
import { createEmpty, extend } from 'ol/extent';
 | 
			
		||||
import { Observable } from 'rxjs';
 | 
			
		||||
import * as mapActions from '../../actions/map.actions';
 | 
			
		||||
import { IItemLayer } from '../../models/item.layer';
 | 
			
		||||
import * as mapReducers from '../../reducers/map.reducer';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'fm-map-layer-switcher',
 | 
			
		||||
@@ -32,11 +32,9 @@ export class LayerSwitcher  implements OnInit,OnChanges{
 | 
			
		||||
    this.showLayerSwitcher = this.store.select(mapReducers.selectGetShowLayerSwitcher);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  ngOnChanges(changes: SimpleChanges) {
 | 
			
		||||
  ngOnChanges() {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  handleClick(event:Event) {
 | 
			
		||||
    event.stopPropagation();
 | 
			
		||||
    this.store.dispatch(new mapActions.ShowLayerSwitcher(true));
 | 
			
		||||
@@ -47,8 +45,6 @@ export class LayerSwitcher  implements OnInit,OnChanges{
 | 
			
		||||
    this.store.dispatch(new mapActions.ShowLayerSwitcher(false));
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  handleOnToggleVisibility(itemLayer: IItemLayer) {
 | 
			
		||||
    this.store.dispatch(new mapActions.SetVisibility(itemLayer,!itemLayer.visible));
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,5 @@
 | 
			
		||||
import {Component, Input} from '@angular/core';
 | 
			
		||||
import {IHistogram, ILayer} from '../../../models/color.map';
 | 
			
		||||
import { Component, Input } from '@angular/core';
 | 
			
		||||
import { IHistogram } from '../../../models/color.map';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'fm-map-histogram-details',
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,5 @@
 | 
			
		||||
import { Component, OnInit, Input,AfterViewInit } from '@angular/core';
 | 
			
		||||
import { IColorMap, IColor, IColorEntry,ILayer, IRenderer } from '../../models/color.map';
 | 
			
		||||
import { AfterViewInit, Component, Input, OnInit } from '@angular/core';
 | 
			
		||||
import { IColor, ILayer, IRenderer } from '../../models/color.map';
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
 
 | 
			
		||||
@@ -5,12 +5,12 @@
 | 
			
		||||
 | 
			
		||||
<div class="map-search collapsed" [ngClass]="{'collapsed':collapsedLocal,searchcollapsed:searchMinifiedLocal}" (click)="$event.stopPropagation()">
 | 
			
		||||
  <div class="card p-2">
 | 
			
		||||
    <form class="form" (ngSubmit)="handleSearch($event)">
 | 
			
		||||
    <form class="form" (ngSubmit)="handleSearch()">
 | 
			
		||||
      <div class="input-group">
 | 
			
		||||
        <button type="button" class="btn btn-outline-secondary" (click)="handleToggleMenu($event)"><i class="fal fa-bars" aria-hidden="true"></i></button>
 | 
			
		||||
        <input #searchText class="form-control" type="text" (focus)="handleFocus($event)" [ngModel]="searchTextLocal" name="searchTextLocal" (ngModelChange)="handleChange($event)" [ngbTypeahead]="search" [resultTemplate]="rt" [inputFormatter]="formatter" (selectItem)="handleSelect($event)" placeholder="Search" i18n-placeholder />
 | 
			
		||||
        <button type="button" class="btn btn-outline-secondary" (click)="handleToggleMenu()"><i class="fal fa-bars" aria-hidden="true"></i></button>
 | 
			
		||||
        <input #searchText class="form-control" type="text" (focus)="handleFocus()" [ngModel]="searchTextLocal" name="searchTextLocal" (ngModelChange)="handleChange($event)" [ngbTypeahead]="search" [resultTemplate]="rt" [inputFormatter]="formatter" (selectItem)="handleSelect($event)" placeholder="Search" i18n-placeholder />
 | 
			
		||||
        <button type="submit" class="btn btn-outline-secondary" [disabled]="disabled"><i class="fal fa-search"></i></button>
 | 
			
		||||
        <button type="button" class="clear btn btn-outline-secondary" [disabled]="!clearEnabled" (click)="handleClearClick($event)"><i class="fas fa-times"></i></button>
 | 
			
		||||
        <button type="button" class="clear btn btn-outline-secondary" [disabled]="!clearEnabled" (click)="handleClearClick()"><i class="fas fa-times"></i></button>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="options">
 | 
			
		||||
        <div class="form-check">
 | 
			
		||||
 
 | 
			
		||||
@@ -1,10 +1,9 @@
 | 
			
		||||
import { Component, Input, Output, OnInit, EventEmitter, SimpleChanges, OnChanges, ViewChild } from '@angular/core';
 | 
			
		||||
import { Observable ,  of,merge,forkJoin } from 'rxjs';
 | 
			
		||||
import { debounceTime,distinctUntilChanged,tap,switchMap,catchError,map} from 'rxjs/operators';
 | 
			
		||||
import { TypeaheadService, TimespanService } from '@farmmaps/common';
 | 
			
		||||
import { IQueryState } from '@farmmaps/common';
 | 
			
		||||
import { IPeriodState } from '../../models/period.state';
 | 
			
		||||
import { Component, EventEmitter, Input, Output, ViewChild } from '@angular/core';
 | 
			
		||||
import { IQueryState, TimespanService, TypeaheadService } from '@farmmaps/common';
 | 
			
		||||
import { Observable, forkJoin, of } from 'rxjs';
 | 
			
		||||
import { catchError, debounceTime, distinctUntilChanged, map, switchMap, tap } from 'rxjs/operators';
 | 
			
		||||
import { tassign } from 'tassign';
 | 
			
		||||
import { IPeriodState } from '../../models/period.state';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'fm-map-map-search',
 | 
			
		||||
@@ -54,7 +53,6 @@ export class MapSearchComponent {
 | 
			
		||||
  public searchMinifiedLocal = false;
 | 
			
		||||
  public periodLocal: IPeriodState = { startDate:new Date(new Date(Date.now()).getFullYear(), new Date(Date.now()).getMonth() - 3, 1), endDate:new Date(Date.now())};
 | 
			
		||||
  public filterOptionsLocal: IQueryState;
 | 
			
		||||
  private extent: number[];
 | 
			
		||||
  public searchTextLocal: any;
 | 
			
		||||
  public searchTextLocalOutput: string; 
 | 
			
		||||
  public dateFilter = true; 
 | 
			
		||||
@@ -81,12 +79,12 @@ export class MapSearchComponent {
 | 
			
		||||
          catchError(() => {
 | 
			
		||||
            this.searchFailed = true;
 | 
			
		||||
            return of([]);
 | 
			
		||||
          }),map( (sa:string[]) => sa.map((s,i) => ({"name":s,"type":"tag"})))),
 | 
			
		||||
          }),map( (sa:string[]) => sa.map((s) => ({"name":s,"type":"tag"})))),
 | 
			
		||||
          this.typeaheadService.getCityTypeaheadItems(term).pipe(
 | 
			
		||||
            catchError(() => {
 | 
			
		||||
              this.searchFailed = true;
 | 
			
		||||
              return of([]);
 | 
			
		||||
            }),map( (sa:string[]) => sa.map((s,i) => ({"name":s,"type":"city"})))),
 | 
			
		||||
            }),map( (sa:string[]) => sa.map((s) => ({"name":s,"type":"city"})))),
 | 
			
		||||
        ).pipe(map(([a1,a2]) => [...a1, ...a2] ),map(a => a.sort((a, b) => (a.name.toUpperCase() > b.name.toUpperCase()) ? 1 : -1)))
 | 
			
		||||
      ),
 | 
			
		||||
      tap(() => this.searching = false),
 | 
			
		||||
@@ -94,7 +92,7 @@ export class MapSearchComponent {
 | 
			
		||||
 | 
			
		||||
  formatter = (x: { name: string }) => x.name;
 | 
			
		||||
 | 
			
		||||
  handleSearch(event) {
 | 
			
		||||
  handleSearch() {
 | 
			
		||||
    this.filterOptionsLocal.tags = null;
 | 
			
		||||
    this.filterOptionsLocal.itemType = null;
 | 
			
		||||
    this.filterOptionsLocal.itemCode = null;
 | 
			
		||||
@@ -168,11 +166,11 @@ export class MapSearchComponent {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  handleToggleMenu(event) {
 | 
			
		||||
  handleToggleMenu() {
 | 
			
		||||
    this.onToggleMenu.emit({});
 | 
			
		||||
  }  
 | 
			
		||||
 | 
			
		||||
  handleFocus(event) {
 | 
			
		||||
  handleFocus() {
 | 
			
		||||
    this.onSearchExpand.emit({});
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@@ -187,7 +185,7 @@ export class MapSearchComponent {
 | 
			
		||||
      this.disabled = true;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  handleClearClick(event) {
 | 
			
		||||
  handleClearClick() {
 | 
			
		||||
    this.onClear.emit({});
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -61,7 +61,7 @@
 | 
			
		||||
    <fm-map-file-drop-target [parentCode]="state.parentCode" (onFileDropped)="handleFileDropped($event)"></fm-map-file-drop-target>
 | 
			
		||||
 | 
			
		||||
    <div *ngIf="noContent">
 | 
			
		||||
      <fm-map-map-search #mapSearch [openedModalName]="state.openedModalName" (onOpenModal)="handleOpenModal($event)" (onCloseModal)="handleCloseModal()" [ngClass]="{'menuVisible':state.menuVisible}" (onToggleMenu)="handleToggleMenu($event)" (onSearchCollapse)="handleSearchCollapse($event)" (onSearchExpand)="handleSearchExpand($event)" [collapsed]="state.searchCollapsed" [searchMinified]="state.searchMinified" (onSearch)="handleSearch($event)" (onClear)="handleClearSearch($event)" [filterOptions]="state.queryState" [clearEnabled]="state.clearEnabled" [period]="state.period" (onPeriodChange)="handlePeriodChange($event)" (onCitySearch)="handleCitySearch($event)"></fm-map-map-search>
 | 
			
		||||
      <fm-map-map-search #mapSearch [openedModalName]="state.openedModalName" (onOpenModal)="handleOpenModal($event)" (onCloseModal)="handleCloseModal()" [ngClass]="{'menuVisible':state.menuVisible}" (onToggleMenu)="handleToggleMenu()" (onSearchCollapse)="handleSearchCollapse()" (onSearchExpand)="handleSearchExpand()" [collapsed]="state.searchCollapsed" [searchMinified]="state.searchMinified" (onSearch)="handleSearch($event)" (onClear)="handleClearSearch()" [filterOptions]="state.queryState" [clearEnabled]="state.clearEnabled" [period]="state.period" (onPeriodChange)="handlePeriodChange($event)" (onCitySearch)="handleCitySearch($event)"></fm-map-map-search>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="side-panel-container">
 | 
			
		||||
      
 | 
			
		||||
 
 | 
			
		||||
@@ -1,42 +1,29 @@
 | 
			
		||||
import { Component, OnInit, OnDestroy, HostListener, ViewChild, AfterViewInit,NgZone,ElementRef } from '@angular/core';
 | 
			
		||||
import { Location } from '@angular/common';
 | 
			
		||||
import { Observable, Subject, Subscription, from,of ,EMPTY } from 'rxjs';
 | 
			
		||||
import { withLatestFrom, switchMap,skip  } from 'rxjs/operators';
 | 
			
		||||
import { Router, ActivatedRoute, ParamMap } from '@angular/router';
 | 
			
		||||
/* eslint-disable no-prototype-builtins */
 | 
			
		||||
import { AfterViewInit, Component, ElementRef, HostListener, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core';
 | 
			
		||||
import { ActivatedRoute, ParamMap, Router } from '@angular/router';
 | 
			
		||||
import { DeviceService, GeolocatorService, IItem, IItemType, IQueryState, ItemTypeService, ResumableFileUploadService, StateSerializerService, commonActions, commonReducers } from '@farmmaps/common';
 | 
			
		||||
import { Store } from '@ngrx/store';
 | 
			
		||||
import { DeviceService } from '@farmmaps/common';
 | 
			
		||||
import {getRenderPixel} from 'ol/render';
 | 
			
		||||
 | 
			
		||||
// Map
 | 
			
		||||
import * as mapReducers from '../../reducers/map.reducer';
 | 
			
		||||
import * as mapActions from '../../actions/map.actions';
 | 
			
		||||
import { IMapState} from '../../models/map.state';
 | 
			
		||||
import { IClickedFeature} from '../../models/clicked.feature';
 | 
			
		||||
import { IQuery } from '../../reducers/map.reducer'
 | 
			
		||||
import { ISelectedFeatures } from '../../models/selected.features';
 | 
			
		||||
import { IItemLayer } from '../../models/item.layer';
 | 
			
		||||
import { IListItem, IQueryState } from '@farmmaps/common';
 | 
			
		||||
import { IPeriodState } from '../../models/period.state';
 | 
			
		||||
import {IStyles} from '../../models/style.cache';
 | 
			
		||||
import { IDroppedFile } from '../aol/file-drop-target/file-drop-target.component';
 | 
			
		||||
import { StateSerializerService } from '@farmmaps/common';
 | 
			
		||||
import { GeolocationService} from '../../services/geolocation.service';
 | 
			
		||||
import { GeolocatorService } from '@farmmaps/common';
 | 
			
		||||
import {DeviceOrientationService} from '../../services/device-orientation.service';
 | 
			
		||||
 | 
			
		||||
// AppCommon
 | 
			
		||||
import { ResumableFileUploadService, ItemTypeService } from '@farmmaps/common';
 | 
			
		||||
import { IItemType, IItem } from '@farmmaps/common';
 | 
			
		||||
import {commonReducers} from '@farmmaps/common';
 | 
			
		||||
import {commonActions} from '@farmmaps/common';
 | 
			
		||||
 | 
			
		||||
import {Feature} from 'ol';
 | 
			
		||||
import {Geometry,Point,Circle} from 'ol/geom';
 | 
			
		||||
import {Extent,createEmpty,extend } from 'ol/extent';
 | 
			
		||||
import {transform} from 'ol/proj';
 | 
			
		||||
import { tassign } from 'tassign';
 | 
			
		||||
import { Feature } from 'ol';
 | 
			
		||||
import { Extent, createEmpty, extend } from 'ol/extent';
 | 
			
		||||
import { Circle, Geometry, Point } from 'ol/geom';
 | 
			
		||||
import { transform } from 'ol/proj';
 | 
			
		||||
import { getRenderPixel } from 'ol/render';
 | 
			
		||||
import * as style from 'ol/style';
 | 
			
		||||
 | 
			
		||||
import { EMPTY, Observable, Subject, Subscription, from, of } from 'rxjs';
 | 
			
		||||
import { skip, switchMap, withLatestFrom } from 'rxjs/operators';
 | 
			
		||||
import { tassign } from 'tassign';
 | 
			
		||||
import * as mapActions from '../../actions/map.actions';
 | 
			
		||||
import { IClickedFeature } from '../../models/clicked.feature';
 | 
			
		||||
import { IItemLayer } from '../../models/item.layer';
 | 
			
		||||
import { IMapState } from '../../models/map.state';
 | 
			
		||||
import { IPeriodState } from '../../models/period.state';
 | 
			
		||||
import { ISelectedFeatures } from '../../models/selected.features';
 | 
			
		||||
import { IStyles } from '../../models/style.cache';
 | 
			
		||||
import * as mapReducers from '../../reducers/map.reducer';
 | 
			
		||||
import { IQuery } from '../../reducers/map.reducer';
 | 
			
		||||
import { DeviceOrientationService } from '../../services/device-orientation.service';
 | 
			
		||||
import { GeolocationService } from '../../services/geolocation.service';
 | 
			
		||||
import { IDroppedFile } from '../aol/file-drop-target/file-drop-target.component';
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
  selector: 'fm-map-map',
 | 
			
		||||
@@ -106,7 +93,6 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
 | 
			
		||||
    private uploadService: ResumableFileUploadService,
 | 
			
		||||
    private serializeService: StateSerializerService,
 | 
			
		||||
    public itemTypeService: ItemTypeService,
 | 
			
		||||
    private location: Location,
 | 
			
		||||
    private geolocationService: GeolocationService,
 | 
			
		||||
    private geolocaterService: GeolocatorService,
 | 
			
		||||
    private zone: NgZone,
 | 
			
		||||
@@ -389,15 +375,15 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  handleSearchCollapse(event) {
 | 
			
		||||
  handleSearchCollapse() {
 | 
			
		||||
    this.store.dispatch(new mapActions.CollapseSearch());
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  handleSearchExpand(event) {
 | 
			
		||||
  handleSearchExpand() {
 | 
			
		||||
    this.store.dispatch(new mapActions.ExpandSearch());
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  handleToggleMenu(event) {
 | 
			
		||||
  handleToggleMenu() {
 | 
			
		||||
    this.store.dispatch(new commonActions.ToggleMenu());
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@@ -478,11 +464,11 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  handleOnDownload(event) {
 | 
			
		||||
  handleOnDownload() {
 | 
			
		||||
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  handleClearSearch(event) {
 | 
			
		||||
  handleClearSearch() {
 | 
			
		||||
    this.store.dispatch(new mapActions.Clear());
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,5 @@
 | 
			
		||||
<ng-template #content let-c="close" let-d="dismiss">
 | 
			
		||||
  <form [formGroup]="metaDataForm" (ngSubmit)="handleMetaDataEntered($event)">
 | 
			
		||||
  <form [formGroup]="metaDataForm" (ngSubmit)="handleMetaDataEntered()">
 | 
			
		||||
    <div class="modal-header">
 | 
			
		||||
      <h4 class="modal-title" i18n>Add metadata</h4>
 | 
			
		||||
      <button type="button" class="close" aria-label="Close" (click)="d('Cross click'); onCloseModal.emit()">
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
import { Component, Output, ViewChild, EventEmitter, Input, ElementRef, HostListener } from '@angular/core';
 | 
			
		||||
import { UntypedFormGroup,UntypedFormBuilder, Validators } from '@angular/forms';
 | 
			
		||||
import { Component, ElementRef, EventEmitter, Input, Output, ViewChild } from '@angular/core';
 | 
			
		||||
import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
 | 
			
		||||
import { IListItem } from '@farmmaps/common';
 | 
			
		||||
import { NgbModal, NgbModalRef } from "@ng-bootstrap/ng-bootstrap";
 | 
			
		||||
import { IDroppedFile } from '../aol/file-drop-target/file-drop-target.component';
 | 
			
		||||
import {NgbModal, NgbModalRef} from "@ng-bootstrap/ng-bootstrap";
 | 
			
		||||
 | 
			
		||||
export interface IMetaData {
 | 
			
		||||
  droppedFile: IDroppedFile,
 | 
			
		||||
@@ -37,7 +37,7 @@ export class MetaDataModalComponent {
 | 
			
		||||
 | 
			
		||||
  public metaDataForm: UntypedFormGroup;
 | 
			
		||||
 | 
			
		||||
  handleMetaDataEntered(event) {
 | 
			
		||||
  handleMetaDataEntered() {
 | 
			
		||||
    if (this.metaDataForm.valid) {
 | 
			
		||||
      this.onAddFilesWithMetaData.emit({ droppedFile: this.droppedFile, attributes: { name: this.metaDataForm.value.name } });
 | 
			
		||||
    }
 | 
			
		||||
@@ -48,7 +48,7 @@ export class MetaDataModalComponent {
 | 
			
		||||
      setTimeout(() => this.modalRef = this.modalService.open(this._templateModal, { backdrop: 'static', keyboard: false }));     
 | 
			
		||||
  }  
 | 
			
		||||
 | 
			
		||||
  closeModal()  {
 | 
			
		||||
  closeModal() {
 | 
			
		||||
      this.modalRef.close();
 | 
			
		||||
      this.metaDataForm.patchValue({ name: "" });
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,6 @@
 | 
			
		||||
import { Component, Output, ViewChild, EventEmitter, Input, ElementRef, HostListener } from '@angular/core';
 | 
			
		||||
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
 | 
			
		||||
import { NgbModal, NgbModalRef, NgbDateStruct, NgbCalendar, NgbDateAdapter } from "@ng-bootstrap/ng-bootstrap";
 | 
			
		||||
import { Component, ElementRef, EventEmitter, Input, Output, ViewChild } from '@angular/core';
 | 
			
		||||
import { NgbDateNativeAdapter } from '@farmmaps/common';
 | 
			
		||||
import { NgbDateStruct, NgbModal, NgbModalRef } from "@ng-bootstrap/ng-bootstrap";
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
const equals = (one: NgbDateStruct, two: NgbDateStruct) =>
 | 
			
		||||
@@ -52,7 +51,7 @@ export class SelectPeriodModalComponent {
 | 
			
		||||
  @Output() onCloseModal = new EventEmitter<any>();
 | 
			
		||||
  @Output() onSelect = new EventEmitter<{ startDate: Date, endDate: Date }>();
 | 
			
		||||
  
 | 
			
		||||
  constructor(private modalService: NgbModal, private calendar: NgbCalendar) { }
 | 
			
		||||
  constructor(private modalService: NgbModal) { }
 | 
			
		||||
 | 
			
		||||
  openModal() {
 | 
			
		||||
      //Timeout trick to avoid ExpressionChangedAfterItHasBeenCheckedError 
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
import { Component, Input, OnInit, ComponentFactoryResolver, ViewChild, SimpleChanges, ComponentFactory, Inject, Type} from '@angular/core';
 | 
			
		||||
import { Component, ComponentFactory, ComponentFactoryResolver, Inject, Input, SimpleChanges, ViewChild } from '@angular/core';
 | 
			
		||||
import { IItem } from '@farmmaps/common';
 | 
			
		||||
import { AbstractSelectedItemComponent, SelectedItemComponent  } from '../selected-item/selected-item.component';
 | 
			
		||||
import { WidgetHostDirective } from '../widget-host/widget-host.directive';
 | 
			
		||||
import { IItemLayer } from '../../models/item.layer';
 | 
			
		||||
import { AbstractSelectedItemComponent, SelectedItemComponent } from '../selected-item/selected-item.component';
 | 
			
		||||
import { WidgetHostDirective } from '../widget-host/widget-host.directive';
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@Component({
 | 
			
		||||
@@ -28,7 +28,6 @@ export class SelectedItemContainerComponent {
 | 
			
		||||
 | 
			
		||||
    let selected = -1;
 | 
			
		||||
    let maxMatches =0;
 | 
			
		||||
    const showItem = true;
 | 
			
		||||
    for (let i = 0; i < this.selectedItemComponents.length; i++) {
 | 
			
		||||
      let matches=0;
 | 
			
		||||
      let criteria=0;
 | 
			
		||||
 
 | 
			
		||||
@@ -1,16 +1,15 @@
 | 
			
		||||
import { Component, Input, Injectable, OnInit } from '@angular/core';
 | 
			
		||||
import { Location } from '@angular/common';
 | 
			
		||||
import { Feature } from 'ol';
 | 
			
		||||
import { Component, Inject, Injectable, OnInit } from '@angular/core';
 | 
			
		||||
import { Router } from '@angular/router';
 | 
			
		||||
import { FolderService, IItem, IListItem, ItemService, ItemTypeService, commonReducers } from '@farmmaps/common';
 | 
			
		||||
import { Store } from '@ngrx/store';
 | 
			
		||||
import { GeoJSON } from 'ol/format';
 | 
			
		||||
import { getArea } from 'ol/sphere';
 | 
			
		||||
import { Observable, of } from 'rxjs';
 | 
			
		||||
import { combineLatest, switchMap } from 'rxjs/operators';
 | 
			
		||||
import * as mapReducers from '../../reducers/map.reducer';
 | 
			
		||||
import { commonReducers, ItemTypeService, IItem, Item, ItemService, FolderService, IListItem} from '@farmmaps/common';
 | 
			
		||||
import { Router, ActivatedRoute, ParamMap, Event } from '@angular/router';
 | 
			
		||||
import { ForItemType } from '../for-item/for-itemtype.decorator';
 | 
			
		||||
import { AbstractSelectedItemComponent } from '../selected-item/selected-item.component';
 | 
			
		||||
import { Observable,of } from 'rxjs';
 | 
			
		||||
import {GeoJSON} from 'ol/format';
 | 
			
		||||
import {getArea} from 'ol/sphere';
 | 
			
		||||
import { withLatestFrom,switchMap,combineLatest } from 'rxjs/operators';
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ForItemType("vnd.farmmaps.itemtype.cropfield")
 | 
			
		||||
@@ -24,7 +23,7 @@ export class SelectedItemCropfieldComponent extends AbstractSelectedItemComponen
 | 
			
		||||
 | 
			
		||||
  public items: Observable<IListItem[]>;
 | 
			
		||||
 | 
			
		||||
  constructor(store: Store<mapReducers.State | commonReducers.State>, itemTypeService: ItemTypeService, location: Location, router: Router, private itemService$: ItemService,private folderService$: FolderService) {
 | 
			
		||||
  constructor(store: Store<mapReducers.State | commonReducers.State>, @Inject('itemTypeService') itemTypeService: ItemTypeService, location: Location, router: Router, @Inject('itemService$') private itemService$: ItemService,@Inject('folderService$') private folderService$: FolderService) {
 | 
			
		||||
    super(store, itemTypeService,location,router);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,12 +1,12 @@
 | 
			
		||||
import { Component, Injectable } from '@angular/core';
 | 
			
		||||
import { Location } from '@angular/common';
 | 
			
		||||
import { Store } from '@ngrx/store';
 | 
			
		||||
import * as mapReducers from '../../reducers/map.reducer';
 | 
			
		||||
import { commonReducers, ItemTypeService, ItemService, FolderService } from '@farmmaps/common';
 | 
			
		||||
import { Component, Inject, Injectable } from '@angular/core';
 | 
			
		||||
import { Router } from '@angular/router';
 | 
			
		||||
import { ItemTypeService, commonReducers } from '@farmmaps/common';
 | 
			
		||||
import { Store } from '@ngrx/store';
 | 
			
		||||
import * as mapActions from '../../actions/map.actions';
 | 
			
		||||
import * as mapReducers from '../../reducers/map.reducer';
 | 
			
		||||
import { ForItemType } from '../for-item/for-itemtype.decorator';
 | 
			
		||||
import { AbstractSelectedItemComponent } from '../selected-item/selected-item.component';
 | 
			
		||||
import * as mapActions from '../../actions/map.actions';
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ForItemType("vnd.farmmaps.itemtype.geotiff.processed")
 | 
			
		||||
@@ -18,7 +18,7 @@ import * as mapActions from '../../actions/map.actions';
 | 
			
		||||
})
 | 
			
		||||
export class SelectedItemGeotiffComponent extends AbstractSelectedItemComponent {
 | 
			
		||||
 | 
			
		||||
  constructor(store: Store<mapReducers.State | commonReducers.State>, itemTypeService: ItemTypeService, location: Location, router: Router, private itemService$: ItemService,private folderService$: FolderService) {
 | 
			
		||||
  constructor(store: Store<mapReducers.State | commonReducers.State>, @Inject('itemTypeService') itemTypeService: ItemTypeService, location: Location, router: Router) {
 | 
			
		||||
    super(store, itemTypeService,location,router);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,14 +1,12 @@
 | 
			
		||||
import { Component, Input, Injectable, OnInit } from '@angular/core';
 | 
			
		||||
import { Location } from '@angular/common';
 | 
			
		||||
import { Feature } from 'ol';
 | 
			
		||||
import { Component, Injectable } from '@angular/core';
 | 
			
		||||
import { Router } from '@angular/router';
 | 
			
		||||
import { ItemTypeService, commonReducers } from '@farmmaps/common';
 | 
			
		||||
import { Store } from '@ngrx/store';
 | 
			
		||||
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 * as mapReducers from '../../reducers/map.reducer';
 | 
			
		||||
import { ForItemType } from '../for-item/for-itemtype.decorator';
 | 
			
		||||
import { AbstractSelectedItemComponent } from '../selected-item/selected-item.component';
 | 
			
		||||
import { Observable } from 'rxjs';
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ForItemType("vnd.farmmaps.itemtype.shape.processed")
 | 
			
		||||
@@ -20,7 +18,7 @@ import { Observable } from 'rxjs';
 | 
			
		||||
})
 | 
			
		||||
export class SelectedItemShapeComponent extends AbstractSelectedItemComponent {
 | 
			
		||||
 | 
			
		||||
  constructor(store: Store<mapReducers.State | commonReducers.State>, 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) {
 | 
			
		||||
    super(store, itemTypeService,location,router);
 | 
			
		||||
  }
 | 
			
		||||
  public selectedLayer = 0;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user