13 Commits

Author SHA1 Message Date
d89670f669 Merge branch 'hotfix/AW-3412-B'
All checks were successful
FarmMaps/FarmMapsLib/pipeline/head This commit looks good
2022-01-19 14:38:49 +01:00
d025e2e3f6 export GeometryThumbnailComponent 2022-01-19 14:36:34 +01:00
Willem Dantuma
57407d83d3 Merge branch 'hotfix/AW-3412'
All checks were successful
FarmMaps/FarmMapsLib/pipeline/head This commit looks good
2022-01-19 13:24:14 +01:00
Willem Dantuma
f83549b5af Update version 2022-01-19 13:22:55 +01:00
Willem Dantuma
132556da81 AW-3412 2022-01-19 13:21:44 +01:00
Willem Dantuma
c2350eec52 Fix configuration for local authentication 2022-01-19 11:56:30 +01:00
Willem Dantuma
c6d14e6c9c Export interface
All checks were successful
FarmMaps/FarmMapsLib/pipeline/head This commit looks good
2021-12-02 11:23:36 +01:00
Willem Dantuma
8e4364bd08 bump version
All checks were successful
FarmMaps/FarmMapsLib/pipeline/head This commit looks good
2021-12-02 11:16:43 +01:00
Willem Dantuma
af3340ed70 Inject clicked feature in component
Some checks failed
FarmMaps/FarmMapsLib/pipeline/head There was a failure building this commit
2021-12-02 11:13:36 +01:00
Willem Dantuma
ff19d830a7 Fix version
All checks were successful
FarmMaps/FarmMapsLib/pipeline/head This commit looks good
2021-11-26 12:06:17 +01:00
Willem Dantuma
29914cfb1b oops
Some checks reported errors
FarmMaps/FarmMapsLib/pipeline/head Something is wrong with the build of this commit
2021-11-26 12:04:17 +01:00
Willem Dantuma
7bca0a57c4 Fix build
Some checks failed
FarmMaps/FarmMapsLib/pipeline/head There was a failure building this commit
2021-11-26 12:02:01 +01:00
Willem Dantuma
fdba357e9c Fix matching
Some checks failed
FarmMaps/FarmMapsLib/pipeline/head There was a failure building this commit
2021-11-26 11:58:11 +01:00
12 changed files with 118 additions and 56 deletions

8
Jenkinsfile vendored
View File

