Compare commits

..

No commits in common. "a408f4bffac4f360f6bf3fd0a29c2a2fd6d4996c" and "2825ce4ccce7d592aa380f0483a574fdf0c97272" have entirely different histories.

11 changed files with 249 additions and 21576 deletions

View File

@ -4,13 +4,9 @@ module.exports = {
// Resolve node module use of fs // Resolve node module use of fs
fs: "empty", fs: "empty",
Buffer: false, Buffer: false,
http: require.resolve("stream-http"), http: "empty",
https: require.resolve("https-browserify"), https: "empty",
url: require.resolve("url/"), zlib: "empty"
zlib: require.resolve('browserify-zlib'),
assert: require.resolve("assert/"),
util: require.resolve("util/"),
buffer: require.resolve("buffer/")
} }
} }
}; };

21701
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{ {
"name": "farmmaps-lib-app", "name": "farmmaps-lib-app",
"version": "2.1.4", "version": "2.1.3",
"scripts": { "scripts": {
"ng": "ng", "ng": "ng",
"start": "ng serve", "start": "ng serve",
@ -28,30 +28,22 @@
"@ngrx/router-store": "^12.0", "@ngrx/router-store": "^12.0",
"@ngrx/store": "^12.0", "@ngrx/store": "^12.0",
"angular-oauth2-oidc": "^12.0", "angular-oauth2-oidc": "^12.0",
"assert": "^2.0.0",
"bootstrap": "^4.6.0", "bootstrap": "^4.6.0",
"browserify-zlib": "^0.2.0", "cesium": "^1.82.1",
"buffer": "^6.0.3",
"cesium": "^1.97.0",
"core-js": "^2.6.12", "core-js": "^2.6.12",
"https-browserify": "^1.0.0", "moment": "^2.29.1",
"moment": "^2.29.4", "ngrx-store-localstorage": "^12.0",
"ngrx-store-localstorage": "^14",
"ngx-avatar": "^4.1.0", "ngx-avatar": "^4.1.0",
"ngx-clipboard": "^14.0.1", "ngx-clipboard": "^14.0.1",
"ngx-image-cropper": "^3.3.5", "ngx-image-cropper": "^3.3.5",
"ngx-openlayers": "1.0.0-next.19", "ngx-openlayers": "1.0.0-next.19",
"ngx-uploadx": "^5.2.0", "ngx-uploadx": "^3.5.1",
"ol": "6.14.1", "ol": "6.8.1",
"olcs": "^2.13.1", "ol-cesium": "^2.13.0",
"resumablejs": "^1.1.0", "resumablejs": "^1.1.0",
"rxjs": "^6.6.7", "rxjs": "^6.6.7",
"stream": "^0.0.2",
"stream-http": "^3.2.0",
"tassign": "^1.0.0", "tassign": "^1.0.0",
"tslib": "^2.4.0", "tslib": "^2.2.0",
"url": "^0.11.0",
"util": "^0.12.4",
"zone.js": "~0.11.4" "zone.js": "~0.11.4"
}, },
"devDependencies": { "devDependencies": {

View File

@ -55,7 +55,6 @@ export const TOGGLELAYERVALUESENABLED = '[Map] ToggleLayerValuesEnabled'
export const GETLAYERVALUE = '[Map] GetLayerValue' export const GETLAYERVALUE = '[Map] GetLayerValue'
export const GETLAYERVALUESUCCESS = '[Map] GetLayerValueSuccess' export const GETLAYERVALUESUCCESS = '[Map] GetLayerValueSuccess'
export const TOGGLESHOWDATALAYERSLIDE = '[Map] ToggleShowDataLayerSlide' export const TOGGLESHOWDATALAYERSLIDE = '[Map] ToggleShowDataLayerSlide'
export const SETVIEWSTATE = '[Map] SetViewState'
export class Clear implements Action { export class Clear implements Action {
@ -324,11 +323,6 @@ export class ToggleShowDataLayerSlide implements Action {
constructor() {} constructor() {}
} }
export class SetViewState implements Action {
readonly type = SETVIEWSTATE;
constructor(public enabled:boolean) {}
}
export type Actions = SetMapState export type Actions = SetMapState
| Init | Init
| Clear | Clear
@ -373,6 +367,5 @@ export type Actions = SetMapState
| GetLayerValueSuccess | GetLayerValueSuccess
| GetLayerValue | GetLayerValue
| SetPeriod | SetPeriod
| ToggleShowDataLayerSlide | ToggleShowDataLayerSlide;
| SetViewState;

View File

@ -27,12 +27,10 @@
<div> <div>
</div> </div>
<aol-view [zoom]="state.mapState.zoom" [rotation]="state.mapState.rotation">
<aol-view [zoom]="state.mapState.zoom" [rotation]="state.mapState.rotation"> <aol-coordinate [x]="state.mapState.xCenter" [y]="state.mapState.yCenter" [srid]="'EPSG:4326'"></aol-coordinate>
<aol-coordinate [x]="state.mapState.xCenter" [y]="state.mapState.yCenter" [srid]="'EPSG:4326'"></aol-coordinate> <fm-map-zoom-to-extent [extent]="state.extent" [animate]="true"></fm-map-zoom-to-extent>
<fm-map-zoom-to-extent [extent]="state.extent" [animate]="true"></fm-map-zoom-to-extent> </aol-view>
</aol-view>
<aol-interaction-default></aol-interaction-default> <aol-interaction-default></aol-interaction-default>
<aol-interaction-dragrotateandzoom></aol-interaction-dragrotateandzoom> <aol-interaction-dragrotateandzoom></aol-interaction-dragrotateandzoom>
<fm-map-item-layers [itemLayers]="state.baseLayers"></fm-map-item-layers> <fm-map-item-layers [itemLayers]="state.baseLayers"></fm-map-item-layers>

View File

@ -94,7 +94,6 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
public dataLayerSlideValue:number = 50; public dataLayerSlideValue:number = 50;
public dataLayerSlideEnabled = false; public dataLayerSlideEnabled = false;
private visibleAreaBottom = 0; private visibleAreaBottom = 0;
private viewEnabled: boolean = true;
@ViewChild('map') map; @ViewChild('map') map;
@ViewChild('contentDiv') contentDiv: ElementRef; @ViewChild('contentDiv') contentDiv: ElementRef;
@ -376,9 +375,6 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
this.dataLayerSlideEnabled=v; this.dataLayerSlideEnabled=v;
this.map.instance.render(); this.map.instance.render();
}); });
this.store.select(mapReducers.selectGetViewEnabled).subscribe((v) => {
this.viewEnabled = v;
});
} }
handleSearchCollapse(event) { handleSearchCollapse(event) {
@ -432,7 +428,7 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
} }
handleOnMoveEnd(event) { handleOnMoveEnd(event) {
if(this.initialized && this.viewEnabled) { if(this.initialized) {
this.zone.run(() =>{ this.zone.run(() =>{
console.debug("Move end"); console.debug("Move end");
var map = event.map; var map = event.map;

View File

@ -72,7 +72,6 @@ export interface State {
layerValuesEnabled:boolean, layerValuesEnabled:boolean,
layerValues: Array<ILayervalue> layerValues: Array<ILayervalue>
showDataLayerSlide:boolean, showDataLayerSlide:boolean,
viewEnabled:boolean
} }
export const initialState: State = { export const initialState: State = {
@ -116,8 +115,7 @@ export const initialState: State = {
layerValuesY:0, layerValuesY:0,
layerValuesEnabled:false, layerValuesEnabled:false,
layerValues:[], layerValues:[],
showDataLayerSlide:false, showDataLayerSlide:false
viewEnabled:true
} }
export function reducer(state = initialState, action: mapActions.Actions | commonActions.Actions | RouterNavigationAction): State { export function reducer(state = initialState, action: mapActions.Actions | commonActions.Actions | RouterNavigationAction): State {
@ -540,10 +538,6 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
v.push(a.layervalue); v.push(a.layervalue);
return tassign(state,{layerValues:v}); return tassign(state,{layerValues:v});
} }
case mapActions.SETVIEWSTATE:{
let a= action as mapActions.SetViewState;
return tassign(state,{viewEnabled:a.enabled});
}
case commonActions.ITEMDELETEDEVENT:{ case commonActions.ITEMDELETEDEVENT:{
let a= action as commonActions.ItemDeletedEvent; let a= action as commonActions.ItemDeletedEvent;
if(state.selectedItem && state.selectedItem.code == a.itemCode) { if(state.selectedItem && state.selectedItem.code == a.itemCode) {
@ -605,7 +599,6 @@ export const getLayerValuesEnabled = (state:State) => state.layerValuesEnabled;
export const getLayerValues = (state:State) => state.layerValues; export const getLayerValues = (state:State) => state.layerValues;
export const getLayerValuesX = (state:State) => state.layerValuesX; export const getLayerValuesX = (state:State) => state.layerValuesX;
export const getLayerValuesY = (state:State) => state.layerValuesY; export const getLayerValuesY = (state:State) => state.layerValuesY;
export const getViewEnabled = (state:State) => state.viewEnabled;
export const selectMapState = createFeatureSelector<State>(MODULE_NAME); export const selectMapState = createFeatureSelector<State>(MODULE_NAME);
@ -639,6 +632,5 @@ export const selectGetLayerValuesEnabled = createSelector(selectMapState,getLaye
export const selectGetLayerValues = createSelector(selectMapState,getLayerValues); export const selectGetLayerValues = createSelector(selectMapState,getLayerValues);
export const selectGetLayerValuesX = createSelector(selectMapState,getLayerValuesX); export const selectGetLayerValuesX = createSelector(selectMapState,getLayerValuesX);
export const selectGetLayerValuesY = createSelector(selectMapState,getLayerValuesY); export const selectGetLayerValuesY = createSelector(selectMapState,getLayerValuesY);
export const selectGetViewEnabled = createSelector(selectMapState,getViewEnabled);

View File

@ -1,14 +1,12 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { Switch2D3DComponent } from './components/olcs/switch2d3d/switch2d3d.component'; import { Switch2D3DComponent } from './components/olcs/switch2d3d/switch2d3d.component';
import { AppCommonModule} from '@farmmaps/common'; import { AppCommonModule} from '@farmmaps/common';
import { AppCommonMapModule} from '@farmmaps/common-map';
@NgModule({ @NgModule({
declarations: [Switch2D3DComponent], declarations: [Switch2D3DComponent],
imports: [ imports: [
AppCommonModule, AppCommonModule
AppCommonMapModule
], ],
exports: [Switch2D3DComponent] exports: [Switch2D3DComponent]
}) })

View File

@ -1,11 +1,8 @@
import { Component, OnInit,Input,Host } from '@angular/core'; import { Component, OnInit,Input,Host } from '@angular/core';
import { Interaction} from 'ol/interaction';
import { MapComponent } from 'ngx-openlayers'; import { MapComponent } from 'ngx-openlayers';
import OLCesium from 'olcs/OLCesium'; import OLCesium from 'ol-cesium';
import RasterSynchronizer from 'olcs/RasterSynchronizer';
import VectorSynchronizer from 'olcs/VectorSynchronizer'; declare var olcs: any;
import { mapReducers,mapActions } from '@farmmaps/common-map';
import { Store } from '@ngrx/store';
@Component({ @Component({
selector: 'fm-map3d-switch2d3d', selector: 'fm-map3d-switch2d3d',
@ -19,10 +16,9 @@ export class Switch2D3DComponent {
private ol3d: OLCesium; private ol3d: OLCesium;
private synchronizers:any[]; private synchronizers:any[];
public loading:boolean = true; public loading:boolean = true;
private interactions:Interaction[] = [];
constructor(private map: MapComponent,private store: Store<mapReducers.State>) { constructor(private map: MapComponent) {
} }
@ -30,8 +26,8 @@ export class Switch2D3DComponent {
this.ol3d = new OLCesium({ map: this.map.instance, createSynchronizers: (map,scene) => { this.ol3d = new OLCesium({ map: this.map.instance, createSynchronizers: (map,scene) => {
this.synchronizers = [ this.synchronizers = [
new RasterSynchronizer(map,scene), new olcs.RasterSynchronizer(map,scene),
new VectorSynchronizer(map,scene) new olcs.VectorSynchronizer(map,scene)
]; ];
this.loading=false; this.loading=false;
return this.synchronizers; return this.synchronizers;
@ -45,35 +41,12 @@ export class Switch2D3DComponent {
}); });
} }
disableInteractions() {
this.interactions=[];
this.map.instance.getInteractions().forEach((i) => {
if(i.getActive()) {
this.interactions.push(i);
i.setActive(false);
}
});
}
enableInteractions() {
this.interactions.forEach((i) => {
i.setActive(true);
});
}
handleClick(event) { handleClick(event) {
this.enable = !this.enable; this.enable = !this.enable;
if(this.enable) { if(this.enable) {
this.store.dispatch(new mapActions.SetViewState(false)); this.synchronize();
this.disableInteractions();
this.synchronize();
this.ol3d.setEnabled(true);
} else {
this.ol3d.setEnabled(false);
this.enableInteractions();
this.store.dispatch(new mapActions.SetViewState(true));
} }
this.ol3d.setEnabled(this.enable);
this.label = this.enable?"2D":"3D"; this.label = this.enable?"2D":"3D";
} }
} }

View File

@ -89,7 +89,7 @@ export class ResumableFileUploadService implements OnDestroy{
addFiles = (files: any[], event: any, metadata:any) => { addFiles = (files: any[], event: any, metadata:any) => {
for (let f of files) { for (let f of files) {
var options:UploadxOptions = {metadata:metadata}; var options:UploadxOptions = {metadata:metadata};
this.uploadService.handleFiles(f,options); this.uploadService.handleFile(f,options);
} }
} }

View File

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