Compare commits
27 Commits
develop
...
f66187d3a2
| Author | SHA1 | Date | |
|---|---|---|---|
| f66187d3a2 | |||
|
|
df0d13e5dd | ||
|
|
b347220dd4 | ||
|
|
edeadef96f | ||
|
|
267a299589 | ||
|
|
134220d75f | ||
|
|
80ef4ed6fe | ||
|
|
d21f304081 | ||
| 2bad3274fd | |||
|
|
31d3e58062 | ||
| 0231421cef | |||
|
|
f2c133e9bd | ||
|
|
1274d96f1d | ||
| 35ccb4f4c5 | |||
|
|
47fbc5eab9 | ||
| 564d08b5b9 | |||
| 7e17a49dc6 | |||
|
|
3f286ee042 | ||
| 747499d009 | |||
|
|
c4f4a4f61e | ||
| 6b095b7f49 | |||
| b2791eb80b | |||
|
|
4c93a9f766 | ||
| 93554bc7c4 | |||
| d074cd81cf | |||
| 87547aafcc | |||
| 6ab5ba8a56 |
12
package-lock.json
generated
12
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "farmmaps-lib-app",
|
||||
"version": "4.19.0",
|
||||
"version": "4.18.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "farmmaps-lib-app",
|
||||
"version": "4.19.0",
|
||||
"version": "4.18.0",
|
||||
"dependencies": {
|
||||
"@angular-eslint/eslint-plugin": "^18.2.0",
|
||||
"@angular/animations": "18.2.3",
|
||||
@@ -90,7 +90,7 @@
|
||||
},
|
||||
"dist/common": {
|
||||
"name": "@farmmaps/common",
|
||||
"version": "4.19.0-prerelease.2584",
|
||||
"version": "4.18.0-prerelease.2576",
|
||||
"dependencies": {
|
||||
"tslib": "^2.3.0"
|
||||
},
|
||||
@@ -115,7 +115,7 @@
|
||||
},
|
||||
"dist/common-map": {
|
||||
"name": "@farmmaps/common-map",
|
||||
"version": "4.19.0-prerelease.2584",
|
||||
"version": "4.18.0-prerelease.2576",
|
||||
"dependencies": {
|
||||
"tslib": "^2.0.0"
|
||||
},
|
||||
@@ -130,7 +130,7 @@
|
||||
},
|
||||
"dist/common-map3d": {
|
||||
"name": "@farmmaps/common-map3d",
|
||||
"version": "4.19.0-prerelease.2584",
|
||||
"version": "4.18.0-prerelease.2576",
|
||||
"dependencies": {
|
||||
"tslib": "^2.0.0"
|
||||
},
|
||||
@@ -143,7 +143,7 @@
|
||||
},
|
||||
"dist/ng-openlayers": {
|
||||
"name": "@farmmaps/ng-openlayers",
|
||||
"version": "4.19.0-prerelease.2584",
|
||||
"version": "4.18.0-prerelease.2576",
|
||||
"license": "MPL-2.0",
|
||||
"dependencies": {
|
||||
"tslib": "^2.3.0"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "farmmaps-lib-app",
|
||||
"version": "4.19.0",
|
||||
"version": "4.18.0",
|
||||
"scripts": {
|
||||
"ng": "ng",
|
||||
"start": "ng serve",
|
||||
|
||||
@@ -59,8 +59,6 @@ export const TOGGLESHOWDATALAYERSLIDE = '[Map] ToggleShowDataLayerSlide'
|
||||
export const SETVIEWSTATE = '[Map] SetViewState'
|
||||
export const CLEARFEATURES = '[Map] ClearFeatures';
|
||||
export const SETPANELEXTRAWIDE = '[Map] SetPanelExtraWide';
|
||||
export const BACKUPFEATURES = '[Map] BackupFeatures';
|
||||
export const RESTOREFEATURES = '[Map] RestoreFeatures';
|
||||
|
||||
export class Clear implements Action {
|
||||
readonly type = CLEAR;
|
||||
@@ -302,7 +300,7 @@ export class SetReplaceUrl implements Action {
|
||||
export class SetFeatures implements Action {
|
||||
readonly type = SETFEATURES;
|
||||
|
||||
constructor(public features: Array<Feature<Geometry>>, public zoomToExtent: boolean = true) { }
|
||||
constructor(public features: Array<Feature<Geometry>>) { }
|
||||
}
|
||||
|
||||
export class SetLayerValuesLocation implements Action {
|
||||
@@ -349,16 +347,6 @@ export class SetPanelExtraWide implements Action {
|
||||
constructor(public panelExtraWide:boolean) {}
|
||||
}
|
||||
|
||||
export class BackupFeatures implements Action {
|
||||
readonly type = BACKUPFEATURES;
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
export class RestoreFeatures implements Action {
|
||||
readonly type = RESTOREFEATURES;
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
export type Actions = SetMapState
|
||||
| Init
|
||||
| Clear
|
||||
@@ -407,7 +395,5 @@ export type Actions = SetMapState
|
||||
| ToggleShowDataLayerSlide
|
||||
| SetViewState
|
||||
| ClearFeatures
|
||||
| SetPanelExtraWide
|
||||
| BackupFeatures
|
||||
| RestoreFeatures;
|
||||
| SetPanelExtraWide;
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ import { FeatureListCroppingschemeComponent } from './components/feature-list-cr
|
||||
import { FeatureListFeatureContainerComponent } from './components/feature-list-feature-container/feature-list-feature-container.component';
|
||||
import { FeatureListFeatureCropfieldComponent } from './components/feature-list-feature-cropfield/feature-list-feature-cropfield.component';
|
||||
import { FeatureListFeatureCroppingschemeComponent } from './components/feature-list-feature-croppingscheme/feature-list-feature-croppingscheme.component';
|
||||
import { FeatureListFeatureObservationComponent } from './components/feature-list-feature-observation/feature-list-feature-observation.component';
|
||||
import { AbstractFeatureListFeatureComponent, FeatureListFeatureComponent } from './components/feature-list-feature/feature-list-feature.component';
|
||||
import { AbstractFeatureListComponent, FeatureListComponent } from './components/feature-list/feature-list.component';
|
||||
import { GeometryThumbnailComponent } from './components/feature-thumbnail/feature-thumbnail.component';
|
||||
@@ -106,7 +107,7 @@ const metaReducers: Array<MetaReducer<any, any>> = [LocalStorageSync];
|
||||
|
||||
export {
|
||||
AbstractFeatureListComponent,
|
||||
AbstractFeatureListFeatureComponent, AbstractItemListComponent, AbstractItemListItemComponent, AbstractItemWidgetComponent, AbstractSelectedItemComponent, DeviceOrientationService, FeatureIconService, FeatureListComponent, FeatureListContainerComponent, FeatureListCropfieldComponent, FeatureListObservationComponent, FeatureListCroppingschemeComponent, FeatureListFeatureComponent, FeatureListFeatureContainerComponent, FeatureListFeatureCropfieldComponent, FeatureListFeatureCroppingschemeComponent, FileDropTargetComponent, ForChild,
|
||||
AbstractFeatureListFeatureComponent, AbstractItemListComponent, AbstractItemListItemComponent, AbstractItemWidgetComponent, AbstractSelectedItemComponent, DeviceOrientationService, FeatureIconService, FeatureListComponent, FeatureListContainerComponent, FeatureListCropfieldComponent, FeatureListObservationComponent, FeatureListCroppingschemeComponent, FeatureListFeatureComponent, FeatureListFeatureContainerComponent, FeatureListFeatureCropfieldComponent, FeatureListFeatureObservationComponent, FeatureListFeatureCroppingschemeComponent, FileDropTargetComponent, ForChild,
|
||||
ForItemType, ForPackage, ForSourceTask, GeolocationService, GeometryThumbnailComponent, GpsLocation, IClickedFeature, ifZoomToShowDirective, IItemLayer, IMapState, IPeriodState, ISelectedFeatures, ItemLayer, ItemLayersComponent, ItemListComponent, ItemListItemComponent,
|
||||
ItemListItemContainerComponent, ITemporalItemLayer, ItemVectorSourceComponent, ItemWidgetListComponent, LayerListComponent, LayerSwitcher, LayerVectorImageComponent, LegendComponent, mapActions, MapComponent, mapEffects,
|
||||
mapReducers, MapSearchComponent, MetaDataModalComponent, PanToLocation, RotationResetComponent, SelectedItemComponent, SelectedItemContainerComponent, SelectedItemCropfieldComponent,
|
||||
@@ -148,6 +149,7 @@ export {
|
||||
FeatureListFeatureComponent,
|
||||
FeatureListFeatureCroppingschemeComponent,
|
||||
FeatureListFeatureCropfieldComponent,
|
||||
FeatureListFeatureObservationComponent,
|
||||
SelectedItemContainerComponent,
|
||||
SelectedItemComponent,
|
||||
SelectedItemCropfieldComponent,
|
||||
@@ -180,6 +182,7 @@ export {
|
||||
LayerSwitcher,
|
||||
FeatureListFeatureComponent,
|
||||
FeatureListFeatureCropfieldComponent,
|
||||
FeatureListFeatureObservationComponent,
|
||||
FeatureListFeatureCroppingschemeComponent,
|
||||
SelectedItemContainerComponent,
|
||||
SelectedItemComponent,
|
||||
@@ -221,6 +224,7 @@ export {
|
||||
{ provide: AbstractFeatureListFeatureComponent, useClass: FeatureListFeatureComponent, multi: true },
|
||||
{ provide: AbstractFeatureListFeatureComponent, useClass: FeatureListFeatureCroppingschemeComponent, multi: true },
|
||||
{ provide: AbstractFeatureListFeatureComponent, useClass: FeatureListFeatureCropfieldComponent, multi: true },
|
||||
{ provide: AbstractFeatureListFeatureComponent, useClass: FeatureListFeatureObservationComponent, multi: true },
|
||||
{ provide: AbstractSelectedItemComponent, useClass: SelectedItemComponent, multi: true },
|
||||
{ provide: AbstractSelectedItemComponent, useClass: SelectedItemCropfieldComponent, multi: true },
|
||||
{ provide: AbstractSelectedItemComponent, useClass: SelectedItemGeotiffComponent, multi: true },
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<div *ngIf="feature;let feature">
|
||||
<div class="row m-0">
|
||||
<div class="col-3 m-0 p-2 thumbnail">
|
||||
<img [src]="getSource(feature)" style="width: 34px">
|
||||
</div>
|
||||
<div class="col p-2" style="margin: auto;">
|
||||
<h1 class="card-title" title="{{feature.get('name')}}">{{feature.get('name')}}</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,22 @@
|
||||
.card-title {
|
||||
font-size: 1rem;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.card-text {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.col {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.thumbnail {
|
||||
width: 4em;
|
||||
height: 4em;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
import { Component, Injectable } from '@angular/core';
|
||||
import { AppConfig, commonReducers, ItemTypeService } from '@farmmaps/common';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { Feature } from 'ol';
|
||||
import { Geometry } from 'ol/geom';
|
||||
import * as mapReducers from '../../reducers/map.reducer';
|
||||
import { AbstractFeatureListFeatureComponent } from '../feature-list-feature/feature-list-feature.component';
|
||||
import { ForItemType } from '../for-item/for-itemtype.decorator';
|
||||
|
||||
@ForItemType("vnd.farmmaps.itemtype.observation")
|
||||
@Injectable()
|
||||
@Component({
|
||||
selector: 'fm-map-feature-list-feature-observation',
|
||||
templateUrl: './feature-list-feature-observation.component.html',
|
||||
styleUrls: ['./feature-list-feature-observation.component.scss']
|
||||
})
|
||||
export class FeatureListFeatureObservationComponent extends AbstractFeatureListFeatureComponent {
|
||||
|
||||
constructor(store: Store<mapReducers.State | commonReducers.State>, itemTypeService: ItemTypeService,config:AppConfig) {
|
||||
super(store, itemTypeService,config);
|
||||
}
|
||||
|
||||
getSource(feature: Feature<Geometry>): string {
|
||||
let source = "/images/decease.png";
|
||||
var type = feature.get('type');
|
||||
source = '/images/' + type + '.png';
|
||||
return source;
|
||||
}
|
||||
}
|
||||
@@ -166,14 +166,12 @@ export class MapEffects {
|
||||
zoomToExtent2$ = createEffect(() => this.actions$.pipe(
|
||||
ofType(mapActions.SETFEATURES),
|
||||
switchMap((action: mapActions.SetFeatures) => {
|
||||
if (action.zoomToExtent) {
|
||||
const extent = createEmpty();
|
||||
if (extent) {
|
||||
for (const f of action.features) {
|
||||
extend(extent, (f as Feature<Geometry>).getGeometry().getExtent());
|
||||
}
|
||||
if (action.features.length > 0) return of(new mapActions.SetExtent(extent));
|
||||
const extent = createEmpty();
|
||||
if (extent) {
|
||||
for (const f of action.features) {
|
||||
extend(extent, (f as Feature<Geometry>).getGeometry().getExtent());
|
||||
}
|
||||
if (action.features.length > 0) return of(new mapActions.SetExtent(extent));
|
||||
}
|
||||
return EMPTY;
|
||||
})));
|
||||
|
||||
@@ -9,7 +9,6 @@ import { ILayervalue } from '../models/layer.value';
|
||||
import * as mapActions from '../actions/map.actions';
|
||||
import {commonActions} from '@farmmaps/common';
|
||||
import { createSelector, createFeatureSelector } from '@ngrx/store';
|
||||
import * as _ from 'lodash';
|
||||
|
||||
import {Feature} from 'ol';
|
||||
import {Geometry} from 'ol/geom';
|
||||
@@ -48,7 +47,6 @@ export interface State {
|
||||
query:IQuery,
|
||||
parentCode: string,
|
||||
features: Array<Feature<Geometry>>,
|
||||
featuresBackup: Array<Feature<Geometry>>,
|
||||
panelVisible: boolean,
|
||||
panelCollapsed: boolean,
|
||||
panelExtraWide: boolean,
|
||||
@@ -95,7 +93,6 @@ export const initialState: State = {
|
||||
query: null,
|
||||
parentCode: null,
|
||||
features: [],
|
||||
featuresBackup: [],
|
||||
panelVisible: false,
|
||||
panelCollapsed: false,
|
||||
panelExtraWide: false,
|
||||
@@ -159,15 +156,13 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
|
||||
const a = action as mapActions.StartSearchSuccess;
|
||||
return tassign(state, {
|
||||
features: a.features,
|
||||
featuresBackup: [],
|
||||
inSearch:false
|
||||
});
|
||||
}
|
||||
case mapActions.SETFEATURES: {
|
||||
const a = action as mapActions.SetFeatures;
|
||||
return tassign(state, {
|
||||
features: a.features,
|
||||
featuresBackup: []
|
||||
features: a.features
|
||||
});
|
||||
}
|
||||
case mapActions.SELECTFEATURE: {
|
||||
@@ -185,7 +180,6 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
|
||||
selectedItemLayer: null,
|
||||
showDataLayerSlide: false,
|
||||
features:[],
|
||||
featuresBackup: [],
|
||||
inSearch:inSearch
|
||||
});
|
||||
}
|
||||
@@ -302,7 +296,6 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
|
||||
return tassign(state, {
|
||||
selectedItem: null,
|
||||
features:[],
|
||||
featuresBackup: [],
|
||||
selectedItemLayer:null,
|
||||
searchCollapsed: !panelVisible,
|
||||
panelVisible: panelVisible,
|
||||
@@ -339,8 +332,7 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
|
||||
extent: a.feature.getGeometry().getExtent(),
|
||||
searchCollapsed: false,
|
||||
clearEnabled:true,
|
||||
features:features,
|
||||
featuresBackup:[]
|
||||
features:features
|
||||
});
|
||||
}
|
||||
case mapActions.UPDATEFEATURESUCCESS: {
|
||||
@@ -354,7 +346,7 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
|
||||
features.push(state.features[i]);
|
||||
}
|
||||
}
|
||||
return tassign(state, { features: features, featuresBackup: [] });
|
||||
return tassign(state, { features: features });
|
||||
}
|
||||
case mapActions.EXPANDSEARCH: {
|
||||
return tassign(state, { searchCollapsed: false });
|
||||
@@ -399,7 +391,7 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
|
||||
return tassign(state, {overlayLayers: [], selectedOverlayLayer: null});
|
||||
}
|
||||
case mapActions.CLEARFEATURES: {
|
||||
return tassign(state, {features: [], featuresBackup: [], selectedFeature: null});
|
||||
return tassign(state, {features: [], selectedFeature: null});
|
||||
}
|
||||
case mapActions.SETVISIBILITY: {
|
||||
const a = action as mapActions.SetVisibility;
|
||||
@@ -517,7 +509,6 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
|
||||
searchCollapsed: true,
|
||||
searchMinified: false,
|
||||
features: [],
|
||||
featuresBackup: [],
|
||||
query:initialState.query,
|
||||
showLayerSwitcher: false,
|
||||
extent: null,
|
||||
@@ -565,8 +556,7 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
|
||||
selectedItem: null,
|
||||
selectedItemLayer: null,
|
||||
showDataLayerSlide: false,
|
||||
features:[],
|
||||
featuresBackup:[]
|
||||
features:[]
|
||||
});
|
||||
}
|
||||
if(state.features.length>0) {
|
||||
@@ -579,7 +569,7 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
|
||||
if(index>=0) {
|
||||
const newFeatures = state.features.slice(0);
|
||||
newFeatures.splice(index,1);
|
||||
return tassign(state,{features:newFeatures, featuresBackup:[]});
|
||||
return tassign(state,{features:newFeatures});
|
||||
}
|
||||
}
|
||||
return state;
|
||||
@@ -588,17 +578,6 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
|
||||
const a= action as mapActions.SetPanelExtraWide;
|
||||
return tassign(state,{panelExtraWide:a.panelExtraWide});
|
||||
}
|
||||
case mapActions.BACKUPFEATURES: {
|
||||
return tassign(state, {
|
||||
featuresBackup: _.cloneDeep(state.features)
|
||||
});
|
||||
}
|
||||
case mapActions.RESTOREFEATURES: {
|
||||
return tassign(state, {
|
||||
features: _.cloneDeep(state.featuresBackup),
|
||||
featuresBackup: []
|
||||
});
|
||||
}
|
||||
default: {
|
||||
return state;
|
||||
}
|
||||
|
||||
@@ -25,8 +25,7 @@ export class ItemService {
|
||||
return this.httpClient.get<{ [id: string]: IItemType }>(`${this.ApiEndpoint()}/api/v1/itemtypes/`);
|
||||
}
|
||||
|
||||
getFeatures(extent: number[], crs: string, searchText?: string, searchTags?:string,startDate?:Date,endDate?:Date,
|
||||
itemType?:string,parentCode?:string,dataFilter?:string,level?:number,indexed?:boolean,atItemLocationItemCode?: string): Observable<any> {
|
||||
getFeatures(extent: number[], crs: string, searchText?: string, searchTags?:string,startDate?:Date,endDate?:Date,itemType?:string,parentCode?:string,dataFilter?:string,level?:number,indexed?:boolean): Observable<any> {
|
||||
let params = new HttpParams();
|
||||
params = params.append("crs", crs);
|
||||
if (extent) params =params.append("bbox", extent.join(","));
|
||||
@@ -44,7 +43,6 @@ export class ItemService {
|
||||
if (parentCode) params = params.append("pc", parentCode);
|
||||
if (dataFilter) params = params.append("df", dataFilter);
|
||||
if (level) params = params.append("lvl", level.toString());
|
||||
if (atItemLocationItemCode) params = params.append("ail", atItemLocationItemCode);
|
||||
params = params.append("ind", indexed ?? true);
|
||||
return this.httpClient.get<any>(`${this.ApiEndpoint()}/api/v1/items/features/`, {params:params});
|
||||
}
|
||||
@@ -118,8 +116,7 @@ export class ItemService {
|
||||
|
||||
getChildItemList(parentcode: string, itemType?: string, dataFilter?: any, level = 1, deep = true,
|
||||
startDate?: Date, endDate?: Date, skip?: number, take?: number,
|
||||
exactMatchStartOrEndDate?: boolean, owner?:string, indexed?: boolean,
|
||||
atItemLocationItemCode?: string): Observable<IItem[]> {
|
||||
exactMatchStartOrEndDate?: boolean, owner?:string, indexed?: boolean): Observable<IItem[]> {
|
||||
let params = new HttpParams();
|
||||
if(itemType != null) {
|
||||
params = params.append("it", itemType);
|
||||
@@ -137,7 +134,6 @@ export class ItemService {
|
||||
if(skip) params = params.append("skip", skip);
|
||||
if(take) params = params.append("take", take);
|
||||
if(indexed) params = params.append("ind",indexed?"true":"false");
|
||||
if(atItemLocationItemCode) params = params.append("ail",atItemLocationItemCode);
|
||||
return this.httpClient.get<IItem[]>(`${this.ApiEndpoint()}/api/v1/items/${parentcode}/children`, { params: params });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user