@@ -8,13 +8,13 @@ pipeline {
stage('npm install'){ stage('npm install'){
steps { steps {
sh '''rm -rf node_modules/ sh '''rm -rf node_modules/
npm install npm install --legacy-peer-deps
cd projects/common cd projects/common
npm install npm install --legacy-peer-deps
cd ../common-map cd ../common-map
npm install npm install --legacy-peer-deps
cd ../common-map3d cd ../common-map3d
npm install npm install --legacy-peer-deps
''' '''
} }
} }

View File

@@ -1,6 +1,6 @@
{ {
"name": "farmmaps-lib-app", "name": "farmmaps-lib-app",
"version": "1.1.1", "version": "1.1.6",
"scripts": { "scripts": {
"ng": "ng", "ng": "ng",
"start": "ng serve", "start": "ng serve",
@@ -19,9 +19,9 @@
"@angular/platform-browser": "~11.2.14", "@angular/platform-browser": "~11.2.14",
"@angular/platform-browser-dynamic": "~11.2.14", "@angular/platform-browser-dynamic": "~11.2.14",
"@angular/router": "~11.2.14", "@angular/router": "~11.2.14",
"@farmmaps/common": "1.1.1-prerelease.2031", "@farmmaps/common": "1.1.4",
"@farmmaps/common-map": "1.1.1-prerelease.2031", "@farmmaps/common-map": "1.1.4",
"@farmmaps/common-map3d": "1.1.1-prerelease.2031", "@farmmaps/common-map3d": "1.1.4",
"@microsoft/signalr": "^3.1.16", "@microsoft/signalr": "^3.1.16",
"@ng-bootstrap/ng-bootstrap": "^9.0", "@ng-bootstrap/ng-bootstrap": "^9.0",
"@ngrx/effects": "^11.0", "@ngrx/effects": "^11.0",

View File

@@ -19,6 +19,7 @@ import * as mapEffects from './effects/map.effects';
import { IMapState} from './models/map.state'; import { IMapState} from './models/map.state';
import { ISelectedFeatures } from './models/selected.features'; import { ISelectedFeatures } from './models/selected.features';
import { IItemLayer,ItemLayer,ITemporalItemLayer,TemporalItemLayer } from './models/item.layer'; import { IItemLayer,ItemLayer,ITemporalItemLayer,TemporalItemLayer } from './models/item.layer';
import { IClickedFeature } from './models/clicked.feature';
import { IPeriodState } from './models/period.state'; import { IPeriodState } from './models/period.state';
// components // components
@@ -83,7 +84,7 @@ export function LocalStorageSync(reducer: ActionReducer<any>): ActionReducer<any
r2["mapState"] = JSON.parse(ms); r2["mapState"] = JSON.parse(ms);
} }
let sp = window.localStorage.getItem(MODULE_NAME+"_searchPeriod"); let sp = window.localStorage.getItem(MODULE_NAME+"_searchPeriod");
if(sp) { if(sp) {
let p = JSON.parse(sp); let p = JSON.parse(sp);
r2["period"] = { startDate: new Date(Date.parse(p.startDate)),endDate:new Date(Date.parse(p.endDate))}; r2["period"] = { startDate: new Date(Date.parse(p.startDate)),endDate:new Date(Date.parse(p.endDate))};
} }
@@ -163,7 +164,9 @@ export {
ITemporalItemLayer, ITemporalItemLayer,
TemporalItemLayer, TemporalItemLayer,
ifZoomToShowDirective, ifZoomToShowDirective,
ZoomToShowAlert ZoomToShowAlert,
IClickedFeature,
GeometryThumbnailComponent
} }
@NgModule({ @NgModule({
@@ -273,7 +276,8 @@ export {
FeatureListFeatureContainerComponent, FeatureListFeatureContainerComponent,
ZoomToExtentComponent, ZoomToExtentComponent,
ifZoomToShowDirective, ifZoomToShowDirective,
ZoomToShowAlert ZoomToShowAlert,
GeometryThumbnailComponent
], ],
providers: [ providers: [
FeatureIconService, FeatureIconService,
@@ -296,5 +300,5 @@ export {
}) })
export class AppCommonMapModule { export class AppCommonMapModule {
} }

View File

@@ -38,7 +38,7 @@ export class FeatureListContainerComponent {
let criteria=0; let criteria=0;
if (this.featureLists[i]['forItemType']) { if (this.featureLists[i]['forItemType']) {
criteria++; criteria++;
if( this.featureLists[i]['forItemType'].indexOf(queryState.itemType) >= 0) { if( this.featureLists[i]['forItemType'].split(",").filter(part => part == queryState.itemType).length == 1) {
matches++; matches++;
} }
} }

View File

@@ -32,7 +32,7 @@ export class FeatureListFeatureContainerComponent {
let criteria=0; let criteria=0;
if (this.featureLists[i]['forItemType']) { if (this.featureLists[i]['forItemType']) {
criteria++; criteria++;
if(this.featureLists[i]['forItemType'].indexOf(this.feature.get("itemType")) >= 0) { if(this.featureLists[i]['forItemType'].split(",").filter(part => part == this.feature.get("itemType")).length == 1) {
matches++; matches++;
} }
} }

View File

@@ -1,4 +1,4 @@
import { Component, Input, OnInit,ViewChild } from '@angular/core'; import { Component, Input, AfterViewInit, ViewChild } from '@angular/core';
import { Feature} from 'ol'; import { Feature} from 'ol';
import { Geometry } from 'ol/geom'; import { Geometry } from 'ol/geom';
import * as extent from 'ol/extent'; import * as extent from 'ol/extent';
@@ -10,51 +10,86 @@ import * as style from 'ol/style';
templateUrl: './feature-thumbnail.component.html', templateUrl: './feature-thumbnail.component.html',
styleUrls: ['./feature-thumbnail.component.scss'] styleUrls: ['./feature-thumbnail.component.scss']
}) })
export class GeometryThumbnailComponent implements OnInit { export class GeometryThumbnailComponent implements AfterViewInit {
constructor() { } constructor() { }
@ViewChild('canvas') canvas; @ViewChild('canvas') canvas;
@ViewChild('container') container; @ViewChild('container') container;
@Input('feature') feature:Feature;
ngOnInit(): void { private geometry:Geometry = null;
@Input() set feature(value:Feature) {
if(value) {
this.geometry = value.getGeometry();
} else {
this.geometry = null;
}
this.render(this.canvas,
this.geometryStyle,
this.geometry,
this.width,
this.height);
};
private defaultStyle:style.Style = new style.Style({
stroke: new style.Stroke({ color: 'black',width:1.5 })
});
private geometryStyle:style.Style = this.defaultStyle;
@Input() set fillColor(value:string) {
if(style) {
this.geometryStyle = new style.Style({
stroke: new style.Stroke({ color: 'black',width:1.5 }),
fill: new style.Fill({color: value})
});
} else {
this.geometryStyle = this.defaultStyle
}
this.render(this.canvas,
this.geometryStyle,
this.geometry,
this.width,
this.height);
} }
render(canvas,width,height,geometry:Geometry) { private width:number = 0;
let renderContext = render.toContext(canvas.getContext( '2d'),{ size: [width, height] }); private height:number = 0;
let strokeStyle = new style.Style({
stroke: new style.Stroke({ color: 'black',width:1.5 })
});
let geom = geometry.clone(), render(canvas,style:style.Style,geometry:Geometry,width:number,height:number) {
line = geom.getCoordinates()[0], if(canvas && canvas.nativeElement && geometry && style) {
e = extent.boundingExtent( line ); let renderContext = render.toContext(canvas.nativeElement.getContext( '2d'),{ size: [width, height] });
let dxy = extent.getCenter(e), let geom = geometry.clone(),
sxy = [ line = geom.getCoordinates()[0],
(width - 2 ) / extent.getWidth(e), e = extent.boundingExtent( line );
(height - 2 ) / extent.getHeight(e)
]; let dxy = extent.getCenter(e),
sxy = [
let dx = dxy[0], (width - 2 ) / extent.getWidth(e),
dy = dxy[1], (height - 2 ) / extent.getHeight(e)
sx = sxy[0], ];
sy = sxy[1];
let dx = dxy[0],
geom.translate( -dx, -dy ); dy = dxy[1],
geom.scale( Math.min(sx, sy), -Math.min(sx, sy)); sx = sxy[0],
geom.translate( width / 2, height / 2 ); sy = sxy[1];
renderContext.setStyle( strokeStyle ); geom.translate( -dx, -dy );
renderContext.drawGeometry( geom ); geom.scale( Math.min(sx, sy), -Math.min(sx, sy));
geom.translate(width / 2,height / 2 );
renderContext.setStyle( style );
renderContext.drawGeometry( geom );
}
} }
ngAfterViewInit() { ngAfterViewInit() {
this.render(this.canvas.nativeElement, this.width = this.container.nativeElement.offsetWidth;
this.container.nativeElement.offsetWidth, this.height = this.container.nativeElement.offsetHeight;
this.container.nativeElement.offsetHeight, this.render(this.canvas,
this.feature.getGeometry()); this.geometryStyle,
this.geometry,
this.width,
this.height);
} }
} }

View File

@@ -33,13 +33,13 @@ export class ItemListItemContainerComponent {
let criteria=0; let criteria=0;
if (this.itemComponentList[i]['forItemType']) { if (this.itemComponentList[i]['forItemType']) {
criteria++; criteria++;
if(this.itemComponentList[i]['forItemType'].indexOf(this.item.itemType) >= 0) { if(this.itemComponentList[i]['forItemType'].split(",").filter(part => part ==this.item.itemType).length == 1) {
matches++; matches++;
} }
} }
if (this.itemComponentList[i]['forSourceTask']) { if (this.itemComponentList[i]['forSourceTask']) {
criteria++; criteria++;
if(this.itemComponentList[i]['forSourceTask'].indexOf(this.item.sourceTask) >= 0) { if(this.itemComponentList[i]['forSourceTask'].split(",").filter(part => part ==this.item.sourceTask).length ==1) {
matches++; matches++;
} }
} }

View File

@@ -74,7 +74,7 @@
</div> </div>
</fm-side-panel> </fm-side-panel>
<fm-side-panel [resizeable]="true" [visible]="!noContent"> <fm-side-panel [resizeable]="true" [visible]="!noContent">
<router-outlet></router-outlet> <router-outlet (activate)="handleSidepaneloutletActivate($event)" (deactivate)="handleSidepaneloutletDeactivate($event)"></router-outlet>
</fm-side-panel> </fm-side-panel>
</div> </div>
</aol-map> </aol-map>

View File

@@ -11,6 +11,7 @@ import { DeviceService } from '@farmmaps/common';
import * as mapReducers from '../../reducers/map.reducer'; import * as mapReducers from '../../reducers/map.reducer';
import * as mapActions from '../../actions/map.actions'; import * as mapActions from '../../actions/map.actions';
import { IMapState} from '../../models/map.state'; import { IMapState} from '../../models/map.state';
import { IClickedFeature} from '../../models/clicked.feature';
import { IQuery } from '../../reducers/map.reducer' import { IQuery } from '../../reducers/map.reducer'
import { ISelectedFeatures } from '../../models/selected.features'; import { ISelectedFeatures } from '../../models/selected.features';
import { IItemLayer } from '../../models/item.layer'; import { IItemLayer } from '../../models/item.layer';
@@ -175,6 +176,18 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
this.store.dispatch(new mapActions.DoQuery(queryState)); this.store.dispatch(new mapActions.DoQuery(queryState));
} }
handleSidepaneloutletActivate(component:any) {
if(component && component.hasOwnProperty('clickedFeature')) {
(component as IClickedFeature).clickedFeature = this.clickedFeature;
}
}
handleSidepaneloutletDeactivate(component:any) {
if(component && component.hasOwnProperty('clickedFeature')) {
(component as IClickedFeature).clickedFeature = null;
}
}
ngOnInit() { ngOnInit() {
this.initialized = false; this.initialized = false;
console.debug("Init"); console.debug("Init");

View File

@@ -34,13 +34,13 @@ export class SelectedItemContainerComponent {
let criteria=0; let criteria=0;
if (this.selectedItemComponents[i]['forItemType'] ) { if (this.selectedItemComponents[i]['forItemType'] ) {
criteria++; criteria++;
if(this.selectedItemComponents[i]['forItemType'].indexOf(this.item.itemType) >= 0) { if(this.selectedItemComponents[i]['forItemType'].split(",").filter(part => part ==this.item.itemType).length == 1) {
matches++; matches++;
} }
} }
if (this.selectedItemComponents[i]['forSourceTask']) { if (this.selectedItemComponents[i]['forSourceTask']) {
criteria++; criteria++;
if( this.selectedItemComponents[i]['forSourceTask'].indexOf(this.item.sourceTask) >= 0) { if( this.selectedItemComponents[i]['forSourceTask'].split(",").filter(part => part ==this.item.sourceTask).length == 1) {
matches++; matches++;
} }
} }

View File

@@ -0,0 +1,10 @@
import {Feature} from 'ol';
import {Geometry} from 'ol/geom';
import { Observable } from 'rxjs';
/**
* @deprecated This interface will be removed soon
*/
export interface IClickedFeature {
clickedFeature: Observable<Feature<Geometry>>
}

View File

@@ -1,8 +1,8 @@
{ {
"issuer": "https://accounts.test.farmmaps.eu", "issuer": "http://localhost:8094",
"clientId": "farmmapsdev", "clientId": "farmmapsdev",
"audience": "http://localhost:8082", "audience": "http://localhost:8082/",
"requireHttps": true, "requireHttps": false,
"apiEndPoint": "http://localhost:8082", "apiEndPoint": "http://localhost:8082",
"grantType":"code" "grantType":"code"
} }