Compare commits
	
		
			54 Commits
		
	
	
		
			2022.03
			...
			61d2fc8d54
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					61d2fc8d54 | ||
| 
						 | 
					80760a8fdd | ||
| 
						 | 
					a7f53a841b | ||
| 
						 | 
					9d64fce22c | ||
| e39c0b055d | |||
| 
						 | 
					237fd27489 | ||
| 
						 | 
					296385ab33 | ||
| 
						 | 
					402bbcea0d | ||
| 
						 | 
					161717bc7b | ||
| 
						 | 
					0b8dbf4e2e | ||
| 2acf13cbac | |||
| 
						 | 
					a408f4bffa | ||
| 
						 | 
					ac5bd7d635 | ||
| 
						 | 
					cf84f8c93d | ||
| 
						 | 
					4872dee094 | ||
| 
						 | 
					b76a933dba | ||
| 
						 | 
					41c7ab15f3 | ||
| 
						 | 
					a9185b86af | ||
| 
						 | 
					eb1b8f18eb | ||
| 
						 | 
					bce562fb8e | ||
| 
						 | 
					2825ce4ccc | ||
| 
						 | 
					5d83293540 | ||
| 
						 | 
					b652555f37 | ||
| 
						 | 
					3db09c1e2a | ||
| 
						 | 
					0d40141b2d | ||
| 
						 | 
					33e7a2310d | ||
| 
						 | 
					ddb112b989 | ||
| 
						 | 
					7502bc54d1 | ||
| 
						 | 
					15cc2c33f1 | ||
| 
						 | 
					eb0e928c6f | ||
| 
						 | 
					5631d23355 | ||
| 
						 | 
					0470cb0fa1 | ||
| 
						 | 
					1656b465ee | ||
| 
						 | 
					a558b23a98 | ||
| 
						 | 
					c569076c5d | ||
| 
						 | 
					be2516a3b8 | ||
| 
						 | 
					7f62a74877 | ||
| 
						 | 
					3b296a1fba | ||
| 
						 | 
					28c9cd353d | ||
| 
						 | 
					83a5c1a7d2 | ||
| 
						 | 
					a767502d66 | ||
| 
						 | 
					897ac3dab5 | ||
| 
						 | 
					2f165b4b48 | ||
| 
						 | 
					3994818b6a | ||
| 7b2dbc1777 | |||
| 8c59976de6 | |||
| d551a2cf7a | |||
| a3a09507a6 | |||
| 9bbde64147 | |||
| 0c4259d72e | |||
| 
						 | 
					57e0a37c78 | ||
| 
						 | 
					713af307cd | ||
| 
						 | 
					521b882798 | ||
| 
						 | 
					b850f5d621 | 
							
								
								
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -33,6 +33,7 @@ speed-measure-plugin.json
 | 
				
			|||||||
.history/*
 | 
					.history/*
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# misc
 | 
					# misc
 | 
				
			||||||
 | 
					/.angular/cache
 | 
				
			||||||
/.sass-cache
 | 
					/.sass-cache
 | 
				
			||||||
/connect.lock
 | 
					/connect.lock
 | 
				
			||||||
/coverage
 | 
					/coverage
 | 
				
			||||||
@@ -47,3 +48,4 @@ testem.log
 | 
				
			|||||||
Thumbs.db
 | 
					Thumbs.db
 | 
				
			||||||
projects/common/node_modules/
 | 
					projects/common/node_modules/
 | 
				
			||||||
projects/common-map/node_modules/
 | 
					projects/common-map/node_modules/
 | 
				
			||||||
 | 
					.angular/*
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										61
									
								
								angular.json
									
									
									
									
									
								
							
							
						
						
									
										61
									
								
								angular.json
									
									
									
									
									
								
							@@ -148,18 +148,6 @@
 | 
				
			|||||||
              "src/assets"
 | 
					              "src/assets"
 | 
				
			||||||
            ]
 | 
					            ]
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        "lint": {
 | 
					 | 
				
			||||||
          "builder": "@angular-devkit/build-angular:tslint",
 | 
					 | 
				
			||||||
          "options": {
 | 
					 | 
				
			||||||
            "tsConfig": [
 | 
					 | 
				
			||||||
              "src/tsconfig.app.json",
 | 
					 | 
				
			||||||
              "src/tsconfig.spec.json"
 | 
					 | 
				
			||||||
            ],
 | 
					 | 
				
			||||||
            "exclude": [
 | 
					 | 
				
			||||||
              "**/node_modules/**"
 | 
					 | 
				
			||||||
            ]
 | 
					 | 
				
			||||||
          }
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
@@ -179,15 +167,6 @@
 | 
				
			|||||||
              "devServerTarget": "farmmaps-lib-app:serve:production"
 | 
					              "devServerTarget": "farmmaps-lib-app:serve:production"
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        "lint": {
 | 
					 | 
				
			||||||
          "builder": "@angular-devkit/build-angular:tslint",
 | 
					 | 
				
			||||||
          "options": {
 | 
					 | 
				
			||||||
            "tsConfig": "e2e/tsconfig.e2e.json",
 | 
					 | 
				
			||||||
            "exclude": [
 | 
					 | 
				
			||||||
              "**/node_modules/**"
 | 
					 | 
				
			||||||
            ]
 | 
					 | 
				
			||||||
          }
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
@@ -216,18 +195,6 @@
 | 
				
			|||||||
            "tsConfig": "projects/common/tsconfig.spec.json",
 | 
					            "tsConfig": "projects/common/tsconfig.spec.json",
 | 
				
			||||||
            "karmaConfig": "projects/common/karma.conf.js"
 | 
					            "karmaConfig": "projects/common/karma.conf.js"
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        "lint": {
 | 
					 | 
				
			||||||
          "builder": "@angular-devkit/build-angular:tslint",
 | 
					 | 
				
			||||||
          "options": {
 | 
					 | 
				
			||||||
            "tsConfig": [
 | 
					 | 
				
			||||||
              "projects/common/tsconfig.lib.json",
 | 
					 | 
				
			||||||
              "projects/common/tsconfig.spec.json"
 | 
					 | 
				
			||||||
            ],
 | 
					 | 
				
			||||||
            "exclude": [
 | 
					 | 
				
			||||||
              "**/node_modules/**"
 | 
					 | 
				
			||||||
            ]
 | 
					 | 
				
			||||||
          }
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
@@ -256,18 +223,6 @@
 | 
				
			|||||||
            "tsConfig": "projects/common-map/tsconfig.spec.json",
 | 
					            "tsConfig": "projects/common-map/tsconfig.spec.json",
 | 
				
			||||||
            "karmaConfig": "projects/common-map/karma.conf.js"
 | 
					            "karmaConfig": "projects/common-map/karma.conf.js"
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        "lint": {
 | 
					 | 
				
			||||||
          "builder": "@angular-devkit/build-angular:tslint",
 | 
					 | 
				
			||||||
          "options": {
 | 
					 | 
				
			||||||
            "tsConfig": [
 | 
					 | 
				
			||||||
              "projects/common-map/tsconfig.lib.json",
 | 
					 | 
				
			||||||
              "projects/common-map/tsconfig.spec.json"
 | 
					 | 
				
			||||||
            ],
 | 
					 | 
				
			||||||
            "exclude": [
 | 
					 | 
				
			||||||
              "**/node_modules/**"
 | 
					 | 
				
			||||||
            ]
 | 
					 | 
				
			||||||
          }
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
@@ -296,21 +251,11 @@
 | 
				
			|||||||
            "tsConfig": "projects/common-map3d/tsconfig.spec.json",
 | 
					            "tsConfig": "projects/common-map3d/tsconfig.spec.json",
 | 
				
			||||||
            "karmaConfig": "projects/common-map3d/karma.conf.js"
 | 
					            "karmaConfig": "projects/common-map3d/karma.conf.js"
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        "lint": {
 | 
					 | 
				
			||||||
          "builder": "@angular-devkit/build-angular:tslint",
 | 
					 | 
				
			||||||
          "options": {
 | 
					 | 
				
			||||||
            "tsConfig": [
 | 
					 | 
				
			||||||
              "projects/common-map3d/tsconfig.lib.json",
 | 
					 | 
				
			||||||
              "projects/common-map3d/tsconfig.spec.json"
 | 
					 | 
				
			||||||
            ],
 | 
					 | 
				
			||||||
            "exclude": [
 | 
					 | 
				
			||||||
              "**/node_modules/**"
 | 
					 | 
				
			||||||
            ]
 | 
					 | 
				
			||||||
          }
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "defaultProject": "farmmaps-lib-app"
 | 
					  "cli": {
 | 
				
			||||||
 | 
					    "analytics": false
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -4,9 +4,13 @@ module.exports = {
 | 
				
			|||||||
      // Resolve node module use of fs
 | 
					      // Resolve node module use of fs
 | 
				
			||||||
      fs: "empty",
 | 
					      fs: "empty",
 | 
				
			||||||
      Buffer: false,
 | 
					      Buffer: false,
 | 
				
			||||||
      http: "empty",
 | 
					      http: require.resolve("stream-http"),
 | 
				
			||||||
      https: "empty",
 | 
					      https: require.resolve("https-browserify"),
 | 
				
			||||||
      zlib: "empty"
 | 
					      url: require.resolve("url/"),
 | 
				
			||||||
 | 
					      zlib: require.resolve('browserify-zlib'),
 | 
				
			||||||
 | 
					      assert: require.resolve("assert/"),
 | 
				
			||||||
 | 
					      util: require.resolve("util/"),
 | 
				
			||||||
 | 
					      buffer: require.resolve("buffer/")
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
							
								
								
									
										29436
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										29436
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										83
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										83
									
								
								package.json
									
									
									
									
									
								
							@@ -1,6 +1,6 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  "name": "farmmaps-lib-app",
 | 
					  "name": "farmmaps-lib-app",
 | 
				
			||||||
  "version": "2.0.3",
 | 
					  "version": "3.0.1",
 | 
				
			||||||
  "scripts": {
 | 
					  "scripts": {
 | 
				
			||||||
    "ng": "ng",
 | 
					    "ng": "ng",
 | 
				
			||||||
    "start": "ng serve",
 | 
					    "start": "ng serve",
 | 
				
			||||||
@@ -11,64 +11,73 @@
 | 
				
			|||||||
  },
 | 
					  },
 | 
				
			||||||
  "private": true,
 | 
					  "private": true,
 | 
				
			||||||
  "dependencies": {
 | 
					  "dependencies": {
 | 
				
			||||||
    "@angular/animations": "~12.2.8",
 | 
					    "@angular/animations": "^14.1.3",
 | 
				
			||||||
    "@angular/common": "~12.2.8",
 | 
					    "@angular/common": "^14.1.3",
 | 
				
			||||||
    "@angular/compiler": "~12.2.8",
 | 
					    "@angular/compiler": "^14.1.3",
 | 
				
			||||||
    "@angular/core": "~12.2.8",
 | 
					    "@angular/core": "^14.1.3",
 | 
				
			||||||
    "@angular/forms": "~12.2.8",
 | 
					    "@angular/forms": "^14.1.3",
 | 
				
			||||||
    "@angular/platform-browser": "~12.2.8",
 | 
					    "@angular/platform-browser": "^14.1.3",
 | 
				
			||||||
    "@angular/platform-browser-dynamic": "~12.2.8",
 | 
					    "@angular/platform-browser-dynamic": "^14.1.3",
 | 
				
			||||||
    "@angular/router": "~12.2.8",
 | 
					    "@angular/router": "^14.1.3",
 | 
				
			||||||
    "@farmmaps/common": "file:dist/common",
 | 
					    "@farmmaps/common": "file:dist/common",
 | 
				
			||||||
    "@farmmaps/common-map": "file:dist/common-map",
 | 
					    "@farmmaps/common-map": "file:dist/common-map",
 | 
				
			||||||
    "@farmmaps/common-map3d": "file:dist/common-map3d",
 | 
					    "@farmmaps/common-map3d": "file:dist/common-map3d",
 | 
				
			||||||
    "@microsoft/signalr": "^3.1.16",
 | 
					    "@microsoft/signalr": "^3.1.16",
 | 
				
			||||||
    "@ng-bootstrap/ng-bootstrap": "^9.0",
 | 
					    "@ng-bootstrap/ng-bootstrap": "^13.0.0",
 | 
				
			||||||
    "@ngrx/effects": "^12.0",
 | 
					    "@ngrx/effects": "^14",
 | 
				
			||||||
    "@ngrx/router-store": "^12.0",
 | 
					    "@ngrx/router-store": "^14",
 | 
				
			||||||
    "@ngrx/store": "^12.0",
 | 
					    "@ngrx/store": "^14",
 | 
				
			||||||
    "angular-oauth2-oidc": "^12.0",
 | 
					    "@popperjs/core": "^2.11.6",
 | 
				
			||||||
    "bootstrap": "^4.6.0",
 | 
					    "angular-oauth2-oidc": "^13",
 | 
				
			||||||
    "cesium": "^1.82.1",
 | 
					    "assert": "^2.0.0",
 | 
				
			||||||
 | 
					    "bootstrap": "^5.2.0",
 | 
				
			||||||
 | 
					    "browserify-zlib": "^0.2.0",
 | 
				
			||||||
 | 
					    "buffer": "^6.0.3",
 | 
				
			||||||
 | 
					    "cesium": "^1.97.0",
 | 
				
			||||||
    "core-js": "^2.6.12",
 | 
					    "core-js": "^2.6.12",
 | 
				
			||||||
    "moment": "^2.29.1",
 | 
					    "https-browserify": "^1.0.0",
 | 
				
			||||||
    "ngrx-store-localstorage": "^12.0",
 | 
					    "moment": "^2.29.4",
 | 
				
			||||||
 | 
					    "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": "^3.5.1",
 | 
					    "ngx-uploadx": "^5.2.0",
 | 
				
			||||||
    "ol": "6.8.1",
 | 
					    "ol": "6.14.1",
 | 
				
			||||||
    "ol-cesium": "^2.13.0",
 | 
					    "olcs": "^2.13.1",
 | 
				
			||||||
    "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.2.0",
 | 
					    "tslib": "^2.4.0",
 | 
				
			||||||
 | 
					    "url": "^0.11.0",
 | 
				
			||||||
 | 
					    "util": "^0.12.4",
 | 
				
			||||||
    "zone.js": "~0.11.4"
 | 
					    "zone.js": "~0.11.4"
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "devDependencies": {
 | 
					  "devDependencies": {
 | 
				
			||||||
    "@angular-builders/custom-webpack": "^12.1.3",
 | 
					    "@angular-builders/custom-webpack": "^14",
 | 
				
			||||||
    "@angular-devkit/build-angular": "^12.2.8",
 | 
					    "@angular-devkit/build-angular": "^14.1.3",
 | 
				
			||||||
    "@angular/cli": "^12.2.8",
 | 
					    "@angular/cli": "^14.1.3",
 | 
				
			||||||
    "@angular/compiler-cli": "~12.2.8",
 | 
					    "@angular/compiler-cli": "^14.1.3",
 | 
				
			||||||
    "@angular/language-service": "~12.2.8",
 | 
					    "@angular/language-service": "^14.1.3",
 | 
				
			||||||
    "@angular/localize": "^12.2.8",
 | 
					    "@angular/localize": "^14.1.3",
 | 
				
			||||||
    "@types/arcgis-rest-api": "^10.4.5",
 | 
					    "@types/arcgis-rest-api": "^10.4.5",
 | 
				
			||||||
    "@types/jasmine": "~2.8.8",
 | 
					    "@types/jasmine": "~2.8.8",
 | 
				
			||||||
    "@types/jasminewd2": "^2.0.9",
 | 
					    "@types/jasminewd2": "^2.0.9",
 | 
				
			||||||
    "@types/node": "^12.20.15",
 | 
					    "@types/node": "^12.20.15",
 | 
				
			||||||
    "codelyzer": "^5.1.2",
 | 
					    "codelyzer": "^0.0.28",
 | 
				
			||||||
    "jasmine-core": "~3.5.0",
 | 
					    "jasmine-core": "^4.3.0",
 | 
				
			||||||
    "jasmine-spec-reporter": "~5.0.0",
 | 
					    "jasmine-spec-reporter": "^7.0.0",
 | 
				
			||||||
    "karma": "~6.3.3",
 | 
					    "karma": "^6.3.20",
 | 
				
			||||||
    "karma-chrome-launcher": "~3.1.0",
 | 
					    "karma-chrome-launcher": "~3.1.0",
 | 
				
			||||||
    "karma-coverage-istanbul-reporter": "~3.0.2",
 | 
					    "karma-coverage-istanbul-reporter": "^3.0.3",
 | 
				
			||||||
    "karma-jasmine": "~4.0.0",
 | 
					    "karma-jasmine": "^5.1.0",
 | 
				
			||||||
    "karma-jasmine-html-reporter": "^1.6.0",
 | 
					    "karma-jasmine-html-reporter": "^2.0.0",
 | 
				
			||||||
    "ng-packagr": "^12.2.2",
 | 
					    "ng-packagr": "^14.1.0",
 | 
				
			||||||
    "protractor": "~7.0.0",
 | 
					    "protractor": "~7.0.0",
 | 
				
			||||||
    "ts-node": "^8.8.1",
 | 
					    "ts-node": "^8.8.1",
 | 
				
			||||||
    "tslint": "~6.1.0",
 | 
					    "tslint": "~6.1.0",
 | 
				
			||||||
    "typescript": "~4.3.5"
 | 
					    "typescript": "~4.6.4"
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,14 +8,14 @@
 | 
				
			|||||||
    "tslib": "^2.0.0"
 | 
					    "tslib": "^2.0.0"
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "peerDependencies": {
 | 
					  "peerDependencies": {
 | 
				
			||||||
    "@angular/core": "~12.2.8",
 | 
					    "@angular/core": ">=14.0.0",
 | 
				
			||||||
    "ngrx-store-localstorage": "^12.0",
 | 
					    "ngrx-store-localstorage": ">=14.0.0",
 | 
				
			||||||
    "@ngrx/effects": "^12.0",
 | 
					    "@ngrx/effects": ">=14.0.0",
 | 
				
			||||||
    "@ngrx/router-store":"^12.0",
 | 
					    "@ngrx/router-store":">=14.0.0",
 | 
				
			||||||
    "@ngrx/store":"^12.0",
 | 
					    "@ngrx/store":">=14.0.0",
 | 
				
			||||||
    "tassign": "^1.0.0",
 | 
					    "tassign": ">=1.0.0",
 | 
				
			||||||
    "@farmmaps/common": "~2.0",
 | 
					    "@farmmaps/common": ">=2.0.0",
 | 
				
			||||||
    "ngx-openlayers": "1.0.0-next.19",
 | 
					    "ngx-openlayers": ">=1.0.0-next.19",
 | 
				
			||||||
    "ol": "6.8.1"
 | 
					    "ol": ">=6.8.1"
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -54,6 +54,9 @@ export const SETLAYERVALUESLOCATION = '[Map] SetLayerValuesLocation'
 | 
				
			|||||||
export const TOGGLELAYERVALUESENABLED = '[Map] ToggleLayerValuesEnabled'
 | 
					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 SETVIEWSTATE = '[Map] SetViewState'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export class Clear implements Action {
 | 
					export class Clear implements Action {
 | 
				
			||||||
  readonly type = CLEAR;
 | 
					  readonly type = CLEAR;
 | 
				
			||||||
@@ -316,6 +319,16 @@ export class GetLayerValueSuccess implements Action {
 | 
				
			|||||||
  constructor(public layervalue:ILayervalue) { }
 | 
					  constructor(public layervalue:ILayervalue) { }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export class ToggleShowDataLayerSlide implements Action {
 | 
				
			||||||
 | 
					  readonly type = TOGGLESHOWDATALAYERSLIDE;
 | 
				
			||||||
 | 
					  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
 | 
				
			||||||
@@ -359,5 +372,7 @@ export type Actions = SetMapState
 | 
				
			|||||||
  | ToggleLayerValuesEnabled
 | 
					  | ToggleLayerValuesEnabled
 | 
				
			||||||
  | GetLayerValueSuccess
 | 
					  | GetLayerValueSuccess
 | 
				
			||||||
  | GetLayerValue
 | 
					  | GetLayerValue
 | 
				
			||||||
  | SetPeriod;
 | 
					  | SetPeriod
 | 
				
			||||||
 | 
					  | ToggleShowDataLayerSlide
 | 
				
			||||||
 | 
					  | SetViewState;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -169,134 +169,119 @@ export {
 | 
				
			|||||||
  GeometryThumbnailComponent
 | 
					  GeometryThumbnailComponent
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@NgModule({
 | 
					@NgModule({
 | 
				
			||||||
  imports: [
 | 
					    imports: [
 | 
				
			||||||
    CommonModule,
 | 
					        CommonModule,
 | 
				
			||||||
    AngularOpenlayersModule,
 | 
					        AngularOpenlayersModule,
 | 
				
			||||||
    MapRoutingModule,
 | 
					        MapRoutingModule,
 | 
				
			||||||
    StoreModule.forFeature(MODULE_NAME, mapReducers.reducer,{metaReducers:metaReducers}),
 | 
					        StoreModule.forFeature(MODULE_NAME, mapReducers.reducer, { metaReducers: metaReducers }),
 | 
				
			||||||
    EffectsModule.forFeature([mapEffects.MapEffects]),
 | 
					        EffectsModule.forFeature([mapEffects.MapEffects]),
 | 
				
			||||||
    NgbModule,
 | 
					        NgbModule,
 | 
				
			||||||
    FormsModule,
 | 
					        FormsModule,
 | 
				
			||||||
    ReactiveFormsModule,
 | 
					        ReactiveFormsModule,
 | 
				
			||||||
    AppCommonModule
 | 
					        AppCommonModule
 | 
				
			||||||
  ],
 | 
					    ],
 | 
				
			||||||
  declarations: [
 | 
					    declarations: [
 | 
				
			||||||
    ZoomToExtentComponent,
 | 
					        ZoomToExtentComponent,
 | 
				
			||||||
    ItemVectorSourceComponent,
 | 
					        ItemVectorSourceComponent,
 | 
				
			||||||
    ItemLayersComponent,
 | 
					        ItemLayersComponent,
 | 
				
			||||||
    FileDropTargetComponent,
 | 
					        FileDropTargetComponent,
 | 
				
			||||||
    MapComponent,
 | 
					        MapComponent,
 | 
				
			||||||
    MetaDataModalComponent,
 | 
					        MetaDataModalComponent,
 | 
				
			||||||
    RotationResetComponent,
 | 
					        RotationResetComponent,
 | 
				
			||||||
    MapSearchComponent,
 | 
					        MapSearchComponent,
 | 
				
			||||||
    SelectPeriodModalComponent,
 | 
					        SelectPeriodModalComponent,
 | 
				
			||||||
    LayerListComponent,
 | 
					        LayerListComponent,
 | 
				
			||||||
    LegendComponent,
 | 
					        LegendComponent,
 | 
				
			||||||
    LayerVectorImageComponent,
 | 
					        LayerVectorImageComponent,
 | 
				
			||||||
    FeatureListComponent,
 | 
					        FeatureListComponent,
 | 
				
			||||||
    WidgetHostDirective,
 | 
					        WidgetHostDirective,
 | 
				
			||||||
    FeatureListContainerComponent,
 | 
					        FeatureListContainerComponent,
 | 
				
			||||||
    FeatureListCroppingschemeComponent,
 | 
					        FeatureListCroppingschemeComponent,
 | 
				
			||||||
    FeatureListCropfieldComponent,
 | 
					        FeatureListCropfieldComponent,
 | 
				
			||||||
    FeatureListFeatureContainerComponent,
 | 
					        FeatureListFeatureContainerComponent,
 | 
				
			||||||
    FeatureListFeatureComponent,
 | 
					        FeatureListFeatureComponent,
 | 
				
			||||||
    FeatureListFeatureCroppingschemeComponent,
 | 
					        FeatureListFeatureCroppingschemeComponent,
 | 
				
			||||||
    FeatureListFeatureCropfieldComponent,
 | 
					        FeatureListFeatureCropfieldComponent,
 | 
				
			||||||
    SelectedItemContainerComponent,
 | 
					        SelectedItemContainerComponent,
 | 
				
			||||||
    SelectedItemComponent,
 | 
					        SelectedItemComponent,
 | 
				
			||||||
    SelectedItemCropfieldComponent,
 | 
					        SelectedItemCropfieldComponent,
 | 
				
			||||||
    SelectedItemGeotiffComponent,
 | 
					        SelectedItemGeotiffComponent,
 | 
				
			||||||
    SelectedItemTemporalComponent,
 | 
					        SelectedItemTemporalComponent,
 | 
				
			||||||
    SelectedItemShapeComponent,
 | 
					        SelectedItemShapeComponent,
 | 
				
			||||||
    ItemListItemComponent,
 | 
					        ItemListItemComponent,
 | 
				
			||||||
    ItemListItemContainerComponent,
 | 
					        ItemListItemContainerComponent,
 | 
				
			||||||
    ItemListComponent,
 | 
					        ItemListComponent,
 | 
				
			||||||
    ItemWidgetListComponent,
 | 
					        ItemWidgetListComponent,
 | 
				
			||||||
    WidgetStatusComponent,
 | 
					        WidgetStatusComponent,
 | 
				
			||||||
    GpsLocation,
 | 
					        GpsLocation,
 | 
				
			||||||
    PanToLocation,
 | 
					        PanToLocation,
 | 
				
			||||||
    LayerSwitcher,
 | 
					        LayerSwitcher,
 | 
				
			||||||
    HistogramDetailsComponent,
 | 
					        HistogramDetailsComponent,
 | 
				
			||||||
    StatisticsDetailsComponent,
 | 
					        StatisticsDetailsComponent,
 | 
				
			||||||
    ifZoomToShowDirective,
 | 
					        ifZoomToShowDirective,
 | 
				
			||||||
    ZoomToShowAlert,
 | 
					        ZoomToShowAlert,
 | 
				
			||||||
    LayerValuesComponent,
 | 
					        LayerValuesComponent,
 | 
				
			||||||
    GeometryThumbnailComponent
 | 
					        GeometryThumbnailComponent
 | 
				
			||||||
  ],
 | 
					    ],
 | 
				
			||||||
  entryComponents: [
 | 
					    exports: [
 | 
				
			||||||
    FeatureListComponent,
 | 
					        ItemVectorSourceComponent,
 | 
				
			||||||
    FeatureListCroppingschemeComponent,
 | 
					        ItemLayersComponent,
 | 
				
			||||||
    FeatureListCropfieldComponent,
 | 
					        FileDropTargetComponent,
 | 
				
			||||||
    FeatureListFeatureComponent,
 | 
					        MetaDataModalComponent,
 | 
				
			||||||
    FeatureListFeatureCroppingschemeComponent,
 | 
					        MapComponent,
 | 
				
			||||||
    FeatureListFeatureCropfieldComponent,
 | 
					        GpsLocation,
 | 
				
			||||||
    SelectedItemComponent,
 | 
					        PanToLocation,
 | 
				
			||||||
    SelectedItemCropfieldComponent,
 | 
					        LayerSwitcher,
 | 
				
			||||||
    SelectedItemGeotiffComponent,
 | 
					        FeatureListFeatureComponent,
 | 
				
			||||||
    SelectedItemTemporalComponent,
 | 
					        FeatureListFeatureCropfieldComponent,
 | 
				
			||||||
    SelectedItemShapeComponent,
 | 
					        FeatureListFeatureCroppingschemeComponent,
 | 
				
			||||||
    ItemListComponent,
 | 
					        SelectedItemContainerComponent,
 | 
				
			||||||
    ItemListItemComponent,
 | 
					        SelectedItemComponent,
 | 
				
			||||||
  ],
 | 
					        SelectedItemCropfieldComponent,
 | 
				
			||||||
  exports: [
 | 
					        SelectedItemGeotiffComponent,
 | 
				
			||||||
       ItemVectorSourceComponent,
 | 
					        SelectedItemTemporalComponent,
 | 
				
			||||||
       ItemLayersComponent,
 | 
					        SelectedItemShapeComponent,
 | 
				
			||||||
       FileDropTargetComponent,
 | 
					        ItemListItemComponent,
 | 
				
			||||||
       MetaDataModalComponent,
 | 
					        ItemListItemContainerComponent,
 | 
				
			||||||
       MapComponent,
 | 
					        ItemListComponent,
 | 
				
			||||||
       GpsLocation,
 | 
					        ItemWidgetListComponent,
 | 
				
			||||||
       PanToLocation,
 | 
					        WidgetStatusComponent,
 | 
				
			||||||
       LayerSwitcher,
 | 
					        RotationResetComponent,
 | 
				
			||||||
       FeatureListFeatureComponent,
 | 
					        MapSearchComponent,
 | 
				
			||||||
       FeatureListFeatureCropfieldComponent,
 | 
					        SelectPeriodModalComponent,
 | 
				
			||||||
       FeatureListFeatureCroppingschemeComponent,
 | 
					        LayerListComponent,
 | 
				
			||||||
       SelectedItemContainerComponent,
 | 
					        LegendComponent,
 | 
				
			||||||
       SelectedItemComponent,
 | 
					        LayerVectorImageComponent,
 | 
				
			||||||
       SelectedItemCropfieldComponent,
 | 
					        FeatureListComponent,
 | 
				
			||||||
       SelectedItemGeotiffComponent,
 | 
					        WidgetHostDirective,
 | 
				
			||||||
       SelectedItemTemporalComponent,
 | 
					        FeatureListContainerComponent,
 | 
				
			||||||
       SelectedItemShapeComponent,
 | 
					        FeatureListCroppingschemeComponent,
 | 
				
			||||||
       ItemListItemComponent,
 | 
					        FeatureListCropfieldComponent,
 | 
				
			||||||
       ItemListItemContainerComponent,
 | 
					        FeatureListFeatureContainerComponent,
 | 
				
			||||||
       ItemListComponent,
 | 
					        ZoomToExtentComponent,
 | 
				
			||||||
       ItemWidgetListComponent,
 | 
					        ifZoomToShowDirective,
 | 
				
			||||||
       WidgetStatusComponent,
 | 
					        ZoomToShowAlert,
 | 
				
			||||||
       RotationResetComponent,
 | 
					        GeometryThumbnailComponent
 | 
				
			||||||
       MapSearchComponent,
 | 
					    ],
 | 
				
			||||||
       SelectPeriodModalComponent,
 | 
					    providers: [
 | 
				
			||||||
       LayerListComponent,
 | 
					        FeatureIconService,
 | 
				
			||||||
       LegendComponent,
 | 
					        GeolocationService,
 | 
				
			||||||
       LayerVectorImageComponent,
 | 
					        DeviceOrientationService,
 | 
				
			||||||
       FeatureListComponent,
 | 
					        TemporalService,
 | 
				
			||||||
       WidgetHostDirective,
 | 
					        { provide: AbstractFeatureListComponent, useClass: FeatureListCroppingschemeComponent, multi: true },
 | 
				
			||||||
       FeatureListContainerComponent,
 | 
					        { provide: AbstractFeatureListComponent, useClass: FeatureListCropfieldComponent, multi: true },
 | 
				
			||||||
       FeatureListCroppingschemeComponent,
 | 
					        { provide: AbstractFeatureListFeatureComponent, useClass: FeatureListFeatureComponent, multi: true },
 | 
				
			||||||
       FeatureListCropfieldComponent,
 | 
					        { provide: AbstractFeatureListFeatureComponent, useClass: FeatureListFeatureCroppingschemeComponent, multi: true },
 | 
				
			||||||
       FeatureListFeatureContainerComponent,
 | 
					        { provide: AbstractFeatureListFeatureComponent, useClass: FeatureListFeatureCropfieldComponent, multi: true },
 | 
				
			||||||
       ZoomToExtentComponent,
 | 
					        { provide: AbstractSelectedItemComponent, useClass: SelectedItemComponent, multi: true },
 | 
				
			||||||
       ifZoomToShowDirective,
 | 
					        { provide: AbstractSelectedItemComponent, useClass: SelectedItemCropfieldComponent, multi: true },
 | 
				
			||||||
       ZoomToShowAlert,
 | 
					        { provide: AbstractSelectedItemComponent, useClass: SelectedItemGeotiffComponent, multi: true },
 | 
				
			||||||
       GeometryThumbnailComponent
 | 
					        { provide: AbstractSelectedItemComponent, useClass: SelectedItemTemporalComponent, multi: true },
 | 
				
			||||||
  ],
 | 
					        { provide: AbstractSelectedItemComponent, useClass: SelectedItemShapeComponent, multi: true },
 | 
				
			||||||
  providers: [
 | 
					        { provide: AbstractItemListItemComponent, useClass: ItemListItemComponent, multi: true },
 | 
				
			||||||
    FeatureIconService,
 | 
					        { provide: AbstractItemListComponent, useClass: ItemListComponent, multi: true }
 | 
				
			||||||
    GeolocationService,
 | 
					    ]
 | 
				
			||||||
    DeviceOrientationService,
 | 
					 | 
				
			||||||
    TemporalService,
 | 
					 | 
				
			||||||
    { provide: AbstractFeatureListComponent, useClass: FeatureListCroppingschemeComponent, multi: true },
 | 
					 | 
				
			||||||
    { provide: AbstractFeatureListComponent, useClass: FeatureListCropfieldComponent, multi: true },
 | 
					 | 
				
			||||||
    { provide: AbstractFeatureListFeatureComponent, useClass: FeatureListFeatureComponent, multi: true },
 | 
					 | 
				
			||||||
    { provide: AbstractFeatureListFeatureComponent, useClass: FeatureListFeatureCroppingschemeComponent, multi: true },
 | 
					 | 
				
			||||||
    { provide: AbstractFeatureListFeatureComponent, useClass: FeatureListFeatureCropfieldComponent, multi: true },
 | 
					 | 
				
			||||||
    { provide: AbstractSelectedItemComponent, useClass: SelectedItemComponent, multi: true },
 | 
					 | 
				
			||||||
    { provide: AbstractSelectedItemComponent, useClass: SelectedItemCropfieldComponent, multi: true },
 | 
					 | 
				
			||||||
    { provide: AbstractSelectedItemComponent, useClass: SelectedItemGeotiffComponent, multi: true },
 | 
					 | 
				
			||||||
    { provide: AbstractSelectedItemComponent, useClass: SelectedItemTemporalComponent, multi: true },
 | 
					 | 
				
			||||||
    { provide: AbstractSelectedItemComponent, useClass: SelectedItemShapeComponent, multi: true },
 | 
					 | 
				
			||||||
    { provide: AbstractItemListItemComponent, useClass: ItemListItemComponent, multi: true },
 | 
					 | 
				
			||||||
    { provide: AbstractItemListComponent, useClass: ItemListComponent, multi: true }
 | 
					 | 
				
			||||||
  ]
 | 
					 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,11 +13,12 @@ import {Tile,Layer,Image} from 'ol/layer';
 | 
				
			|||||||
import {XYZ,ImageStatic,OSM,BingMaps,TileWMS,TileArcGISRest,TileJSON,Source} from 'ol/source';
 | 
					import {XYZ,ImageStatic,OSM,BingMaps,TileWMS,TileArcGISRest,TileJSON,Source} from 'ol/source';
 | 
				
			||||||
import {Vector as VectorSource} from 'ol/source';
 | 
					import {Vector as VectorSource} from 'ol/source';
 | 
				
			||||||
import { Vector as VectorLayer } from 'ol/layer';
 | 
					import { Vector as VectorLayer } from 'ol/layer';
 | 
				
			||||||
 | 
					import { VectorImage as VectorImageLayer } from 'ol/layer';
 | 
				
			||||||
import VectorTileSource from 'ol/source/VectorTile';
 | 
					import VectorTileSource from 'ol/source/VectorTile';
 | 
				
			||||||
import VectorTileLayer from 'ol/layer/VectorTile';
 | 
					import VectorTileLayer from 'ol/layer/VectorTile';
 | 
				
			||||||
import {GeoJSON,MVT} from 'ol/format';
 | 
					import {GeoJSON,MVT} from 'ol/format';
 | 
				
			||||||
import { Geometry } from 'ol/geom';
 | 
					import { Geometry } from 'ol/geom';
 | 
				
			||||||
import TileSource from 'ol/source/Tile';
 | 
					import BaseLayer from 'ol/layer/Base';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@Component({
 | 
					@Component({
 | 
				
			||||||
  selector: 'fm-map-item-layers',
 | 
					  selector: 'fm-map-item-layers',
 | 
				
			||||||
@@ -32,9 +33,11 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange
 | 
				
			|||||||
  @Input() itemLayer: IItemLayer;
 | 
					  @Input() itemLayer: IItemLayer;
 | 
				
			||||||
  @Output() onFeatureSelected: EventEmitter<any> = new EventEmitter<any>();
 | 
					  @Output() onFeatureSelected: EventEmitter<any> = new EventEmitter<any>();
 | 
				
			||||||
  @Output() onFeatureHover: EventEmitter<any> = new EventEmitter<any>();
 | 
					  @Output() onFeatureHover: EventEmitter<any> = new EventEmitter<any>();
 | 
				
			||||||
 | 
					  @Output() onPrerender: EventEmitter<any> = new EventEmitter<any>();
 | 
				
			||||||
  private _apiEndPoint: string;
 | 
					  private _apiEndPoint: string;
 | 
				
			||||||
  private initialized:boolean = false;
 | 
					  private initialized:boolean = false;
 | 
				
			||||||
  private mapEventHandlerInstalled = false;
 | 
					  private mapEventHandlerInstalled = false;
 | 
				
			||||||
 | 
					  private topLayerPrerenderEventhandlerInstalled = false;
 | 
				
			||||||
  private selectedFeatures = {};
 | 
					  private selectedFeatures = {};
 | 
				
			||||||
  private selectionLayer:Layer<Source> = null;
 | 
					  private selectionLayer:Layer<Source> = null;
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
@@ -191,7 +194,8 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange
 | 
				
			|||||||
          });
 | 
					          });
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      });
 | 
					      });
 | 
				
			||||||
      layer = new VectorLayer({
 | 
					      layer = new VectorImageLayer({
 | 
				
			||||||
 | 
					        declutter: true,
 | 
				
			||||||
        source: source,
 | 
					        source: source,
 | 
				
			||||||
        style: (feature) => {
 | 
					        style: (feature) => {
 | 
				
			||||||
          var key =feature.get("code") + "_" + feature.get("color");
 | 
					          var key =feature.get("code") + "_" + feature.get("color");
 | 
				
			||||||
@@ -362,6 +366,30 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  installTopLayerPrerenderEventhandler(olLayer : Layer<Source>) {
 | 
				
			||||||
 | 
					    if(!this.topLayerPrerenderEventhandlerInstalled  && this.onPrerender.observers.length > 0  && olLayer) {
 | 
				
			||||||
 | 
					      if(this.instance.getVisible()) {
 | 
				
			||||||
 | 
					        olLayer.on('prerender',this.topLayerPrerenderEventhandler);
 | 
				
			||||||
 | 
					        olLayer.on('postrender',this.topLayerPostrenderEventhandler);
 | 
				
			||||||
 | 
					        this.topLayerPrerenderEventhandlerInstalled = true;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  unInstallTopLayerPrerenderEventhandler() {
 | 
				
			||||||
 | 
					    if(this.topLayerPrerenderEventhandlerInstalled && this.onPrerender.observers.length > 0 )
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					      if(this.instance.getVisible()) {
 | 
				
			||||||
 | 
					        var olLayers = this.instance.getLayers().getArray().forEach((l:any) => {
 | 
				
			||||||
 | 
					          l.un('prerender',this.topLayerPrerenderEventhandler);
 | 
				
			||||||
 | 
					          l.un('postrender',this.topLayerPostrenderEventhandler);
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
 | 
					        this.topLayerPrerenderEventhandlerInstalled = false;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  addOrUpdateOlLayer(itemLayer:IItemLayer,index:number):Layer<Source> {
 | 
					  addOrUpdateOlLayer(itemLayer:IItemLayer,index:number):Layer<Source> {
 | 
				
			||||||
    if(!itemLayer) return null;
 | 
					    if(!itemLayer) return null;
 | 
				
			||||||
    var olLayers = this.instance.getLayers();
 | 
					    var olLayers = this.instance.getLayers();
 | 
				
			||||||
@@ -386,10 +414,19 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange
 | 
				
			|||||||
    return layer;
 | 
					    return layer;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  updateLayers(itemLayers: IItemLayer[]) {
 | 
					  updateLayers(itemLayers: IItemLayer[] | IItemLayer) {
 | 
				
			||||||
 | 
					    this.unInstallTopLayerPrerenderEventhandler();
 | 
				
			||||||
 | 
					    let dataLayer = false;
 | 
				
			||||||
 | 
					    var ils:IItemLayer[] = [];
 | 
				
			||||||
 | 
					    if(Array.isArray(itemLayers)) {
 | 
				
			||||||
 | 
					       ils = itemLayers;
 | 
				
			||||||
 | 
					    } else {
 | 
				
			||||||
 | 
					      dataLayer=true;
 | 
				
			||||||
 | 
					       ils=[itemLayers];
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    let newLayers: Layer<Source>[] = [];
 | 
					    let newLayers: Layer<Source>[] = [];
 | 
				
			||||||
    if (itemLayers) {
 | 
					    if (ils) {
 | 
				
			||||||
      itemLayers.forEach((itemLayer, index) => {
 | 
					      ils.forEach((itemLayer, index) => {
 | 
				
			||||||
        if(itemLayer.item.itemType ==  'vnd.farmmaps.itemtype.temporal') {
 | 
					        if(itemLayer.item.itemType ==  'vnd.farmmaps.itemtype.temporal') {
 | 
				
			||||||
          let il = itemLayer as ITemporalItemLayer;
 | 
					          let il = itemLayer as ITemporalItemLayer;
 | 
				
			||||||
          let previousLayer = this.addOrUpdateOlLayer(il.previousItemLayer,newLayers.length);          
 | 
					          let previousLayer = this.addOrUpdateOlLayer(il.previousItemLayer,newLayers.length);          
 | 
				
			||||||
@@ -398,9 +435,11 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange
 | 
				
			|||||||
          if(selectedLayer) newLayers.push(selectedLayer);
 | 
					          if(selectedLayer) newLayers.push(selectedLayer);
 | 
				
			||||||
          let nextLayer = this.addOrUpdateOlLayer(il.nextItemLayer,newLayers.length);
 | 
					          let nextLayer = this.addOrUpdateOlLayer(il.nextItemLayer,newLayers.length);
 | 
				
			||||||
          if(nextLayer) newLayers.push(nextLayer);
 | 
					          if(nextLayer) newLayers.push(nextLayer);
 | 
				
			||||||
 | 
					          this.installTopLayerPrerenderEventhandler(selectedLayer);
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
          let layer = this.addOrUpdateOlLayer(itemLayer,newLayers.length);
 | 
					          let layer = this.addOrUpdateOlLayer(itemLayer,newLayers.length);
 | 
				
			||||||
          if(layer) newLayers.push(layer);           
 | 
					          if(layer) newLayers.push(layer);    
 | 
				
			||||||
 | 
					          this.installTopLayerPrerenderEventhandler(layer);       
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      });
 | 
					      });
 | 
				
			||||||
      // Remove the layers that have disapeared from childrenLayers
 | 
					      // Remove the layers that have disapeared from childrenLayers
 | 
				
			||||||
@@ -409,17 +448,27 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange
 | 
				
			|||||||
        olLayers.removeAt(newLayers.length);
 | 
					        olLayers.removeAt(newLayers.length);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      this.selectionLayer=null;
 | 
					      this.selectionLayer=null;
 | 
				
			||||||
      if(this.mapEventHandlerInstalled && itemLayers.length==1 && this.getItemlayer(itemLayers[0]).item.itemType == 'vnd.farmmaps.itemtype.shape.processed') {
 | 
					      if(this.mapEventHandlerInstalled && ils.length==1 && this.getItemlayer(itemLayers[0]).item.itemType == 'vnd.farmmaps.itemtype.shape.processed') {
 | 
				
			||||||
        this.selectionLayer = this.createSelectionLayer(this.getItemlayer(itemLayers[0]));
 | 
					        this.selectionLayer = this.createSelectionLayer(this.getItemlayer(itemLayers[0]));
 | 
				
			||||||
        if(this.selectionLayer) olLayers.push(this.selectionLayer)
 | 
					        if(this.selectionLayer) olLayers.push(this.selectionLayer)
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  topLayerPrerenderEventhandler = (event) => {
 | 
				
			||||||
 | 
					     this.onPrerender.emit(event);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  topLayerPostrenderEventhandler = (event) => {
 | 
				
			||||||
 | 
					    const ctx = event.context;
 | 
				
			||||||
 | 
					    ctx.restore();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  mapEventHandler = (event) => {
 | 
					  mapEventHandler = (event) => {
 | 
				
			||||||
    // select only when having observers
 | 
					    // select only when having observers
 | 
				
			||||||
    if(event.type === 'click' && !this.onFeatureSelected.observers.length) return;
 | 
					    if(event.type === 'click' && !this.onFeatureSelected.observers.length) return;
 | 
				
			||||||
    if(event.type === 'pointermove' && !this.onFeatureHover.observers.length) return;
 | 
					    if(event.type === 'pointermove' && !this.onFeatureHover.observers.length) return;    
 | 
				
			||||||
    let itemLayer= this.getItemlayer(this.itemLayer);
 | 
					    let itemLayer= this.getItemlayer(this.itemLayer);
 | 
				
			||||||
    if(itemLayer && itemLayer.layer) {
 | 
					    if(itemLayer && itemLayer.layer) {
 | 
				
			||||||
       this.selectedFeatures = {};
 | 
					       this.selectedFeatures = {};
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -29,7 +29,7 @@ div.gps-location:hover .pan-to {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
div.gps-location:hover .pan-to-centered {
 | 
					div.gps-location:hover .pan-to-centered {
 | 
				
			||||||
  fill: theme-color-level($color-name: "primary", $level: -10) 
 | 
					  fill: theme-color-level(primary, -10) 
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.pan-to.pan-to-disabled {
 | 
					.pan-to.pan-to-disabled {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -20,7 +20,7 @@
 | 
				
			|||||||
          </div>
 | 
					          </div>
 | 
				
			||||||
        </li>
 | 
					        </li>
 | 
				
			||||||
        <li class="nav-item py-0" *ngIf="selectedItemLayer$ | async as selectedItemLayer">
 | 
					        <li class="nav-item py-0" *ngIf="selectedItemLayer$ | async as selectedItemLayer">
 | 
				
			||||||
          <span><i class="fal fa-layer-group" aria-hidden="true"></i> <span i18n>Data</span></span>
 | 
					          <span><i class="fal fa-layer-group" aria-hidden="true"></i> <span i18n>Data</span><span class="slideButton"><a href="#" title="Compare" class="btn btn-light btn-sm" (click)="handleToggleShowDatalayerSlide($event)"><i class="fal fa-sliders-h-square"></i></a></span></span>
 | 
				
			||||||
          <div class="mb-4">
 | 
					          <div class="mb-4">
 | 
				
			||||||
            <fm-map-layer-list [dataLayers]="true" [itemLayers]="[selectedItemLayer]" [selectedLayer]="selectedItemLayer" (onToggleVisibility)="handleOnToggleVisibility($event)" (onSetOpacity)="handleOnSetOpacity($event)" (onZoomToExtent)="handleZoomToExtent($event)" (onSelectLayer)="handleSelectOverlayLayer($event)"></fm-map-layer-list>
 | 
					            <fm-map-layer-list [dataLayers]="true" [itemLayers]="[selectedItemLayer]" [selectedLayer]="selectedItemLayer" (onToggleVisibility)="handleOnToggleVisibility($event)" (onSetOpacity)="handleOnSetOpacity($event)" (onZoomToExtent)="handleZoomToExtent($event)" (onSelectLayer)="handleSelectOverlayLayer($event)"></fm-map-layer-list>
 | 
				
			||||||
          </div>
 | 
					          </div>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -19,6 +19,10 @@
 | 
				
			|||||||
  font-weight: bold;
 | 
					  font-weight: bold;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.slideButton {
 | 
				
			||||||
 | 
					  margin-left: 1em;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.layers {
 | 
					.layers {
 | 
				
			||||||
  color:$secondary;
 | 
					  color:$secondary;
 | 
				
			||||||
  position: absolute;
 | 
					  position: absolute;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -76,4 +76,10 @@ export class LayerSwitcher  implements OnInit,OnChanges{
 | 
				
			|||||||
  handleSelectBaseLayer(itemLayer: IItemLayer) {
 | 
					  handleSelectBaseLayer(itemLayer: IItemLayer) {
 | 
				
			||||||
    this.store.dispatch(new mapActions.SelectBaseLayer(itemLayer));
 | 
					    this.store.dispatch(new mapActions.SelectBaseLayer(itemLayer));
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  handleToggleShowDatalayerSlide(event:Event) {
 | 
				
			||||||
 | 
					    this.store.dispatch(new mapActions.ShowLayerSwitcher(false));    
 | 
				
			||||||
 | 
					    this.store.dispatch(new mapActions.ToggleShowDataLayerSlide());
 | 
				
			||||||
 | 
					    event.preventDefault();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -20,32 +20,42 @@
 | 
				
			|||||||
  compassHeading:compassHeading$|async,
 | 
					  compassHeading:compassHeading$|async,
 | 
				
			||||||
  styles:styles$|async,
 | 
					  styles:styles$|async,
 | 
				
			||||||
  selectedFeature:selectedFeature$|async,
 | 
					  selectedFeature:selectedFeature$|async,
 | 
				
			||||||
  fullscreen:fullscreen$|async
 | 
					  fullscreen:fullscreen$|async,
 | 
				
			||||||
 | 
					  showDataLayerSlide:showDataLayerSlide$|async
 | 
				
			||||||
} as state">
 | 
					} as state">
 | 
				
			||||||
  <aol-map #map (moveEnd)="handleOnMoveEnd($event)" (click)="handleOnMouseDown($event)" (dblClick)="handleShowLayerValues($event)" [ngClass]="{'panel-visible':state.panelVisible,'fullscreen':state.fullscreen}" class="map">
 | 
					  <aol-map #map (moveEnd)="handleOnMoveEnd($event)" (click)="handleOnMouseDown($event)" (dblClick)="handleShowLayerValues($event)" [ngClass]="{'panel-visible':state.panelVisible,'fullscreen':state.fullscreen }" class="map">
 | 
				
			||||||
    <div>
 | 
					    <div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    <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-view [zoom]="state.mapState.zoom" [rotation]="state.mapState.rotation">
 | 
				
			||||||
       <fm-map-zoom-to-extent [extent]="state.extent" [animate]="true"></fm-map-zoom-to-extent>
 | 
					        <aol-coordinate [x]="state.mapState.xCenter" [y]="state.mapState.yCenter" [srid]="'EPSG:4326'"></aol-coordinate>
 | 
				
			||||||
    </aol-view>
 | 
					        <fm-map-zoom-to-extent [extent]="state.extent" [animate]="true"></fm-map-zoom-to-extent>
 | 
				
			||||||
 | 
					     </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>
 | 
				
			||||||
    <fm-map-item-layers *ngIf="!overrideOverlayLayers" [itemLayers]="state.overlayLayers"></fm-map-item-layers>
 | 
					    <fm-map-item-layers *ngIf="!overrideOverlayLayers" [itemLayers]="state.overlayLayers"></fm-map-item-layers>
 | 
				
			||||||
    <fm-map-item-layers *ngIf="!overrideSelectedItemLayer" [itemLayer]="state.selectedItemLayer"></fm-map-item-layers>
 | 
					    <fm-map-item-layers *ngIf="!overrideSelectedItemLayer" [itemLayer]="state.selectedItemLayer" (onPrerender)="handlePrerender($event)"></fm-map-item-layers>
 | 
				
			||||||
    <aol-layer-vector>
 | 
					    <aol-layer-vector>
 | 
				
			||||||
      <fm-map-item-source-vector [styles]="state.styles" [features]="state.features" (onFeatureSelected)="handleFeatureClick($event)" (onFeatureHover)="handleFeatureHover($event)" [selectedFeature]="state.selectedFeature" [selectedItem]="state.selectedItem"></fm-map-item-source-vector>
 | 
					      <fm-map-item-source-vector [styles]="state.styles" [features]="state.features" (onFeatureSelected)="handleFeatureClick($event)" (onFeatureHover)="handleFeatureHover($event)" [selectedFeature]="state.selectedFeature" [selectedItem]="state.selectedItem"></fm-map-item-source-vector>
 | 
				
			||||||
    </aol-layer-vector>
 | 
					    </aol-layer-vector>
 | 
				
			||||||
    <router-outlet name="map-layers"></router-outlet>
 | 
					    <router-outlet name="map-layers"></router-outlet>
 | 
				
			||||||
    <fm-map-gps-location [position]="state.position" [headingTolerance]="20" [showHeading]="devicesService.IsMobile()" [showTolerance]="devicesService.IsMobile()" [heading]="state.compassHeading"></fm-map-gps-location>
 | 
					    <fm-map-gps-location [position]="state.position" [headingTolerance]="20" [showHeading]="devicesService.IsMobile()" [showTolerance]="devicesService.IsMobile()" [heading]="state.compassHeading"></fm-map-gps-location>
 | 
				
			||||||
    <fm-map-layer-values></fm-map-layer-values>
 | 
					    <fm-map-layer-values></fm-map-layer-values>
 | 
				
			||||||
    <div class="control-container" >
 | 
					    <div class="viewport-container" [ngStyle]="{'bottom': bottom(state.panelVisible)}">
 | 
				
			||||||
      <router-outlet name="map-controls"></router-outlet>
 | 
					      <div class="control-container">
 | 
				
			||||||
      <fm-map-layer-switcher></fm-map-layer-switcher>
 | 
					        <router-outlet name="map-controls"></router-outlet>
 | 
				
			||||||
      <fm-map-pan-to-location [position]="state.position" [mapState]="state.mapState" [animate]="true"></fm-map-pan-to-location>
 | 
					        <fm-map-layer-switcher></fm-map-layer-switcher>
 | 
				
			||||||
      <fm-map-rotation-reset></fm-map-rotation-reset>
 | 
					        <fm-map-pan-to-location [position]="state.position" [mapState]="state.mapState" [animate]="true"></fm-map-pan-to-location>
 | 
				
			||||||
 | 
					        <fm-map-rotation-reset></fm-map-rotation-reset>
 | 
				
			||||||
 | 
					      </div>  
 | 
				
			||||||
 | 
					      <div class="slide-container"  [ngClass]="{'showDataLayerSlide':state.showDataLayerSlide}">
 | 
				
			||||||
 | 
					        <form>
 | 
				
			||||||
 | 
					          <input class="dataLayerSlide" (input)="handleSlideChange($event)" type="range" style="width: 100%" value="{{dataLayerSlideValue}}"/>
 | 
				
			||||||
 | 
					        </form>
 | 
				
			||||||
 | 
					      </div>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    <fm-map-file-drop-target [parentCode]="state.parentCode" (onFileDropped)="handleFileDropped($event)"></fm-map-file-drop-target>
 | 
					    <fm-map-file-drop-target [parentCode]="state.parentCode" (onFileDropped)="handleFileDropped($event)"></fm-map-file-drop-target>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -53,7 +63,8 @@
 | 
				
			|||||||
      <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($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>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    <div class="side-panel-container">
 | 
					    <div class="side-panel-container">
 | 
				
			||||||
      <fm-side-panel [resizeable]="true" [visible]="state.panelVisible && noContent" [collapsed]="state.panelCollapsed" [collapsable]="false">
 | 
					      
 | 
				
			||||||
 | 
					      <fm-side-panel [resizeable]="true" (onResize)="handlePanelResize($event)" [visible]="state.panelVisible && noContent" [collapsed]="state.panelCollapsed" [collapsable]="false">
 | 
				
			||||||
        <div class="panel-wrapper" *ngIf="noContent">
 | 
					        <div class="panel-wrapper" *ngIf="noContent">
 | 
				
			||||||
          <div class="panel-top bg-secondary" *ngIf="!(state.searchMinified)">
 | 
					          <div class="panel-top bg-secondary" *ngIf="!(state.searchMinified)">
 | 
				
			||||||
          </div>
 | 
					          </div>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,6 @@
 | 
				
			|||||||
@import "~bootstrap/scss/bootstrap.scss";
 | 
					@import "~bootstrap/scss/bootstrap.scss";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
aol-map { position:absolute;width:100%;height:calc(100vh + 4rem);}
 | 
					aol-map { position:absolute;width:100%;height:calc( 100vh );}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.arrow {
 | 
					.arrow {
 | 
				
			||||||
  top: 3rem;
 | 
					  top: 3rem;
 | 
				
			||||||
@@ -45,29 +45,39 @@ aol-map { position:absolute;width:100%;height:calc(100vh + 4rem);}
 | 
				
			|||||||
  text-overflow:ellipsis;
 | 
					  text-overflow:ellipsis;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.viewport-container {
 | 
				
			||||||
.control-container {
 | 
					 | 
				
			||||||
  position: absolute;
 | 
					  position: absolute;
 | 
				
			||||||
  right: 1em;
 | 
					  left:0;
 | 
				
			||||||
  bottom: 8.1em;
 | 
					  right:0;
 | 
				
			||||||
 | 
					  bottom:0;
 | 
				
			||||||
 | 
					  margin-bottom:4em;
 | 
				
			||||||
 | 
					  pointer-events: none;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.fullscreen .control-container {
 | 
					
 | 
				
			||||||
  bottom: 5em;
 | 
					.control-container {
 | 
				
			||||||
 | 
					  float:right;
 | 
				
			||||||
 | 
					  margin-right: 1em;
 | 
				
			||||||
 | 
					  pointer-events: all;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.fullscreen .viewport-container {
 | 
				
			||||||
 | 
					  margin-bottom: 1em;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.side-panel-container {
 | 
					.side-panel-container {
 | 
				
			||||||
  position: absolute;
 | 
					  position: absolute;
 | 
				
			||||||
  top:0em;
 | 
					  top:0em;
 | 
				
			||||||
  bottom: 7.1em;
 | 
					  bottom: 3em;
 | 
				
			||||||
  width: 100%;
 | 
					  width: 100%;
 | 
				
			||||||
  pointer-events: none;
 | 
					  pointer-events: none;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.fullscreen .side-panel-container {
 | 
					.fullscreen .side-panel-container {
 | 
				
			||||||
  bottom: 4em;
 | 
					  bottom:0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
switch2d3d {
 | 
					switch2d3d {
 | 
				
			||||||
  position: absolute;
 | 
					  position: absolute;
 | 
				
			||||||
  right: 1em;
 | 
					  right: 1em;
 | 
				
			||||||
@@ -115,6 +125,21 @@ div.header button {
 | 
				
			|||||||
  max-height: 2.5em;
 | 
					  max-height: 2.5em;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.slide-container {
 | 
				
			||||||
 | 
					  display: none;
 | 
				
			||||||
 | 
					  pointer-events: all;
 | 
				
			||||||
 | 
					  width: 100%;
 | 
				
			||||||
 | 
					  overflow: hidden;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.dataLayerSlide {
 | 
				
			||||||
 | 
					  width:100%
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.slide-container.showDataLayerSlide {
 | 
				
			||||||
 | 
					  display: block;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
timespan {
 | 
					timespan {
 | 
				
			||||||
  position: absolute;
 | 
					  position: absolute;
 | 
				
			||||||
  transition: left 0.5s;
 | 
					  transition: left 0.5s;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,7 +5,7 @@ import { withLatestFrom, switchMap,skip  } from 'rxjs/operators';
 | 
				
			|||||||
import { Router, ActivatedRoute, ParamMap } from '@angular/router';
 | 
					import { Router, ActivatedRoute, ParamMap } from '@angular/router';
 | 
				
			||||||
import { Store } from '@ngrx/store';
 | 
					import { Store } from '@ngrx/store';
 | 
				
			||||||
import { DeviceService } from '@farmmaps/common';
 | 
					import { DeviceService } from '@farmmaps/common';
 | 
				
			||||||
//import { proj,Map } from 'openlayers';
 | 
					import {getRenderPixel} from 'ol/render';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Map
 | 
					// Map
 | 
				
			||||||
import * as mapReducers from '../../reducers/map.reducer';
 | 
					import * as mapReducers from '../../reducers/map.reducer';
 | 
				
			||||||
@@ -76,6 +76,7 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
 | 
				
			|||||||
  public clearEnabled$: Observable<boolean> = this.store.select(mapReducers.selectGetClearEnabled);
 | 
					  public clearEnabled$: Observable<boolean> = this.store.select(mapReducers.selectGetClearEnabled);
 | 
				
			||||||
  public searchCollapsed$: Observable<boolean> = this.store.select(mapReducers.selectGetSearchCollapsed);
 | 
					  public searchCollapsed$: Observable<boolean> = this.store.select(mapReducers.selectGetSearchCollapsed);
 | 
				
			||||||
  public searchMinified$: Observable<boolean> = this.store.select(mapReducers.selectGetSearchMinified);
 | 
					  public searchMinified$: Observable<boolean> = this.store.select(mapReducers.selectGetSearchMinified);
 | 
				
			||||||
 | 
					  public showDataLayerSlide$: Observable<boolean> = this.store.select(mapReducers.selectGetShowdataLayerSlide);
 | 
				
			||||||
  public menuVisible$: Observable<boolean>;
 | 
					  public menuVisible$: Observable<boolean>;
 | 
				
			||||||
  public query$: Observable<IQuery> =  this.store.select(mapReducers.selectGetQuery);
 | 
					  public query$: Observable<IQuery> =  this.store.select(mapReducers.selectGetQuery);
 | 
				
			||||||
  public position$: Observable<GeolocationPosition> = this.geolocationService.getCurrentPosition();
 | 
					  public position$: Observable<GeolocationPosition> = this.geolocationService.getCurrentPosition();
 | 
				
			||||||
@@ -90,6 +91,10 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
 | 
				
			|||||||
  public noContent: boolean = false;
 | 
					  public noContent: boolean = false;
 | 
				
			||||||
  public overrideSelectedItemLayer: boolean = false;
 | 
					  public overrideSelectedItemLayer: boolean = false;
 | 
				
			||||||
  public overrideOverlayLayers: boolean = false;
 | 
					  public overrideOverlayLayers: boolean = false;
 | 
				
			||||||
 | 
					  public dataLayerSlideValue:number = 50;
 | 
				
			||||||
 | 
					  public dataLayerSlideEnabled = false;
 | 
				
			||||||
 | 
					  private visibleAreaBottom = 0;
 | 
				
			||||||
 | 
					  private viewEnabled: boolean = true;
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  @ViewChild('map') map;
 | 
					  @ViewChild('map') map;
 | 
				
			||||||
  @ViewChild('contentDiv') contentDiv: ElementRef;
 | 
					  @ViewChild('contentDiv') contentDiv: ElementRef;
 | 
				
			||||||
@@ -155,6 +160,25 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  handlePanelResize(resizeTop:number) {
 | 
				
			||||||
 | 
					    if(resizeTop==100 || !this.devicesService.IsMobile() ) {
 | 
				
			||||||
 | 
					      this.visibleAreaBottom=0;
 | 
				
			||||||
 | 
					    } else {
 | 
				
			||||||
 | 
					      this.visibleAreaBottom=100-resizeTop;
 | 
				
			||||||
 | 
					      if(this.visibleAreaBottom>60) {
 | 
				
			||||||
 | 
					        this.visibleAreaBottom=60;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    }      
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  bottom(panelVisible:boolean) {
 | 
				
			||||||
 | 
					    if(panelVisible) {
 | 
				
			||||||
 | 
					      return this.visibleAreaBottom + '%';     
 | 
				
			||||||
 | 
					    } else {
 | 
				
			||||||
 | 
					      return "0%";
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  handleOpenModal(modalName: string) {
 | 
					  handleOpenModal(modalName: string) {
 | 
				
			||||||
    this.store.dispatch(new  commonActions.OpenModal(modalName));
 | 
					    this.store.dispatch(new  commonActions.OpenModal(modalName));
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
@@ -191,6 +215,31 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  handlePrerender(event:any) {
 | 
				
			||||||
 | 
					    if(!this.dataLayerSlideEnabled) return;
 | 
				
			||||||
 | 
					    const ctx = event.context;
 | 
				
			||||||
 | 
					    const mapSize = this.map.instance.getSize();
 | 
				
			||||||
 | 
					    const width = mapSize[0] * (this.dataLayerSlideValue / 100);
 | 
				
			||||||
 | 
					    const tl = getRenderPixel(event, [width, 0]);
 | 
				
			||||||
 | 
					    const tr = getRenderPixel(event, [mapSize[0], 0]);
 | 
				
			||||||
 | 
					    const bl = getRenderPixel(event, [width, mapSize[1]]);
 | 
				
			||||||
 | 
					    const br = getRenderPixel(event, mapSize);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ctx.save();
 | 
				
			||||||
 | 
					    ctx.beginPath();
 | 
				
			||||||
 | 
					    ctx.moveTo(tl[0], tl[1]);
 | 
				
			||||||
 | 
					    ctx.lineTo(bl[0], bl[1]);
 | 
				
			||||||
 | 
					    ctx.lineTo(br[0], br[1]);
 | 
				
			||||||
 | 
					    ctx.lineTo(tr[0], tr[1]);
 | 
				
			||||||
 | 
					    ctx.closePath();
 | 
				
			||||||
 | 
					    ctx.clip();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  handleSlideChange(event:any) {
 | 
				
			||||||
 | 
					     this.dataLayerSlideValue = event.target.value;
 | 
				
			||||||
 | 
					     this.map.instance.render();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ngOnInit() {    
 | 
					  ngOnInit() {    
 | 
				
			||||||
    this.initialized = false;
 | 
					    this.initialized = false;
 | 
				
			||||||
    console.debug("Init");
 | 
					    console.debug("Init");
 | 
				
			||||||
@@ -323,6 +372,13 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
      });
 | 
					      });
 | 
				
			||||||
    this.initialized = true;   
 | 
					    this.initialized = true;   
 | 
				
			||||||
 | 
					    this.showDataLayerSlide$.subscribe((v) => {
 | 
				
			||||||
 | 
					      this.dataLayerSlideEnabled=v;
 | 
				
			||||||
 | 
					      this.map.instance.render();
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					    this.store.select(mapReducers.selectGetViewEnabled).subscribe((v) => {
 | 
				
			||||||
 | 
					      this.viewEnabled = v;
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  handleSearchCollapse(event) {
 | 
					  handleSearchCollapse(event) {
 | 
				
			||||||
@@ -376,7 +432,7 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  handleOnMoveEnd(event) {    
 | 
					  handleOnMoveEnd(event) {    
 | 
				
			||||||
    if(this.initialized) {
 | 
					    if(this.initialized && this.viewEnabled) {
 | 
				
			||||||
      this.zone.run(() =>{
 | 
					      this.zone.run(() =>{
 | 
				
			||||||
        console.debug("Move end");
 | 
					        console.debug("Move end");
 | 
				
			||||||
        var map = event.map;
 | 
					        var map = event.map;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
import { Component, Output, ViewChild, EventEmitter, Input, ElementRef, HostListener } from '@angular/core';
 | 
					import { Component, Output, ViewChild, EventEmitter, Input, ElementRef, HostListener } from '@angular/core';
 | 
				
			||||||
import { FormGroup,FormBuilder, Validators } from '@angular/forms';
 | 
					import { UntypedFormGroup,UntypedFormBuilder, Validators } from '@angular/forms';
 | 
				
			||||||
import { IListItem } from '@farmmaps/common';
 | 
					import { IListItem } from '@farmmaps/common';
 | 
				
			||||||
import { IDroppedFile } from '../aol/file-drop-target/file-drop-target.component';
 | 
					import { IDroppedFile } from '../aol/file-drop-target/file-drop-target.component';
 | 
				
			||||||
import {NgbModal, NgbModalRef} from "@ng-bootstrap/ng-bootstrap";
 | 
					import {NgbModal, NgbModalRef} from "@ng-bootstrap/ng-bootstrap";
 | 
				
			||||||
@@ -33,9 +33,9 @@ export class MetaDataModalComponent {
 | 
				
			|||||||
  @Output() onCloseModal = new EventEmitter<any>();
 | 
					  @Output() onCloseModal = new EventEmitter<any>();
 | 
				
			||||||
  @Output() onAddFilesWithMetaData = new EventEmitter<IMetaData>();
 | 
					  @Output() onAddFilesWithMetaData = new EventEmitter<IMetaData>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  constructor(private modalService: NgbModal, public fb: FormBuilder) { }
 | 
					  constructor(private modalService: NgbModal, public fb: UntypedFormBuilder) { }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  public metaDataForm: FormGroup;
 | 
					  public metaDataForm: UntypedFormGroup;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  handleMetaDataEntered(event) {
 | 
					  handleMetaDataEntered(event) {
 | 
				
			||||||
    if (this.metaDataForm.valid) {
 | 
					    if (this.metaDataForm.valid) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -126,7 +126,7 @@ export class MapEffects {
 | 
				
			|||||||
      var endDate = a.queryState.endDate;
 | 
					      var endDate = a.queryState.endDate;
 | 
				
			||||||
      var newAction:Observable<Action>;
 | 
					      var newAction:Observable<Action>;
 | 
				
			||||||
      if (a.queryState.itemCode || a.queryState.parentCode || a.queryState.itemType || a.queryState.query || a.queryState.tags) {
 | 
					      if (a.queryState.itemCode || a.queryState.parentCode || a.queryState.itemType || a.queryState.query || a.queryState.tags) {
 | 
				
			||||||
        newAction= this.itemService$.getFeatures(a.queryState.bbox, "EPSG:3857", a.queryState.query, a.queryState.tags, startDate, endDate, a.queryState.itemType, a.queryState.parentCode, null, a.queryState.level).pipe(
 | 
					        newAction= this.itemService$.getFeatures(a.queryState.bbox, "EPSG:3857", a.queryState.query, a.queryState.tags, startDate, endDate, a.queryState.itemType, a.queryState.parentCode, a.queryState.dataFilter, a.queryState.level).pipe(
 | 
				
			||||||
          switchMap((features: any) => {
 | 
					          switchMap((features: any) => {
 | 
				
			||||||
            for (let f of features.features) {
 | 
					            for (let f of features.features) {
 | 
				
			||||||
              if (f.properties && f.properties["code"]) {
 | 
					              if (f.properties && f.properties["code"]) {
 | 
				
			||||||
@@ -157,7 +157,7 @@ export class MapEffects {
 | 
				
			|||||||
          }
 | 
					          }
 | 
				
			||||||
          if(action.features && action.features.length >0) {
 | 
					          if(action.features && action.features.length >0) {
 | 
				
			||||||
            actions.push(new mapActions.SetExtent(extent));
 | 
					            actions.push(new mapActions.SetExtent(extent));
 | 
				
			||||||
          }  
 | 
					          }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      return actions;
 | 
					      return actions;
 | 
				
			||||||
@@ -172,7 +172,7 @@ export class MapEffects {
 | 
				
			|||||||
            extend(extent, (f as Feature<Geometry>).getGeometry().getExtent());
 | 
					            extend(extent, (f as Feature<Geometry>).getGeometry().getExtent());
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
          if(action.features.length>0) return of(new mapActions.SetExtent(extent));
 | 
					          if(action.features.length>0) return of(new mapActions.SetExtent(extent));
 | 
				
			||||||
        }        
 | 
					        }
 | 
				
			||||||
        return EMPTY;
 | 
					        return EMPTY;
 | 
				
			||||||
      })));
 | 
					      })));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -207,14 +207,14 @@ export class MapEffects {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    selectItemSuccessSetLayer$ =  createEffect(() => this.actions$.pipe(
 | 
					    selectItemSuccessSetLayer$ =  createEffect(() => this.actions$.pipe(
 | 
				
			||||||
      ofType(mapActions.SELECTITEMSUCCESS),
 | 
					      ofType(mapActions.SELECTITEMSUCCESS),
 | 
				
			||||||
      map((action:mapActions.SelectItemSuccess) => 
 | 
					      map((action:mapActions.SelectItemSuccess) =>
 | 
				
			||||||
         new mapActions.SetSelectedItemLayer(action.item)
 | 
					         new mapActions.SetSelectedItemLayer(action.item)
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
      ));
 | 
					      ));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  selectItemSuccess$ =  createEffect(() => this.actions$.pipe(
 | 
					  selectItemSuccess$ =  createEffect(() => this.actions$.pipe(
 | 
				
			||||||
    ofType(mapActions.SELECTITEMSUCCESS),
 | 
					    ofType(mapActions.SELECTITEMSUCCESS),
 | 
				
			||||||
    switchMap((action:mapActions.SelectItemSuccess) => {  
 | 
					    switchMap((action:mapActions.SelectItemSuccess) => {
 | 
				
			||||||
      if(!this.overrideSelectedItemLayer) {
 | 
					      if(!this.overrideSelectedItemLayer) {
 | 
				
			||||||
        return this.itemService$.getFeature(action.item.code, "EPSG:3857").pipe(
 | 
					        return this.itemService$.getFeature(action.item.code, "EPSG:3857").pipe(
 | 
				
			||||||
          map((feature: any) => {
 | 
					          map((feature: any) => {
 | 
				
			||||||
@@ -222,7 +222,7 @@ export class MapEffects {
 | 
				
			|||||||
            f.setId(action.item.code);
 | 
					            f.setId(action.item.code);
 | 
				
			||||||
            return new mapActions.AddFeatureSuccess(f );
 | 
					            return new mapActions.AddFeatureSuccess(f );
 | 
				
			||||||
          }),
 | 
					          }),
 | 
				
			||||||
          catchError(error => of(new commonActions.Fail(error))));  
 | 
					          catchError(error => of(new commonActions.Fail(error))));
 | 
				
			||||||
      } else {
 | 
					      } else {
 | 
				
			||||||
        return EMPTY;
 | 
					        return EMPTY;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
@@ -299,7 +299,7 @@ export class MapEffects {
 | 
				
			|||||||
      } else {
 | 
					      } else {
 | 
				
			||||||
        newAction= new mapActions.StartSearch(queryState);
 | 
					        newAction= new mapActions.StartSearch(queryState);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      
 | 
					
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
      newAction = new mapActions.Clear();
 | 
					      newAction = new mapActions.Clear();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -322,9 +322,9 @@ export class MapEffects {
 | 
				
			|||||||
                    return;
 | 
					                    return;
 | 
				
			||||||
                  }
 | 
					                  }
 | 
				
			||||||
              });
 | 
					              });
 | 
				
			||||||
              a.push(new mapActions.GetLayerValueSuccess({date:action.itemLayer.item.dataDate,value:v,layerName:l.name,quantity:"",unit:l.unit}));        
 | 
					              a.push(new mapActions.GetLayerValueSuccess({date:action.itemLayer.item.dataDate,value:v,layerName:l.name,quantity:"",unit:l.unit}));
 | 
				
			||||||
            } else {
 | 
					            } else {
 | 
				
			||||||
              a.push(new mapActions.GetLayerValueSuccess({date:action.itemLayer.item.dataDate,value:v*scale,layerName:l.name,quantity:l.quantity,unit:l.unit}));        
 | 
					              a.push(new mapActions.GetLayerValueSuccess({date:action.itemLayer.item.dataDate,value:v*scale,layerName:l.name,quantity:l.quantity,unit:l.unit}));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
          return a;
 | 
					          return a;
 | 
				
			||||||
@@ -346,7 +346,7 @@ export class MapEffects {
 | 
				
			|||||||
    withLatestFrom(this.store$.select(mapReducers.selectGetLayerValuesEnabled)),
 | 
					    withLatestFrom(this.store$.select(mapReducers.selectGetLayerValuesEnabled)),
 | 
				
			||||||
    withLatestFrom(this.store$.select(mapReducers.selectGetOverlayLayers)),
 | 
					    withLatestFrom(this.store$.select(mapReducers.selectGetOverlayLayers)),
 | 
				
			||||||
    mergeMap(([[[action, selected], enabled],overlayLayers]) => {
 | 
					    mergeMap(([[[action, selected], enabled],overlayLayers]) => {
 | 
				
			||||||
      let layers = [];      
 | 
					      let layers = [];
 | 
				
			||||||
      if(selected) {
 | 
					      if(selected) {
 | 
				
			||||||
        if(selected && (selected as TemporalItemLayer).selectedItemLayer ) {
 | 
					        if(selected && (selected as TemporalItemLayer).selectedItemLayer ) {
 | 
				
			||||||
           selected=(selected as TemporalItemLayer).selectedItemLayer;
 | 
					           selected=(selected as TemporalItemLayer).selectedItemLayer;
 | 
				
			||||||
@@ -358,16 +358,16 @@ export class MapEffects {
 | 
				
			|||||||
      });
 | 
					      });
 | 
				
			||||||
      let a = action as mapActions.SetLayerValuesLocation;
 | 
					      let a = action as mapActions.SetLayerValuesLocation;
 | 
				
			||||||
      let actions = [];
 | 
					      let actions = [];
 | 
				
			||||||
      if(enabled) {      
 | 
					      if(enabled) {
 | 
				
			||||||
        layers.forEach((ol) => {
 | 
					        layers.forEach((ol) => {
 | 
				
			||||||
           if("vnd.farmmaps.itemtype.shape.processed,vnd.farmmaps.itemtype.geotiff.processed".indexOf(ol.item.itemType)>=0) {
 | 
					           if("vnd.farmmaps.itemtype.shape.processed,vnd.farmmaps.itemtype.geotiff.processed".indexOf(ol.item.itemType)>=0) {
 | 
				
			||||||
             actions.push(new mapActions.GetLayerValue(ol,a.x,a.y));
 | 
					             actions.push(new mapActions.GetLayerValue(ol,a.x,a.y));
 | 
				
			||||||
           }
 | 
					           }
 | 
				
			||||||
         });
 | 
					         });
 | 
				
			||||||
      } 
 | 
					      }
 | 
				
			||||||
      return actions;
 | 
					      return actions;
 | 
				
			||||||
    })));
 | 
					    })));
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   setState$ =  createEffect(() => this.actions$.pipe(
 | 
					   setState$ =  createEffect(() => this.actions$.pipe(
 | 
				
			||||||
    ofType(mapActions.SETSTATE),
 | 
					    ofType(mapActions.SETSTATE),
 | 
				
			||||||
@@ -385,7 +385,7 @@ export class MapEffects {
 | 
				
			|||||||
          return of(new mapActions.Clear());
 | 
					          return of(new mapActions.Clear());
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
          return EMPTY;
 | 
					          return EMPTY;
 | 
				
			||||||
        }       
 | 
					        }
 | 
				
			||||||
      })));
 | 
					      })));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      setOverride$ = createEffect(() => this.actions$.pipe(
 | 
					      setOverride$ = createEffect(() => this.actions$.pipe(
 | 
				
			||||||
@@ -404,6 +404,6 @@ export class MapEffects {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  constructor(private actions$: Actions, private store$: Store<mapReducers.State>, private folderService$: FolderService, private itemService$: ItemService,private featureIconService$:FeatureIconService,private itemTypeService$:ItemTypeService) {
 | 
					  constructor(private actions$: Actions, private store$: Store<mapReducers.State>, private folderService$: FolderService, private itemService$: ItemService,private featureIconService$:FeatureIconService,private itemTypeService$:ItemTypeService) {
 | 
				
			||||||
    this._geojsonFormat = new GeoJSON();
 | 
					    this._geojsonFormat = new GeoJSON();
 | 
				
			||||||
    this._wktFormat = new WKT();  
 | 
					    this._wktFormat = new WKT();
 | 
				
			||||||
   }  
 | 
					   }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -69,8 +69,10 @@ export interface State {
 | 
				
			|||||||
  replaceUrl:boolean,
 | 
					  replaceUrl:boolean,
 | 
				
			||||||
  layerValuesX:number,
 | 
					  layerValuesX:number,
 | 
				
			||||||
  layerValuesY:number,
 | 
					  layerValuesY:number,
 | 
				
			||||||
  layerValuesEnabled:boolean;
 | 
					  layerValuesEnabled:boolean,
 | 
				
			||||||
  layerValues: Array<ILayervalue>;
 | 
					  layerValues: Array<ILayervalue>
 | 
				
			||||||
 | 
					  showDataLayerSlide:boolean,
 | 
				
			||||||
 | 
					  viewEnabled:boolean
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const initialState: State = {
 | 
					export const initialState: State = {
 | 
				
			||||||
@@ -113,7 +115,9 @@ export const initialState: State = {
 | 
				
			|||||||
  layerValuesX:0,
 | 
					  layerValuesX:0,
 | 
				
			||||||
  layerValuesY:0,
 | 
					  layerValuesY:0,
 | 
				
			||||||
  layerValuesEnabled:false,
 | 
					  layerValuesEnabled:false,
 | 
				
			||||||
  layerValues:[]
 | 
					  layerValues:[],
 | 
				
			||||||
 | 
					  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 {
 | 
				
			||||||
@@ -172,6 +176,7 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
 | 
				
			|||||||
      return tassign(state, {
 | 
					      return tassign(state, {
 | 
				
			||||||
        selectedItem: null,
 | 
					        selectedItem: null,
 | 
				
			||||||
        selectedItemLayer: null,
 | 
					        selectedItemLayer: null,
 | 
				
			||||||
 | 
					        showDataLayerSlide: false,
 | 
				
			||||||
        features:[],
 | 
					        features:[],
 | 
				
			||||||
        inSearch:inSearch
 | 
					        inSearch:inSearch
 | 
				
			||||||
      });
 | 
					      });
 | 
				
			||||||
@@ -501,7 +506,8 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
 | 
				
			|||||||
        features: [],
 | 
					        features: [],
 | 
				
			||||||
        query:initialState.query,
 | 
					        query:initialState.query,
 | 
				
			||||||
        showLayerSwitcher: false,
 | 
					        showLayerSwitcher: false,
 | 
				
			||||||
        extent: null
 | 
					        extent: null,
 | 
				
			||||||
 | 
					        showDataLayerSlide: false
 | 
				
			||||||
      });
 | 
					      });
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    case mapActions.SETSTYLE:{
 | 
					    case mapActions.SETSTYLE:{
 | 
				
			||||||
@@ -514,6 +520,9 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
 | 
				
			|||||||
      let a = action as mapActions.ShowLayerSwitcher;
 | 
					      let a = action as mapActions.ShowLayerSwitcher;
 | 
				
			||||||
      return tassign(state,{showLayerSwitcher:a.show});
 | 
					      return tassign(state,{showLayerSwitcher:a.show});
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    case mapActions.TOGGLESHOWDATALAYERSLIDE:{
 | 
				
			||||||
 | 
					      return tassign(state,{showDataLayerSlide:!state.showDataLayerSlide});
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    case mapActions.SETREPLACEURL: {
 | 
					    case mapActions.SETREPLACEURL: {
 | 
				
			||||||
      let a= action as mapActions.SetReplaceUrl;
 | 
					      let a= action as mapActions.SetReplaceUrl;
 | 
				
			||||||
      return tassign(state,{replaceUrl:a.replaceUrl});
 | 
					      return tassign(state,{replaceUrl:a.replaceUrl});
 | 
				
			||||||
@@ -531,12 +540,17 @@ 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) {
 | 
				
			||||||
         return tassign(state,{  
 | 
					         return tassign(state,{  
 | 
				
			||||||
          selectedItem: null,
 | 
					          selectedItem: null,
 | 
				
			||||||
          selectedItemLayer: null,
 | 
					          selectedItemLayer: null,
 | 
				
			||||||
 | 
					          showDataLayerSlide: false,
 | 
				
			||||||
          features:[]
 | 
					          features:[]
 | 
				
			||||||
         });
 | 
					         });
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
@@ -584,12 +598,14 @@ export const getSelectedItemLayer = (state: State) => state.selectedItemLayer;
 | 
				
			|||||||
export const getPeriod = (state:State) => state.period;
 | 
					export const getPeriod = (state:State) => state.period;
 | 
				
			||||||
export const getStyles = (state:State) => state.styles;
 | 
					export const getStyles = (state:State) => state.styles;
 | 
				
			||||||
export const getShowLayerSwitcher = (state:State) => state.showLayerSwitcher;
 | 
					export const getShowLayerSwitcher = (state:State) => state.showLayerSwitcher;
 | 
				
			||||||
 | 
					export const getShowDataLayerSlide = (state:State) => state.showDataLayerSlide;
 | 
				
			||||||
export const getInSearch = (state:State) => state.inSearch;
 | 
					export const getInSearch = (state:State) => state.inSearch;
 | 
				
			||||||
export const getState = (state:State) => {return {mapState:state.mapState,queryState:state.queryState,replaceUrl:state.replaceUrl};}
 | 
					export const getState = (state:State) => {return {mapState:state.mapState,queryState:state.queryState,replaceUrl:state.replaceUrl};}
 | 
				
			||||||
export const getLayerValuesEnabled = (state:State) => state.layerValuesEnabled;
 | 
					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);
 | 
				
			||||||
@@ -616,11 +632,13 @@ export const selectGetSelectedItemLayer = createSelector(selectMapState, getSele
 | 
				
			|||||||
export const selectGetPeriod = createSelector(selectMapState, getPeriod);
 | 
					export const selectGetPeriod = createSelector(selectMapState, getPeriod);
 | 
				
			||||||
export const selectGetStyles = createSelector(selectMapState, getStyles);
 | 
					export const selectGetStyles = createSelector(selectMapState, getStyles);
 | 
				
			||||||
export const selectGetShowLayerSwitcher = createSelector(selectMapState,getShowLayerSwitcher);
 | 
					export const selectGetShowLayerSwitcher = createSelector(selectMapState,getShowLayerSwitcher);
 | 
				
			||||||
 | 
					export const selectGetShowdataLayerSlide = createSelector(selectMapState,getShowDataLayerSlide);
 | 
				
			||||||
export const selectGetInSearch = createSelector(selectMapState,getInSearch);
 | 
					export const selectGetInSearch = createSelector(selectMapState,getInSearch);
 | 
				
			||||||
export const selectGetState = createSelector(selectMapState,getState);
 | 
					export const selectGetState = createSelector(selectMapState,getState);
 | 
				
			||||||
export const selectGetLayerValuesEnabled = createSelector(selectMapState,getLayerValuesEnabled);
 | 
					export const selectGetLayerValuesEnabled = createSelector(selectMapState,getLayerValuesEnabled);
 | 
				
			||||||
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);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -14,7 +14,9 @@ declare const require: any;
 | 
				
			|||||||
// First, initialize the Angular testing environment.
 | 
					// First, initialize the Angular testing environment.
 | 
				
			||||||
getTestBed().initTestEnvironment(
 | 
					getTestBed().initTestEnvironment(
 | 
				
			||||||
  BrowserDynamicTestingModule,
 | 
					  BrowserDynamicTestingModule,
 | 
				
			||||||
  platformBrowserDynamicTesting()
 | 
					  platformBrowserDynamicTesting(), {
 | 
				
			||||||
 | 
					    teardown: { destroyAfterEach: false }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
);
 | 
					);
 | 
				
			||||||
// Then we find all the tests.
 | 
					// Then we find all the tests.
 | 
				
			||||||
const context = require.context('./', true, /\.spec\.ts$/);
 | 
					const context = require.context('./', true, /\.spec\.ts$/);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,7 +2,7 @@
 | 
				
			|||||||
  "extends": "../../tsconfig.json",
 | 
					  "extends": "../../tsconfig.json",
 | 
				
			||||||
  "compilerOptions": {
 | 
					  "compilerOptions": {
 | 
				
			||||||
    "outDir": "../../out-tsc/lib",
 | 
					    "outDir": "../../out-tsc/lib",
 | 
				
			||||||
    "target": "es2015",
 | 
					    "target": "es2020",
 | 
				
			||||||
    "module": "es2015",
 | 
					    "module": "es2015",
 | 
				
			||||||
    "moduleResolution": "node",
 | 
					    "moduleResolution": "node",
 | 
				
			||||||
    "declaration": true,
 | 
					    "declaration": true,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,7 +2,7 @@
 | 
				
			|||||||
  "extends": "../../tsconfig.json",
 | 
					  "extends": "../../tsconfig.json",
 | 
				
			||||||
  "compilerOptions": {
 | 
					  "compilerOptions": {
 | 
				
			||||||
    "outDir": "../../out-tsc/lib",
 | 
					    "outDir": "../../out-tsc/lib",
 | 
				
			||||||
    "target": "es2015",
 | 
					    "target": "es2020",
 | 
				
			||||||
    "module": "es2015",
 | 
					    "module": "es2015",
 | 
				
			||||||
    "moduleResolution": "node",
 | 
					    "moduleResolution": "node",
 | 
				
			||||||
    "declaration": true,
 | 
					    "declaration": true,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,11 +5,11 @@
 | 
				
			|||||||
    "registry": "https://repository.akkerweb.nl/repository/npm-hosted/"
 | 
					    "registry": "https://repository.akkerweb.nl/repository/npm-hosted/"
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "peerDependencies": {
 | 
					  "peerDependencies": {
 | 
				
			||||||
    "@angular/common":  "~12.2.8",
 | 
					    "@angular/common":  ">=14.0.0",
 | 
				
			||||||
    "@angular/core":  "~12.2.8",
 | 
					    "@angular/core":  ">=14.0.0",
 | 
				
			||||||
    "ngx-openlayers": "1.0.0-next.19",
 | 
					    "ngx-openlayers": "1.0.0-next.19",
 | 
				
			||||||
    "cesium": "^1.82.1",
 | 
					    "cesium": ">=1.82.1",
 | 
				
			||||||
    "ol-cesium": "^2.13.0"
 | 
					    "ol-cesium": ">=2.13.0"
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "dependencies": {
 | 
					  "dependencies": {
 | 
				
			||||||
    "tslib": "^2.0.0"
 | 
					    "tslib": "^2.0.0"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,12 +1,14 @@
 | 
				
			|||||||
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]
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,8 +1,11 @@
 | 
				
			|||||||
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 'ol-cesium';
 | 
					import OLCesium from 'olcs/OLCesium';
 | 
				
			||||||
 | 
					import RasterSynchronizer from 'olcs/RasterSynchronizer';
 | 
				
			||||||
declare var olcs: any;
 | 
					import VectorSynchronizer from 'olcs/VectorSynchronizer';
 | 
				
			||||||
 | 
					import { mapReducers,mapActions } from '@farmmaps/common-map';
 | 
				
			||||||
 | 
					import { Store } from '@ngrx/store';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@Component({
 | 
					@Component({
 | 
				
			||||||
  selector: 'fm-map3d-switch2d3d',
 | 
					  selector: 'fm-map3d-switch2d3d',
 | 
				
			||||||
@@ -16,9 +19,10 @@ 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) {
 | 
					  constructor(private map: MapComponent,private store: Store<mapReducers.State>) {
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -26,8 +30,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 olcs.RasterSynchronizer(map,scene),
 | 
					            new RasterSynchronizer(map,scene),
 | 
				
			||||||
            new olcs.VectorSynchronizer(map,scene)
 | 
					            new VectorSynchronizer(map,scene)
 | 
				
			||||||
        ];
 | 
					        ];
 | 
				
			||||||
        this.loading=false;
 | 
					        this.loading=false;
 | 
				
			||||||
        return this.synchronizers;
 | 
					        return this.synchronizers;
 | 
				
			||||||
@@ -41,12 +45,35 @@ 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.synchronize();
 | 
					      this.store.dispatch(new mapActions.SetViewState(false));
 | 
				
			||||||
 | 
					      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";    
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -18,7 +18,9 @@ declare const require: {
 | 
				
			|||||||
// First, initialize the Angular testing environment.
 | 
					// First, initialize the Angular testing environment.
 | 
				
			||||||
getTestBed().initTestEnvironment(
 | 
					getTestBed().initTestEnvironment(
 | 
				
			||||||
  BrowserDynamicTestingModule,
 | 
					  BrowserDynamicTestingModule,
 | 
				
			||||||
  platformBrowserDynamicTesting()
 | 
					  platformBrowserDynamicTesting(), {
 | 
				
			||||||
 | 
					    teardown: { destroyAfterEach: false }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
);
 | 
					);
 | 
				
			||||||
// Then we find all the tests.
 | 
					// Then we find all the tests.
 | 
				
			||||||
const context = require.context('./', true, /\.spec\.ts$/);
 | 
					const context = require.context('./', true, /\.spec\.ts$/);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,10 +2,7 @@
 | 
				
			|||||||
  "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
 | 
					  "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
 | 
				
			||||||
  "dest": "../../dist/common",
 | 
					  "dest": "../../dist/common",
 | 
				
			||||||
  "lib": {
 | 
					  "lib": {
 | 
				
			||||||
    "entryFile": "src/public-api.ts",
 | 
					    "entryFile": "src/public-api.ts"
 | 
				
			||||||
    "umdModuleIds": {
 | 
					 | 
				
			||||||
      "my-data": "my-data"
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "allowedNonPeerDependencies": [
 | 
					  "allowedNonPeerDependencies": [
 | 
				
			||||||
    "."
 | 
					    "."
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										43
									
								
								projects/common/package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										43
									
								
								projects/common/package-lock.json
									
									
									
										generated
									
									
									
								
							@@ -1,27 +1,30 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  "name": "@farmmaps/common",
 | 
					  "name": "@farmmaps/common",
 | 
				
			||||||
  "version": "0.0.1",
 | 
					  "version": "2.0.0",
 | 
				
			||||||
  "lockfileVersion": 1,
 | 
					  "lockfileVersion": 2,
 | 
				
			||||||
  "requires": true,
 | 
					  "requires": true,
 | 
				
			||||||
  "dependencies": {
 | 
					  "packages": {
 | 
				
			||||||
    "is-retina": {
 | 
					    "": {
 | 
				
			||||||
      "version": "1.0.3",
 | 
					      "name": "@farmmaps/common",
 | 
				
			||||||
      "resolved": "https://registry.npmjs.org/is-retina/-/is-retina-1.0.3.tgz",
 | 
					      "version": "2.0.0",
 | 
				
			||||||
      "integrity": "sha1-10AbKGvqKuN/Ykd1iN5QTQuGR+M="
 | 
					      "peerDependencies": {
 | 
				
			||||||
    },
 | 
					        "@angular/common": "^14.0.0",
 | 
				
			||||||
    "ngx-avatar": {
 | 
					        "@angular/core": "^14.0.0",
 | 
				
			||||||
      "version": "4.0.0",
 | 
					        "@angular/forms": "^14",
 | 
				
			||||||
      "resolved": "https://registry.npmjs.org/ngx-avatar/-/ngx-avatar-4.0.0.tgz",
 | 
					        "@microsoft/signalr": "^3.1.3",
 | 
				
			||||||
      "integrity": "sha512-Uk40UXl26RvDy1ori9NDsGFB+f84AaxMnsIwZA6JPJK0pLcbo3F4vZTmzLZeOusOw1Qtgk5IzF630jo06keXwQ==",
 | 
					        "@ng-bootstrap/ng-bootstrap": ">=10.0.0",
 | 
				
			||||||
      "requires": {
 | 
					        "@ngrx/effects": "^14.0.0",
 | 
				
			||||||
        "is-retina": "^1.0.3",
 | 
					        "@ngrx/router-store": "^14.0.0",
 | 
				
			||||||
        "ts-md5": "^1.2.4"
 | 
					        "@ngrx/store": "^14.0.0",
 | 
				
			||||||
 | 
					        "angular-oauth2-oidc": "^13",
 | 
				
			||||||
 | 
					        "bootstrap": "^4.4.1",
 | 
				
			||||||
 | 
					        "moment": "^2.27.0",
 | 
				
			||||||
 | 
					        "ngx-avatar": "^4.1.0",
 | 
				
			||||||
 | 
					        "ngx-clipboard": "^14.0.1",
 | 
				
			||||||
 | 
					        "ngx-image-cropper": "^3.3.5",
 | 
				
			||||||
 | 
					        "ngx-uploadx": "^5.2.0",
 | 
				
			||||||
 | 
					        "tassign": "^1.0.0"
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    "ts-md5": {
 | 
					 | 
				
			||||||
      "version": "1.2.7",
 | 
					 | 
				
			||||||
      "resolved": "https://registry.npmjs.org/ts-md5/-/ts-md5-1.2.7.tgz",
 | 
					 | 
				
			||||||
      "integrity": "sha512-emODogvKGWi1KO1l9c6YxLMBn6CEH3VrH5mVPIyOtxBG52BvV4jP3GWz6bOZCz61nLgBc3ffQYE4+EHfCD+V7w=="
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,21 +5,21 @@
 | 
				
			|||||||
    "registry": "https://repository.akkerweb.nl/repository/npm-hosted/"
 | 
					    "registry": "https://repository.akkerweb.nl/repository/npm-hosted/"
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "peerDependencies": {
 | 
					  "peerDependencies": {
 | 
				
			||||||
    "@ng-bootstrap/ng-bootstrap": "^7.0",
 | 
					    "@ng-bootstrap/ng-bootstrap": ">=10.0.0",
 | 
				
			||||||
    "@angular/common": "~12.2.8",
 | 
					    "@angular/common": ">=14.0.0",
 | 
				
			||||||
    "@angular/core": "~12.2.8",
 | 
					    "@angular/core": ">=14.0.0",
 | 
				
			||||||
    "@angular/forms": "~12.2.8",
 | 
					    "@angular/forms": ">=14.0.0",
 | 
				
			||||||
    "@ngrx/effects": "^12.0",
 | 
					    "@ngrx/effects": ">=14.0.0",
 | 
				
			||||||
    "@ngrx/router-store": "^12.0",
 | 
					    "@ngrx/router-store": ">=14.0.0",
 | 
				
			||||||
    "@ngrx/store": "^12.0",
 | 
					    "@ngrx/store": ">=14.0.0",
 | 
				
			||||||
    "tassign": "^1.0.0",
 | 
					    "tassign": ">=1.0.0",
 | 
				
			||||||
    "bootstrap": "^4.4.1",
 | 
					    "bootstrap": ">=4.4.1",
 | 
				
			||||||
    "@microsoft/signalr": "^3.1.3",
 | 
					    "@microsoft/signalr": ">=3.1.3",
 | 
				
			||||||
    "ngx-uploadx": "^3.3.4",
 | 
					    "ngx-uploadx": ">=5.1.0",
 | 
				
			||||||
    "angular-oauth2-oidc": "^12.0",
 | 
					    "angular-oauth2-oidc": ">=13.0.0",
 | 
				
			||||||
    "moment": "^2.27.0",
 | 
					    "moment": ">=2.27.0",
 | 
				
			||||||
    "ngx-avatar": "^4.0.0",
 | 
					    "ngx-avatar": ">=4.1.0",
 | 
				
			||||||
    "ngx-image-cropper": "^3.3.5",
 | 
					    "ngx-image-cropper": ">=3.3.5",
 | 
				
			||||||
    "ngx-clipboard": "^14.0.1"
 | 
					    "ngx-clipboard": ">=14.0.1"
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,6 +12,9 @@ export const INITUSERSUCCESS = '[AppCommon] InitUserSuccess';
 | 
				
			|||||||
export const INITUSERPACKAGES = '[AppCommon] InitUserPackages';
 | 
					export const INITUSERPACKAGES = '[AppCommon] InitUserPackages';
 | 
				
			||||||
export const INITUSERPACKAGESSUCCESS = '[AppCommon] InitUserPackagesSuccess';
 | 
					export const INITUSERPACKAGESSUCCESS = '[AppCommon] InitUserPackagesSuccess';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export const INITPACKAGES = '[AppCommon] InitPackages';
 | 
				
			||||||
 | 
					export const INITPACKAGESSUCCESS = '[AppCommon] InitPackagesSuccess';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const INITUSERSETTINGSROOT = '[AppCommon] InitUserSettingsRoot';
 | 
					export const INITUSERSETTINGSROOT = '[AppCommon] InitUserSettingsRoot';
 | 
				
			||||||
export const INITUSERSETTINGSROOTSUCCESS = '[AppCommon] InitUserSettingsRootSuccess';
 | 
					export const INITUSERSETTINGSROOTSUCCESS = '[AppCommon] InitUserSettingsRootSuccess';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -102,6 +105,18 @@ export class InitUserPackagesSuccess implements Action {
 | 
				
			|||||||
  constructor(public items:IItem[] ) { }
 | 
					  constructor(public items:IItem[] ) { }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export class InitPackages implements Action {
 | 
				
			||||||
 | 
					  readonly type = INITPACKAGES;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  constructor() {}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export class InitPackagesSuccess implements Action {
 | 
				
			||||||
 | 
					  readonly type = INITPACKAGESSUCCESS;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  constructor(public items:IItem[] ) { }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export class InitUserSettingsRoot implements Action {
 | 
					export class InitUserSettingsRoot implements Action {
 | 
				
			||||||
  readonly type = INITUSERSETTINGSROOT;
 | 
					  readonly type = INITUSERSETTINGSROOT;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -381,6 +396,8 @@ export type Actions = OpenModal
 | 
				
			|||||||
  | SetMenuVisible
 | 
					  | SetMenuVisible
 | 
				
			||||||
  | InitUserPackages
 | 
					  | InitUserPackages
 | 
				
			||||||
  | InitUserPackagesSuccess
 | 
					  | InitUserPackagesSuccess
 | 
				
			||||||
 | 
					  | InitPackages
 | 
				
			||||||
 | 
					  | InitPackagesSuccess
 | 
				
			||||||
  | InitUserSettingsRoot
 | 
					  | InitUserSettingsRoot
 | 
				
			||||||
  | InitUserSettingsRootSuccess
 | 
					  | InitUserSettingsRootSuccess
 | 
				
			||||||
  | ToggleAccountMenu
 | 
					  | ToggleAccountMenu
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -35,6 +35,7 @@ import { PackageService } from './services/package.service';
 | 
				
			|||||||
import { PackagePreloadStrategy } from './services/package-preload-strategy.service';
 | 
					import { PackagePreloadStrategy } from './services/package-preload-strategy.service';
 | 
				
			||||||
import { SenmlService } from './services/senml-service';
 | 
					import { SenmlService } from './services/senml-service';
 | 
				
			||||||
import { DeviceService } from './services/device.service';
 | 
					import { DeviceService } from './services/device.service';
 | 
				
			||||||
 | 
					import { GradientService} from './services/gradient.service';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export {
 | 
					export {
 | 
				
			||||||
  FolderService,
 | 
					  FolderService,
 | 
				
			||||||
@@ -61,7 +62,8 @@ export {
 | 
				
			|||||||
  PackageService,
 | 
					  PackageService,
 | 
				
			||||||
  SenmlService,
 | 
					  SenmlService,
 | 
				
			||||||
  PackagePreloadStrategy,
 | 
					  PackagePreloadStrategy,
 | 
				
			||||||
  DeviceService
 | 
					  DeviceService,
 | 
				
			||||||
 | 
					  GradientService
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@NgModule({
 | 
					@NgModule({
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -32,6 +32,7 @@ import { TimespanComponent } from './components/timespan/timespan.component';
 | 
				
			|||||||
import { TagInputComponent } from './components/tag-input/tag-input.component';
 | 
					import { TagInputComponent } from './components/tag-input/tag-input.component';
 | 
				
			||||||
import { MenuBackgroundComponent } from './components/menu-background/menu-background.component';
 | 
					import { MenuBackgroundComponent } from './components/menu-background/menu-background.component';
 | 
				
			||||||
import { HasPackageDirective} from './components/has-package/has-package.directive';
 | 
					import { HasPackageDirective} from './components/has-package/has-package.directive';
 | 
				
			||||||
 | 
					import { PackageExistsDirective} from './components/package-exists/package-exists.directive';
 | 
				
			||||||
import { HasClaimDirective} from './components/has-claim/has-claim.directive';
 | 
					import { HasClaimDirective} from './components/has-claim/has-claim.directive';
 | 
				
			||||||
import { UserMenuComponent} from './components/user-menu/user-menu.component';
 | 
					import { UserMenuComponent} from './components/user-menu/user-menu.component';
 | 
				
			||||||
import { ThumbnailComponent } from './components/thumbnail/thumbnail.component';
 | 
					import { ThumbnailComponent } from './components/thumbnail/thumbnail.component';
 | 
				
			||||||
@@ -82,6 +83,7 @@ export {
 | 
				
			|||||||
  UserMenuComponent,
 | 
					  UserMenuComponent,
 | 
				
			||||||
  ThumbnailComponent,
 | 
					  ThumbnailComponent,
 | 
				
			||||||
  HasPackageDirective,
 | 
					  HasPackageDirective,
 | 
				
			||||||
 | 
					  PackageExistsDirective,
 | 
				
			||||||
  HasClaimDirective,
 | 
					  HasClaimDirective,
 | 
				
			||||||
  Alert,
 | 
					  Alert,
 | 
				
			||||||
  IEventMessage,
 | 
					  IEventMessage,
 | 
				
			||||||
@@ -144,6 +146,7 @@ export {
 | 
				
			|||||||
    SessionClearedComponent,
 | 
					    SessionClearedComponent,
 | 
				
			||||||
    MenuBackgroundComponent,
 | 
					    MenuBackgroundComponent,
 | 
				
			||||||
    HasPackageDirective,
 | 
					    HasPackageDirective,
 | 
				
			||||||
 | 
					    PackageExistsDirective,
 | 
				
			||||||
    HasClaimDirective,
 | 
					    HasClaimDirective,
 | 
				
			||||||
    UserMenuComponent,
 | 
					    UserMenuComponent,
 | 
				
			||||||
    GradientComponent,
 | 
					    GradientComponent,
 | 
				
			||||||
@@ -174,6 +177,7 @@ export {
 | 
				
			|||||||
    SessionClearedComponent,
 | 
					    SessionClearedComponent,
 | 
				
			||||||
    MenuBackgroundComponent,
 | 
					    MenuBackgroundComponent,
 | 
				
			||||||
    HasPackageDirective,
 | 
					    HasPackageDirective,
 | 
				
			||||||
 | 
					    PackageExistsDirective,
 | 
				
			||||||
    HasClaimDirective,
 | 
					    HasClaimDirective,
 | 
				
			||||||
    UserMenuComponent,
 | 
					    UserMenuComponent,
 | 
				
			||||||
    GradientComponent,
 | 
					    GradientComponent,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,13 +1,15 @@
 | 
				
			|||||||
<div class="app fullscreen" (click)="handleClick($event)" [ngClass]="{'fullscreen' :(fullScreen|async),'pagemode':(isPageMode|async),'appmode':!(isPageMode|async)}">
 | 
					<div class="app fullscreen" (click)="handleClick($event)" [ngClass]="{'fullscreen' :(fullScreen|async),'pagemode':(isPageMode|async),'appmode':!(isPageMode|async)}">
 | 
				
			||||||
  <nav class="navbar navbar-light navbar-expand bg-light navigation-clean">
 | 
					  <nav class="navbar navbar-light navbar-expand bg-light navigation-clean">
 | 
				
			||||||
    <div class="header-logo pageonly"><router-outlet name="header-logo"></router-outlet></div> 
 | 
					    <div class="container-fluid">
 | 
				
			||||||
    <button type="button" class="btn btn-outline-secondary apponly" (click)="handleToggleMenu($event)"><i class="fal fa-bars" aria-hidden="true"></i></button>
 | 
					      <div class="header-logo pageonly"><router-outlet name="header-logo"></router-outlet></div> 
 | 
				
			||||||
    <router-outlet name="menu" class="ml-4"></router-outlet>
 | 
					      <button type="button" class="btn btn-outline-secondary apponly" (click)="handleToggleMenu($event)"><i class="fal fa-bars" aria-hidden="true"></i></button>
 | 
				
			||||||
    <div class="collapse navbar-collapse pageonly">      
 | 
					      <router-outlet name="menu" class="ml-4"></router-outlet>
 | 
				
			||||||
      <a class="btn btn-primary ml-auto" role="button" [routerLink]="[ startPage == null?'/map':startPage]">
 | 
					      <div class="collapse navbar-collapse pageonly">      
 | 
				
			||||||
        <span *ngIf="(user|async)==null" i18n>Sign in</span>
 | 
					        <a class="btn btn-primary ml-auto" role="button" [routerLink]="[ startPage == null?'/map':startPage]">
 | 
				
			||||||
        <span *ngIf="(user|async)!=null" i18n>To app</span>
 | 
					          <span *ngIf="(user|async)==null" i18n>Sign in</span>
 | 
				
			||||||
      </a>
 | 
					          <span *ngIf="(user|async)!=null" i18n>To app</span>
 | 
				
			||||||
 | 
					        </a>
 | 
				
			||||||
 | 
					      </div>  
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
  </nav>
 | 
					  </nav>
 | 
				
			||||||
  <div class="body">
 | 
					  <div class="body">
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,7 @@
 | 
				
			|||||||
import { Component, Input, OnInit ,OnChanges, SimpleChanges,ChangeDetectorRef} from '@angular/core';
 | 
					import { Component, Input, OnInit ,OnChanges, SimpleChanges,ChangeDetectorRef} from '@angular/core';
 | 
				
			||||||
import { IItem} from '../../models/item'
 | 
					import { IItem} from '../../models/item'
 | 
				
			||||||
import { IGradientstop } from '../../models/gradient';
 | 
					import { IGradientstop } from '../../models/gradient';
 | 
				
			||||||
 | 
					import { GradientService } from '../../common-service.module';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -14,23 +15,12 @@ export class GradientComponent implements OnInit,OnChanges {
 | 
				
			|||||||
  @Input() gradientItem:IItem;
 | 
					  @Input() gradientItem:IItem;
 | 
				
			||||||
  public gradientStyle:any = {};
 | 
					  public gradientStyle:any = {};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  constructor(private ref: ChangeDetectorRef) { }
 | 
					  constructor(private ref: ChangeDetectorRef,private gradientService:GradientService) { }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  getGradientStyle(item:IItem):any {
 | 
					  getGradientStyle(item:IItem):any {
 | 
				
			||||||
    if(item.data && item.data.gradient) {
 | 
					    if(item.data && item.data.gradient) {
 | 
				
			||||||
      let gradient = item.data.gradient as IGradientstop[];
 | 
					      let gradient = item.data.gradient as IGradientstop[];
 | 
				
			||||||
      let gd = '{ "background": "linear-gradient(to right,';
 | 
					      return this.gradientService.getGradientStyle(gradient);
 | 
				
			||||||
      for(var i=0;i<gradient.length;i++) {
 | 
					 | 
				
			||||||
        let gs = gradient[i];
 | 
					 | 
				
			||||||
        if(i>0) gd+=",";
 | 
					 | 
				
			||||||
        gd += `rgba(${gs.color.red},${gs.color.green},${gs.color.blue},${gs.color.alpha/255})`;          
 | 
					 | 
				
			||||||
        gd +=` ${gs.relativestop*100}%`
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
      gradient.forEach((gs) => {
 | 
					 | 
				
			||||||
      });
 | 
					 | 
				
			||||||
      gd+=')"}';
 | 
					 | 
				
			||||||
      
 | 
					 | 
				
			||||||
      return JSON.parse(gd);
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -49,5 +39,4 @@ export class GradientComponent implements OnInit,OnChanges {
 | 
				
			|||||||
      }      
 | 
					      }      
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -0,0 +1,61 @@
 | 
				
			|||||||
 | 
					import {AfterViewInit, Directive, Input, OnDestroy, TemplateRef, ViewContainerRef} from '@angular/core';
 | 
				
			||||||
 | 
					import {Subscription} from 'rxjs';
 | 
				
			||||||
 | 
					import {PackageService} from '../../services/package.service';
 | 
				
			||||||
 | 
					import * as appCommonReducer from '../../reducers/app-common.reducer';
 | 
				
			||||||
 | 
					import {Store} from '@ngrx/store';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@Directive({
 | 
				
			||||||
 | 
					  selector: '[fmPackageExists]',
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					export class PackageExistsDirective implements OnDestroy, AfterViewInit {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @Input()
 | 
				
			||||||
 | 
					  set fmPackageExists(packageIdentifier: string) {
 | 
				
			||||||
 | 
					    this.packageIdentifier = packageIdentifier;
 | 
				
			||||||
 | 
					    this.updateView();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @Input()
 | 
				
			||||||
 | 
					  set fmPackageExistsThen(thenTemplate: TemplateRef<any>) {
 | 
				
			||||||
 | 
					    this.thenTemplate = thenTemplate;
 | 
				
			||||||
 | 
					    this.updateView();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @Input()
 | 
				
			||||||
 | 
					  set fmPackageExistsElse(thenTemplate: TemplateRef<any>) {
 | 
				
			||||||
 | 
					    this.elseTemplate = thenTemplate;
 | 
				
			||||||
 | 
					    this.updateView();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  private packageIdentifier: string;
 | 
				
			||||||
 | 
					  private thenTemplate: TemplateRef<any>;
 | 
				
			||||||
 | 
					  private elseTemplate: TemplateRef<any>;
 | 
				
			||||||
 | 
					  private packSub: Subscription;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  constructor(private hostTemplateRef: TemplateRef<any>, private viewContainerRef: ViewContainerRef,
 | 
				
			||||||
 | 
					              private store: Store<appCommonReducer.State>, private packageService: PackageService) {
 | 
				
			||||||
 | 
					    this.thenTemplate = hostTemplateRef;
 | 
				
			||||||
 | 
					    this.packSub = this.store.select(appCommonReducer.SelectGetPackages).subscribe((_) => {
 | 
				
			||||||
 | 
					      this.updateView();
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  ngAfterViewInit() {
 | 
				
			||||||
 | 
					    this.updateView();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  updateView() {
 | 
				
			||||||
 | 
					    this.viewContainerRef.clear();
 | 
				
			||||||
 | 
					    if (this.packageService.packageExists(this.packageIdentifier)) {
 | 
				
			||||||
 | 
					      this.viewContainerRef.createEmbeddedView(this.thenTemplate);
 | 
				
			||||||
 | 
					    } else if (this.elseTemplate) {
 | 
				
			||||||
 | 
					      this.viewContainerRef.createEmbeddedView(this.elseTemplate);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  ngOnDestroy() {
 | 
				
			||||||
 | 
					    if (this.packSub) {
 | 
				
			||||||
 | 
					      this.packSub.unsubscribe();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -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.handleFile(f,options);
 | 
					      this.uploadService.handleFiles(f,options);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
import { Component, Input,ViewChild,ElementRef,OnChanges,SimpleChanges,HostListener,ChangeDetectorRef  } from '@angular/core';
 | 
					import { Component, Input,Output,ViewChild,EventEmitter, ElementRef,OnChanges,SimpleChanges,HostListener,ChangeDetectorRef  } from '@angular/core';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@Component({
 | 
					@Component({
 | 
				
			||||||
  selector: 'fm-side-panel',
 | 
					  selector: 'fm-side-panel',
 | 
				
			||||||
@@ -12,7 +12,8 @@ export class SidePanelComponent  implements OnChanges {
 | 
				
			|||||||
  @Input() public collapsed: boolean;
 | 
					  @Input() public collapsed: boolean;
 | 
				
			||||||
  @Input() public collapsable: boolean;
 | 
					  @Input() public collapsable: boolean;
 | 
				
			||||||
  @Input() public resizeable: boolean = false;
 | 
					  @Input() public resizeable: boolean = false;
 | 
				
			||||||
  @Input() public left: boolean = false;
 | 
					  @Input() public left: boolean = false;  
 | 
				
			||||||
 | 
					  @Output() onResize: EventEmitter<number> = new EventEmitter<number>();
 | 
				
			||||||
  @ViewChild("resizeGrip") elementView: ElementRef;
 | 
					  @ViewChild("resizeGrip") elementView: ElementRef;
 | 
				
			||||||
  public mobile:boolean = true;
 | 
					  public mobile:boolean = true;
 | 
				
			||||||
  private parentHeight:number = 0;
 | 
					  private parentHeight:number = 0;
 | 
				
			||||||
@@ -35,6 +36,7 @@ export class SidePanelComponent  implements OnChanges {
 | 
				
			|||||||
  setTop() {
 | 
					  setTop() {
 | 
				
			||||||
    this.mobile = this.left?false: this.checkMobile();
 | 
					    this.mobile = this.left?false: this.checkMobile();
 | 
				
			||||||
    this.resizeTop = this.mobile?50:0;
 | 
					    this.resizeTop = this.mobile?50:0;
 | 
				
			||||||
 | 
					    this.onResize.emit(this.resizeTop);
 | 
				
			||||||
    this.top =  (this.visible?this.resizeTop: (this.mobile? 100:0)) + "%";
 | 
					    this.top =  (this.visible?this.resizeTop: (this.mobile? 100:0)) + "%";
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -71,6 +73,7 @@ export class SidePanelComponent  implements OnChanges {
 | 
				
			|||||||
      clientY=(event as DragEvent).clientY;
 | 
					      clientY=(event as DragEvent).clientY;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    this.resizeTop =  Math.min(98, Math.max(0, clientY / (this.parentHeight  / 100)));
 | 
					    this.resizeTop =  Math.min(98, Math.max(0, clientY / (this.parentHeight  / 100)));
 | 
				
			||||||
 | 
					    this.onResize.emit(this.resizeTop);
 | 
				
			||||||
    this.top =  (this.visible? this.resizeTop:(this.mobile? 100:0)) + "%";
 | 
					    this.top =  (this.visible? this.resizeTop:(this.mobile? 100:0)) + "%";
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -81,7 +84,7 @@ export class SidePanelComponent  implements OnChanges {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @HostListener('window:resize', ['$event'])
 | 
					  @HostListener('window:resize', ['$event'])
 | 
				
			||||||
  onResize(event) {
 | 
					  handleResize(event) {
 | 
				
			||||||
    this.setTop();
 | 
					    this.setTop();
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,3 +1,11 @@
 | 
				
			|||||||
<div class="tags">
 | 
					<div class="tags">
 | 
				
			||||||
  <span class="tag rounded bg-primary text-white" *ngFor="let tag of tags;"><span>{{tag}}</span> <i (click)="handleDeleteTag(tag)" class="fal fa-times" aria-hidden="true"></i></span><input type="text" #taginput (blur)="handleAddTag($event)" (keyup)="handleCheckAddTag($event)" [(ngModel)]="tag" [ngbTypeahead]="findTag" (selectItem)="handleSelect($event)" placeholder="New tag"/>
 | 
					  <span class="tag rounded bg-primary text-white" *ngFor="let tag of tags;"><span>{{tag}}</span> <i
 | 
				
			||||||
</div>
 | 
					    (click)="handleDeleteTag(tag)" class="fal fa-times" aria-hidden="true"></i></span><input
 | 
				
			||||||
 | 
					  type="text" #tagInputElement
 | 
				
			||||||
 | 
					  (blur)="handleBlur($event, false)"
 | 
				
			||||||
 | 
					  (keyup)="handleKeyUp($event)"
 | 
				
			||||||
 | 
					  [(ngModel)]="tag"
 | 
				
			||||||
 | 
					  [ngbTypeahead]="findTag"
 | 
				
			||||||
 | 
					  (selectItem)="handleSelect($event)"
 | 
				
			||||||
 | 
					  placeholder="New tag"/>
 | 
				
			||||||
 | 
					</div>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,104 +1,122 @@
 | 
				
			|||||||
import { Component, Input, forwardRef,ElementRef,ViewChild } from '@angular/core';
 | 
					import {Component, ElementRef, forwardRef, Input, ViewChild} from '@angular/core';
 | 
				
			||||||
import { ControlValueAccessor, NG_VALUE_ACCESSOR,NgModel } from '@angular/forms';
 | 
					import {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';
 | 
				
			||||||
import { Observable,of } from 'rxjs';
 | 
					import {Observable, of} from 'rxjs';
 | 
				
			||||||
import { tap,catchError,debounceTime,distinctUntilChanged,switchMap } from 'rxjs/operators'
 | 
					import {catchError, debounceTime, distinctUntilChanged, switchMap, tap} from 'rxjs/operators';
 | 
				
			||||||
import { TypeaheadService } from '../../services/typeahead.service';
 | 
					import {TypeaheadService} from '../../services/typeahead.service';
 | 
				
			||||||
 | 
					import {NgbTypeahead} from '@ng-bootstrap/ng-bootstrap';
 | 
				
			||||||
@Component({
 | 
					
 | 
				
			||||||
  selector: 'fm-tag-input',
 | 
					@Component({
 | 
				
			||||||
  templateUrl: 'tag-input.component.html',
 | 
					  selector: 'fm-tag-input',
 | 
				
			||||||
  styleUrls: ['tag-input.component.scss'],
 | 
					  templateUrl: 'tag-input.component.html',
 | 
				
			||||||
  providers: [
 | 
					  styleUrls: ['tag-input.component.scss'],
 | 
				
			||||||
    {
 | 
					  providers: [
 | 
				
			||||||
      provide: NG_VALUE_ACCESSOR,
 | 
					    {
 | 
				
			||||||
      useExisting: forwardRef(() => TagInputComponent),
 | 
					      provide: NG_VALUE_ACCESSOR,
 | 
				
			||||||
      multi: true
 | 
					      useExisting: forwardRef(() => TagInputComponent),
 | 
				
			||||||
    }
 | 
					      multi: true
 | 
				
			||||||
  ]
 | 
					    }
 | 
				
			||||||
})
 | 
					  ]
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
export class TagInputComponent implements ControlValueAccessor  {
 | 
					
 | 
				
			||||||
  @Input() tags: string[]
 | 
					export class TagInputComponent implements ControlValueAccessor {
 | 
				
			||||||
  @ViewChild('taginput', { static: true }) tagInputElement: ElementRef;
 | 
					  @Input() tags: string[] = [];
 | 
				
			||||||
  public tag: string;
 | 
					  @ViewChild('tagInputElement', {static: true}) tagInputElement: ElementRef;
 | 
				
			||||||
  searching = false;
 | 
					  @ViewChild(NgbTypeahead, {static: true}) typeahead: NgbTypeahead;
 | 
				
			||||||
  searchFailed = false;
 | 
					
 | 
				
			||||||
 | 
					  public tag: string;
 | 
				
			||||||
  constructor(private typeaheadService: TypeaheadService) {
 | 
					  searching = false;
 | 
				
			||||||
  }
 | 
					  searchFailed = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  tagExists(tag) {
 | 
					  constructor(private typeaheadService: TypeaheadService) {
 | 
				
			||||||
    if (tag.length == 0) return true;
 | 
					  }
 | 
				
			||||||
    for (let t of this.tags) {
 | 
					
 | 
				
			||||||
      if (t.toLowerCase() == tag.toLowerCase()) return true;
 | 
					  tagExists(tag) {
 | 
				
			||||||
    }
 | 
					    if (tag.length === 0) {
 | 
				
			||||||
    return false;
 | 
					      return true;
 | 
				
			||||||
  }
 | 
					    }
 | 
				
			||||||
 | 
					    for (const t of this.tags) {
 | 
				
			||||||
  handleDeleteTag(tag) {
 | 
					      if (t.toLowerCase() === tag.toLowerCase()) {
 | 
				
			||||||
    let tags = [];
 | 
					        return true;
 | 
				
			||||||
    for (let t of this.tags) {
 | 
					      }
 | 
				
			||||||
      if (t != tag) tags.push(t);
 | 
					    }
 | 
				
			||||||
    }
 | 
					    return false;
 | 
				
			||||||
    this.tags = tags;
 | 
					  }
 | 
				
			||||||
    this.propagateChange(tags);
 | 
					
 | 
				
			||||||
  }
 | 
					  addTag(tag, keepFocus = true) {
 | 
				
			||||||
 | 
					    if (!this.tagExists(tag)) {
 | 
				
			||||||
  handleAddTag(event) {
 | 
					      this.tags.push(tag);
 | 
				
			||||||
    if (!this.tagExists(this.tag)) {
 | 
					      this.propagateChange(this.tags);
 | 
				
			||||||
      this.tags.push(this.tag);
 | 
					    }
 | 
				
			||||||
      this.propagateChange(this.tags);
 | 
					    this.tag = '';
 | 
				
			||||||
    }
 | 
					
 | 
				
			||||||
    this.tag = "";
 | 
					    if (keepFocus) {
 | 
				
			||||||
    this.tagInputElement.nativeElement.focus();
 | 
					      this.tagInputElement.nativeElement.focus();
 | 
				
			||||||
  }
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
  handleCheckAddTag(event: KeyboardEvent) {
 | 
					
 | 
				
			||||||
    if (event.keyCode == 188) {
 | 
					  handleDeleteTag(tag) {
 | 
				
			||||||
      let tag = this.tag.substr(0, this.tag.length - 1); // strip ,
 | 
					    const tags = [];
 | 
				
			||||||
      if (!this.tagExists(tag)) {
 | 
					    for (const t of this.tags) {
 | 
				
			||||||
        this.tags.push(tag);
 | 
					      if (t !== tag) {
 | 
				
			||||||
        this.propagateChange(this.tags);
 | 
					        tags.push(t);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      this.tag = "";
 | 
					    }
 | 
				
			||||||
    }
 | 
					    this.tags = tags;
 | 
				
			||||||
  }
 | 
					    this.propagateChange(tags);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
  handleSelect(event) {
 | 
					
 | 
				
			||||||
    if (!this.tagExists(event.item)) {
 | 
					  handleBlur(event, keepFocus = true) {
 | 
				
			||||||
      this.tags.push(event.item);
 | 
					    if (!this.typeahead.isPopupOpen()) {
 | 
				
			||||||
      this.propagateChange(this.tags);
 | 
					      this.addTag(this.tag, keepFocus);
 | 
				
			||||||
    }
 | 
					    } else {
 | 
				
			||||||
    event.preventDefault();
 | 
					      this.tag = '';
 | 
				
			||||||
    this.tag = "";
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  propagateChange = (_: any) => { };
 | 
					  handleKeyUp(event: KeyboardEvent) {
 | 
				
			||||||
 | 
					    if (event.keyCode === 188) {
 | 
				
			||||||
  registerOnChange(fn) {
 | 
					      const tag = this.tag.substr(0, this.tag.length - 1); // strip ,
 | 
				
			||||||
    this.propagateChange = fn;
 | 
					      this.addTag(tag);
 | 
				
			||||||
  }
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
  findTag = (text$: Observable<string>) =>
 | 
					
 | 
				
			||||||
  text$.pipe(
 | 
					  handleSelect(event) {
 | 
				
			||||||
        debounceTime(200),
 | 
					    if (!this.tagExists(event.item)) {
 | 
				
			||||||
        distinctUntilChanged(), 
 | 
					      this.tags.push(event.item);
 | 
				
			||||||
        tap(() => this.searching = true),
 | 
					      this.propagateChange(this.tags);
 | 
				
			||||||
        switchMap(term => term.length < 1 ? of([]) :
 | 
					    }
 | 
				
			||||||
           this.typeaheadService.getTagTypeaheadItems(term).pipe(
 | 
					    event.preventDefault();
 | 
				
			||||||
            tap(() => this.searchFailed = false),
 | 
					    this.tag = '';
 | 
				
			||||||
            catchError(() => {
 | 
					  }
 | 
				
			||||||
                this.searchFailed = true;
 | 
					
 | 
				
			||||||
                return of([]);
 | 
					  propagateChange = (_: any) => {
 | 
				
			||||||
            }))
 | 
					  };
 | 
				
			||||||
         ),
 | 
					
 | 
				
			||||||
         tap(() => this.searching = false)
 | 
					  registerOnChange(fn) {
 | 
				
			||||||
  );
 | 
					    this.propagateChange = fn;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
  writeValue(value: any) {
 | 
					
 | 
				
			||||||
    this.tags = value;
 | 
					  findTag = (text$: Observable<string>) =>
 | 
				
			||||||
    this.tag = "";
 | 
					    text$.pipe(
 | 
				
			||||||
  }
 | 
					      distinctUntilChanged(),
 | 
				
			||||||
 | 
					      debounceTime(200),
 | 
				
			||||||
  registerOnTouched() { }
 | 
					      tap(() => this.searching = true),
 | 
				
			||||||
}
 | 
					      switchMap(term => term.length < 1 ? of([]) :
 | 
				
			||||||
 | 
					        this.typeaheadService.getTagTypeaheadItems(term).pipe(
 | 
				
			||||||
 | 
					          tap(() => this.searchFailed = false),
 | 
				
			||||||
 | 
					          catchError(() => {
 | 
				
			||||||
 | 
					            this.searchFailed = true;
 | 
				
			||||||
 | 
					            return of([]);
 | 
				
			||||||
 | 
					          }))
 | 
				
			||||||
 | 
					      ),
 | 
				
			||||||
 | 
					      tap(() => this.searching = false)
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  writeValue(value: any) {
 | 
				
			||||||
 | 
					    this.tags = value;
 | 
				
			||||||
 | 
					    this.tag = '';
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  registerOnTouched() {
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -62,6 +62,15 @@ export class AppCommonEffects {
 | 
				
			|||||||
      )
 | 
					      )
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
  ));
 | 
					  ));
 | 
				
			||||||
 | 
					  initPackages$ =  createEffect(() => this.actions$.pipe(
 | 
				
			||||||
 | 
					    ofType(appCommonActions.INITPACKAGES),
 | 
				
			||||||
 | 
					    switchMap(() => {
 | 
				
			||||||
 | 
					      return this.itemService$.getItemList('vnd.farmmaps.itemtype.package.template').pipe(
 | 
				
			||||||
 | 
					        switchMap((items) => of(new appCommonActions.InitPackagesSuccess(items))),
 | 
				
			||||||
 | 
					        catchError(error =>  of(new appCommonActions.Fail(error)))
 | 
				
			||||||
 | 
					      )
 | 
				
			||||||
 | 
					    })
 | 
				
			||||||
 | 
					  ));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  userPackagesChanged$ =  createEffect(() => this.actions$.pipe(
 | 
					  userPackagesChanged$ =  createEffect(() => this.actions$.pipe(
 | 
				
			||||||
    ofType(appCommonActions.ITEMCHANGEDEVENT),
 | 
					    ofType(appCommonActions.ITEMCHANGEDEVENT),
 | 
				
			||||||
@@ -99,7 +108,7 @@ export class AppCommonEffects {
 | 
				
			|||||||
  initUserSuccess$ =  createEffect(() => this.actions$.pipe(
 | 
					  initUserSuccess$ =  createEffect(() => this.actions$.pipe(
 | 
				
			||||||
    ofType(appCommonActions.INITUSERSUCCESS),
 | 
					    ofType(appCommonActions.INITUSERSUCCESS),
 | 
				
			||||||
    switchMap(() => {
 | 
					    switchMap(() => {
 | 
				
			||||||
      return [new appCommonActions.InitRoot(),new appCommonActions.InitUserPackages(),new appCommonActions.InitUserSettingsRoot()];
 | 
					      return [new appCommonActions.InitRoot(),new appCommonActions.InitUserPackages(),new appCommonActions.InitPackages(),new appCommonActions.InitUserSettingsRoot()];
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    )));
 | 
					    )));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -9,3 +9,8 @@ export interface IPackage {
 | 
				
			|||||||
export interface IPackages {
 | 
					export interface IPackages {
 | 
				
			||||||
    [id: string]: IPackage[];
 | 
					    [id: string]: IPackage[];
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export interface IPackageMap {
 | 
				
			||||||
 | 
					    [id: string]: IPackage;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,7 @@
 | 
				
			|||||||
export interface IQueryState {
 | 
					export interface IQueryState {
 | 
				
			||||||
  itemCode: string;
 | 
					  itemCode: string;
 | 
				
			||||||
  parentCode: string;
 | 
					  parentCode: string;
 | 
				
			||||||
 | 
					  dataFilter?: string;
 | 
				
			||||||
  level: number;
 | 
					  level: number;
 | 
				
			||||||
  itemType: string;
 | 
					  itemType: string;
 | 
				
			||||||
  query: string;
 | 
					  query: string;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,7 +2,7 @@ import { tassign } from 'tassign';
 | 
				
			|||||||
import { IItemTypes} from '../models/item.types';
 | 
					import { IItemTypes} from '../models/item.types';
 | 
				
			||||||
import { IListItem } from '../models/list.item';
 | 
					import { IListItem } from '../models/list.item';
 | 
				
			||||||
import { IUser } from '../models/user';
 | 
					import { IUser } from '../models/user';
 | 
				
			||||||
import { IPackage,IPackages} from '../models/package';
 | 
					import { IPackage,IPackageMap,IPackages} from '../models/package';
 | 
				
			||||||
import * as appCommonActions from '../actions/app-common.actions';
 | 
					import * as appCommonActions from '../actions/app-common.actions';
 | 
				
			||||||
import { createSelector, createFeatureSelector, ActionReducerMap } from '@ngrx/store';
 | 
					import { createSelector, createFeatureSelector, ActionReducerMap } from '@ngrx/store';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -20,6 +20,7 @@ export interface State {
 | 
				
			|||||||
  routeLoading:boolean,
 | 
					  routeLoading:boolean,
 | 
				
			||||||
  menuVisible: boolean,
 | 
					  menuVisible: boolean,
 | 
				
			||||||
  userPackages: IPackages,
 | 
					  userPackages: IPackages,
 | 
				
			||||||
 | 
					  packages: IPackageMap,
 | 
				
			||||||
  userSettingsRoot: IItem,
 | 
					  userSettingsRoot: IItem,
 | 
				
			||||||
  accountMenuVisible: boolean,
 | 
					  accountMenuVisible: boolean,
 | 
				
			||||||
  appMenuVisible: boolean,
 | 
					  appMenuVisible: boolean,
 | 
				
			||||||
@@ -40,6 +41,7 @@ export const initialState: State = {
 | 
				
			|||||||
  routeLoading: false,
 | 
					  routeLoading: false,
 | 
				
			||||||
  menuVisible: false,
 | 
					  menuVisible: false,
 | 
				
			||||||
  userPackages: {},
 | 
					  userPackages: {},
 | 
				
			||||||
 | 
					  packages: {},
 | 
				
			||||||
  userSettingsRoot: null,
 | 
					  userSettingsRoot: null,
 | 
				
			||||||
  accountMenuVisible: false,
 | 
					  accountMenuVisible: false,
 | 
				
			||||||
  appMenuVisible: false,
 | 
					  appMenuVisible: false,
 | 
				
			||||||
@@ -140,6 +142,15 @@ export function reducer(state = initialState, action: appCommonActions.Actions )
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
      return tassign(state,{userPackages:packages});
 | 
					      return tassign(state,{userPackages:packages});
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    case appCommonActions.INITPACKAGESSUCCESS:{
 | 
				
			||||||
 | 
					      let a = action as appCommonActions.InitPackagesSuccess;
 | 
				
			||||||
 | 
					      let packages = {}
 | 
				
			||||||
 | 
					      a.items.forEach((item) => {
 | 
				
			||||||
 | 
					        packages[item.data.id] = item.data;
 | 
				
			||||||
 | 
					      });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      return tassign(state,{packages:packages});
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    case appCommonActions.INITUSERSETTINGSROOTSUCCESS:{
 | 
					    case appCommonActions.INITUSERSETTINGSROOTSUCCESS:{
 | 
				
			||||||
      let a = action as appCommonActions.InitUserSettingsRootSuccess;
 | 
					      let a = action as appCommonActions.InitUserSettingsRootSuccess;
 | 
				
			||||||
      return tassign(state, { userSettingsRoot : a.item });
 | 
					      return tassign(state, { userSettingsRoot : a.item });
 | 
				
			||||||
@@ -187,6 +198,7 @@ export const getRouteLoading = (state: State) => state.routeLoading;
 | 
				
			|||||||
export const getMenuVisible = (state: State) => state.menuVisible;
 | 
					export const getMenuVisible = (state: State) => state.menuVisible;
 | 
				
			||||||
export const getUser = (state: State) => state.user;
 | 
					export const getUser = (state: State) => state.user;
 | 
				
			||||||
export const getUserPackages = (state: State) => state.userPackages;
 | 
					export const getUserPackages = (state: State) => state.userPackages;
 | 
				
			||||||
 | 
					export const getPackages = (state: State) => state.packages;
 | 
				
			||||||
export const getUserSettingsRoot = (state: State) => state.userSettingsRoot;
 | 
					export const getUserSettingsRoot = (state: State) => state.userSettingsRoot;
 | 
				
			||||||
export const getAccountMenuVisible = (state: State) => state.accountMenuVisible;
 | 
					export const getAccountMenuVisible = (state: State) => state.accountMenuVisible;
 | 
				
			||||||
export const getAppMenuVisible = (state: State) => state.appMenuVisible;
 | 
					export const getAppMenuVisible = (state: State) => state.appMenuVisible;
 | 
				
			||||||
@@ -207,6 +219,7 @@ export const selectGetRouteLoading = createSelector(selectAppCommonState, getRou
 | 
				
			|||||||
export const SelectGetMenuVisible = createSelector(selectAppCommonState,getMenuVisible);
 | 
					export const SelectGetMenuVisible = createSelector(selectAppCommonState,getMenuVisible);
 | 
				
			||||||
export const SelectGetUser = createSelector(selectAppCommonState,getUser);
 | 
					export const SelectGetUser = createSelector(selectAppCommonState,getUser);
 | 
				
			||||||
export const SelectGetUserPackages = createSelector(selectAppCommonState,getUserPackages);
 | 
					export const SelectGetUserPackages = createSelector(selectAppCommonState,getUserPackages);
 | 
				
			||||||
 | 
					export const SelectGetPackages = createSelector(selectAppCommonState,getPackages);
 | 
				
			||||||
export const SelectGetValidUserPackages = createSelector(SelectGetUserPackages, (packageMap) => {
 | 
					export const SelectGetValidUserPackages = createSelector(SelectGetUserPackages, (packageMap) => {
 | 
				
			||||||
  return getValidPackages(packageMap);
 | 
					  return getValidPackages(packageMap);
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										25
									
								
								projects/common/src/fm/services/gradient.service.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								projects/common/src/fm/services/gradient.service.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,25 @@
 | 
				
			|||||||
 | 
					import { Injectable } from '@angular/core';
 | 
				
			||||||
 | 
					import {IGradientstop } from '../models/gradient'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@Injectable({
 | 
				
			||||||
 | 
					  providedIn: 'root',
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					export class GradientService {
 | 
				
			||||||
 | 
					  constructor() {
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  getGradientStyle(gradient:IGradientstop[],portrait:boolean = false ):any {
 | 
				
			||||||
 | 
					      let gd = '{ "background": "linear-gradient(to ' + (portrait?'bottom':'right') +',';
 | 
				
			||||||
 | 
					      for(var i=0;i<gradient.length;i++) {
 | 
				
			||||||
 | 
					        let gs = gradient[i];
 | 
				
			||||||
 | 
					        if(i>0) gd+=",";
 | 
				
			||||||
 | 
					        gd += `rgba(${gs.color.red},${gs.color.green},${gs.color.blue},${gs.color.alpha/255})`;          
 | 
				
			||||||
 | 
					        gd +=` ${gs.relativestop*100}%`
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					      gradient.forEach((gs) => {
 | 
				
			||||||
 | 
					      });
 | 
				
			||||||
 | 
					      gd+=')"}';
 | 
				
			||||||
 | 
					      
 | 
				
			||||||
 | 
					      return JSON.parse(gd);
 | 
				
			||||||
 | 
					    }  
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -83,7 +83,8 @@ export class ItemService {
 | 
				
			|||||||
    return this.httpClient.get<IItem[]>(`${this.ApiEndpoint()}/api/v1/items/`, { params: params });
 | 
					    return this.httpClient.get<IItem[]>(`${this.ApiEndpoint()}/api/v1/items/`, { params: params });
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  getChildItemList(parentcode: string, itemType: string, dataFilter?: any, level: number = 1, deep: boolean = true): Observable<IItem[]> {
 | 
					  getChildItemList(parentcode: string, itemType: string, dataFilter?: any, level: number = 1, deep: boolean = true,
 | 
				
			||||||
 | 
					                   startDate?: Date, endDate?: Date): Observable<IItem[]> {
 | 
				
			||||||
    var params = new HttpParams();
 | 
					    var params = new HttpParams();
 | 
				
			||||||
    if(itemType != null) {
 | 
					    if(itemType != null) {
 | 
				
			||||||
      params = params.append("it", itemType);
 | 
					      params = params.append("it", itemType);
 | 
				
			||||||
@@ -93,6 +94,8 @@ export class ItemService {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
    params = params.append("lvl", level.toString());
 | 
					    params = params.append("lvl", level.toString());
 | 
				
			||||||
    params = params.append("deep", deep.toString());
 | 
					    params = params.append("deep", deep.toString());
 | 
				
			||||||
 | 
					    if (startDate) params = params.append("sDate", startDate.toISOString());
 | 
				
			||||||
 | 
					    if (endDate) params = params.append("eDate", endDate.toISOString());
 | 
				
			||||||
    return this.httpClient.get<IItem[]>(`${this.ApiEndpoint()}/api/v1/items/${parentcode}/children`, { params: params });
 | 
					    return this.httpClient.get<IItem[]>(`${this.ApiEndpoint()}/api/v1/items/${parentcode}/children`, { params: params });
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,17 +7,23 @@ import {IItem} from '../models/item';
 | 
				
			|||||||
import {IItemTask} from '../models/itemTask';
 | 
					import {IItemTask} from '../models/itemTask';
 | 
				
			||||||
import {HttpClient} from '@angular/common/http';
 | 
					import {HttpClient} from '@angular/common/http';
 | 
				
			||||||
import {AppConfig} from '../shared/app.config';
 | 
					import {AppConfig} from '../shared/app.config';
 | 
				
			||||||
import {Observable} from 'rxjs';
 | 
					import {Observable,iif,of} from 'rxjs';
 | 
				
			||||||
 | 
					import {switchMap} from 'rxjs/operators';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@Injectable({
 | 
					@Injectable({
 | 
				
			||||||
  providedIn: 'root',
 | 
					  providedIn: 'root',
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export class PackageService {
 | 
					export class PackageService {
 | 
				
			||||||
 | 
					  private userPackages: { [key: string]: IPackage } = {};
 | 
				
			||||||
  private packages: { [key: string]: IPackage } = {};
 | 
					  private packages: { [key: string]: IPackage } = {};
 | 
				
			||||||
 | 
					  private packagesObservable = this.store$.select(appCommonReducer.SelectGetPackages);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  constructor(private store$: Store<appCommonReducer.State>, public httpClient: HttpClient, public appConfig: AppConfig) {
 | 
					  constructor(private store$: Store<appCommonReducer.State>, public httpClient: HttpClient, public appConfig: AppConfig) {
 | 
				
			||||||
    store$.select(appCommonReducer.SelectGetValidUserPackages).subscribe((packages) => {
 | 
					    store$.select(appCommonReducer.SelectGetValidUserPackages).subscribe((packages) => {
 | 
				
			||||||
 | 
					      this.userPackages = packages;
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					    this.packagesObservable.subscribe((packages) => {
 | 
				
			||||||
      this.packages = packages;
 | 
					      this.packages = packages;
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
@@ -27,12 +33,24 @@ export class PackageService {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  hasPackage(id: string): boolean {
 | 
					  hasPackage(id: string): boolean {
 | 
				
			||||||
 | 
					    return id in this.userPackages;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  packageExists(id: string): boolean {
 | 
				
			||||||
    return id in this.packages;
 | 
					    return id in this.packages;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  postItemPackageTask(item: IItem, task: IItemTask): Observable<IItemTask> {
 | 
					  postItemPackageTask(item: IItem, task: IItemTask): Observable<IItemTask> {
 | 
				
			||||||
    return this.httpClient.post<IItemTask>(`${this.ApiEndpoint()}/api/v1/items/${item.code}/packagetasks`, task);
 | 
					    return this.httpClient.post<IItemTask>(`${this.ApiEndpoint()}/api/v1/items/${item.code}/packagetasks`, task);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  ifPackageListExists<Type>(packageList: Array<string>, ifTrue:Observable<Type>,ifFalse:Observable<Type>):Observable<Type> {
 | 
				
			||||||
 | 
					    return this.packagesObservable.pipe(switchMap(packages => 
 | 
				
			||||||
 | 
					        iif(( )=> Object.keys(packages).some(id => packageList.includes(id)),
 | 
				
			||||||
 | 
					            ifTrue,
 | 
				
			||||||
 | 
					            ifFalse) 
 | 
				
			||||||
 | 
					    )); 
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export function getValidPackages(packageMap: IPackages): {[key: string]: IPackage} {
 | 
					export function getValidPackages(packageMap: IPackages): {[key: string]: IPackage} {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -14,7 +14,9 @@ declare const require: any;
 | 
				
			|||||||
// First, initialize the Angular testing environment.
 | 
					// First, initialize the Angular testing environment.
 | 
				
			||||||
getTestBed().initTestEnvironment(
 | 
					getTestBed().initTestEnvironment(
 | 
				
			||||||
  BrowserDynamicTestingModule,
 | 
					  BrowserDynamicTestingModule,
 | 
				
			||||||
  platformBrowserDynamicTesting()
 | 
					  platformBrowserDynamicTesting(), {
 | 
				
			||||||
 | 
					    teardown: { destroyAfterEach: false }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
);
 | 
					);
 | 
				
			||||||
// Then we find all the tests.
 | 
					// Then we find all the tests.
 | 
				
			||||||
const context = require.context('./', true, /\.spec\.ts$/);
 | 
					const context = require.context('./', true, /\.spec\.ts$/);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,7 +2,7 @@
 | 
				
			|||||||
  "extends": "../../tsconfig.json",
 | 
					  "extends": "../../tsconfig.json",
 | 
				
			||||||
  "compilerOptions": {
 | 
					  "compilerOptions": {
 | 
				
			||||||
    "outDir": "../../out-tsc/lib",
 | 
					    "outDir": "../../out-tsc/lib",
 | 
				
			||||||
    "target": "es2015",
 | 
					    "target": "es2020",
 | 
				
			||||||
    "module": "es2015",
 | 
					    "module": "es2015",
 | 
				
			||||||
    "moduleResolution": "node",
 | 
					    "moduleResolution": "node",
 | 
				
			||||||
    "declaration": true,
 | 
					    "declaration": true,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,7 +2,7 @@
 | 
				
			|||||||
  "extends": "../../tsconfig.json",
 | 
					  "extends": "../../tsconfig.json",
 | 
				
			||||||
  "compilerOptions": {
 | 
					  "compilerOptions": {
 | 
				
			||||||
    "outDir": "../../out-tsc/lib",
 | 
					    "outDir": "../../out-tsc/lib",
 | 
				
			||||||
    "target": "es2015",
 | 
					    "target": "es2020",
 | 
				
			||||||
    "module": "es2015",
 | 
					    "module": "es2015",
 | 
				
			||||||
    "moduleResolution": "node",
 | 
					    "moduleResolution": "node",
 | 
				
			||||||
    "declaration": true,
 | 
					    "declaration": true,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -63,7 +63,7 @@ const routes = [
 | 
				
			|||||||
    canActivate: [NavBarGuard],
 | 
					    canActivate: [NavBarGuard],
 | 
				
			||||||
    component: NotImplementedComponent
 | 
					    component: NotImplementedComponent
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  { path: 'map', loadChildren: () => import('../../projects/common-map/src/public-api').then(m => m.AppCommonMapModule), canActivateChild: [AuthGuard], canActivate: [FullScreenGuard] },
 | 
					  { path: 'map', loadChildren: () => import('../../projects/common-map/src/public-api').then(m => m.AppCommonMapModule), canActivateChild: [AuthGuard],canActivate: [NavBarGuard], },
 | 
				
			||||||
  { path: 'map3d', loadChildren: () => import('./map3d/map3d.module').then(m => m.Map3DModule), canActivateChild: [AuthGuard], canActivate: [FullScreenGuard] },
 | 
					  { path: 'map3d', loadChildren: () => import('./map3d/map3d.module').then(m => m.Map3DModule), canActivateChild: [AuthGuard], canActivate: [FullScreenGuard] },
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    path: 'registerdevice/:deviceToken',
 | 
					    path: 'registerdevice/:deviceToken',
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,7 +2,7 @@
 | 
				
			|||||||
    <div class="row">
 | 
					    <div class="row">
 | 
				
			||||||
        <fm-gradient-select [gradientItems]="gradientItems|async" [showLabel]="false" [showAdd]="true"></fm-gradient-select>
 | 
					        <fm-gradient-select [gradientItems]="gradientItems|async" [showLabel]="false" [showAdd]="true"></fm-gradient-select>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    <div class="row mt-3">
 | 
					    <div class="row mt-3" *fmPackageExists="'vnd.farmmaps.itemtype.package.dacom'">
 | 
				
			||||||
        <button class="btn btn-primary" (click)="onTest($event)">Test</button>
 | 
					        <button class="btn btn-primary" (click)="onTest($event)">Test</button>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
</div>
 | 
					</div>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,9 +1,9 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
    "issuer": "http://localhost:8094",
 | 
					    "issuer": "https://accounts.test.farmmaps.eu",
 | 
				
			||||||
    "clientId": "farmmapsdev",
 | 
					    "clientId": "farmmapsdev",
 | 
				
			||||||
    "audience": "http://localhost:8082",
 | 
					    "audience": "https://test.farmmaps.eu",
 | 
				
			||||||
    "requireHttps": false,
 | 
					    "requireHttps": false,
 | 
				
			||||||
    "apiEndPoint": "http://localhost:8082",
 | 
					    "apiEndPoint": "https://test.farmmaps.eu",
 | 
				
			||||||
    "grantType":"code"
 | 
					    "grantType":"code"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
@@ -18,16 +18,6 @@
 | 
				
			|||||||
 * BROWSER POLYFILLS
 | 
					 * BROWSER POLYFILLS
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
 | 
					 | 
				
			||||||
// import 'classlist.js';  // Run `npm install --save classlist.js`.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/**
 | 
					 | 
				
			||||||
 * Web Animations `@angular/platform-browser/animations`
 | 
					 | 
				
			||||||
 * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
 | 
					 | 
				
			||||||
 * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
 | 
					 | 
				
			||||||
 */
 | 
					 | 
				
			||||||
// import 'web-animations-js';  // Run `npm install --save web-animations-js`.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * By default, zone.js will patch all possible macroTask and DomEvents
 | 
					 * By default, zone.js will patch all possible macroTask and DomEvents
 | 
				
			||||||
 * user can disable parts of macroTask/DomEvents patch by setting following flags
 | 
					 * user can disable parts of macroTask/DomEvents patch by setting following flags
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,7 +12,9 @@ declare const require: any;
 | 
				
			|||||||
// First, initialize the Angular testing environment.
 | 
					// First, initialize the Angular testing environment.
 | 
				
			||||||
getTestBed().initTestEnvironment(
 | 
					getTestBed().initTestEnvironment(
 | 
				
			||||||
  BrowserDynamicTestingModule,
 | 
					  BrowserDynamicTestingModule,
 | 
				
			||||||
  platformBrowserDynamicTesting()
 | 
					  platformBrowserDynamicTesting(), {
 | 
				
			||||||
 | 
					    teardown: { destroyAfterEach: false }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
);
 | 
					);
 | 
				
			||||||
// Then we find all the tests.
 | 
					// Then we find all the tests.
 | 
				
			||||||
const context = require.context('./', true, /\.spec\.ts$/);
 | 
					const context = require.context('./', true, /\.spec\.ts$/);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,7 +13,7 @@
 | 
				
			|||||||
    "allowSyntheticDefaultImports": true,
 | 
					    "allowSyntheticDefaultImports": true,
 | 
				
			||||||
    "importHelpers": true,
 | 
					    "importHelpers": true,
 | 
				
			||||||
    "skipLibCheck": true,
 | 
					    "skipLibCheck": true,
 | 
				
			||||||
    "target": "es2015",
 | 
					    "target": "es2020",
 | 
				
			||||||
    "typeRoots": [
 | 
					    "typeRoots": [
 | 
				
			||||||
      "node_modules/@types"
 | 
					      "node_modules/@types"
 | 
				
			||||||
    ],
 | 
					    ],
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user