30 Commits

Author SHA1 Message Date
3f9b4dcdaa Update README.md
Some checks failed
FarmMaps.Develop/FarmMapsLib/pipeline/head There was a failure building this commit
2024-09-05 12:53:30 +00:00
jenkins
a63159367f [ci skip] Updated packages #2492
Some checks reported errors
FarmMaps.Develop/FarmMapsLib/pipeline/head Something is wrong with the build of this commit
2024-09-05 12:51:03 +00:00
b9d1c8f61f Update README.md
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
2024-09-05 12:47:31 +00:00
jenkins
eb34de193c [ci skip] Updated packages #2491
Some checks reported errors
FarmMaps.Develop/FarmMapsLib/pipeline/head Something is wrong with the build of this commit
2024-09-05 12:31:43 +00:00
5612bb3d66 Merge branch 'feature/AW6241Angular18' into develop
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
2024-09-05 13:44:56 +02:00
0e42efac75 AW6241 Fix deps 2024-09-05 13:44:33 +02:00
3247880b7c AW6241 Migrate deps 2024-09-05 12:50:16 +02:00
a250ecdcc1 AW6241 Migrate libs to latest bootstrap 2024-09-05 11:45:31 +02:00
93e497ec3f AW6241 Migrate libs to ng-18 2024-09-05 11:02:15 +02:00
10a1f07622 AW6241 Migrate main to ng-18 2024-09-05 09:08:43 +02:00
07d6c1bc10 AW6241 ng-18 adopt ng-openlayers 2024-09-05 08:50:27 +02:00
jenkins
1bddc28767 [ci skip] Updated packages #2485
Some checks reported errors
FarmMaps.Develop/FarmMapsLib/pipeline/head Something is wrong with the build of this commit
2024-09-02 12:29:11 +00:00
a999c05631 Aw-6020 Add getItemListCount for paging
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
2024-09-02 14:27:47 +02:00
jenkins
f3252a378d [ci skip] Updated packages #2484
Some checks reported errors
FarmMaps.Develop/FarmMapsLib/pipeline/head Something is wrong with the build of this commit
2024-08-29 07:38:28 +00:00
4ab1e43d40 Aw-6020 Fix getChildItemListCount
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
2024-08-29 09:37:03 +02:00
jenkins
2719f2fcf4 [ci skip] Updated packages #2483
Some checks reported errors
FarmMaps.Develop/FarmMapsLib/pipeline/head Something is wrong with the build of this commit
2024-08-20 08:54:40 +00:00
55914bf7d2 Merge branch 'develop' of https://git.akkerweb.nl/FarmMaps/FarmMapsLib into develop
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
2024-08-20 10:51:30 +02:00
26ca9be4e7 Aw6020 Itemtype = optional 2024-08-20 10:51:21 +02:00
0ed342404e Aw6020 Itemtype = optional 2024-08-20 10:47:33 +02:00
jenkins
26ae1c7f06 [ci skip] Updated packages #2482
Some checks reported errors
FarmMaps.Develop/FarmMapsLib/pipeline/head Something is wrong with the build of this commit
2024-08-20 08:45:26 +00:00
f71d0fe256 Aw6020 Add my_root
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
2024-08-20 10:43:57 +02:00
jenkins
7544203202 [ci skip] Updated packages #2481
Some checks reported errors
FarmMaps.Develop/FarmMapsLib/pipeline/head Something is wrong with the build of this commit
2024-08-20 08:04:03 +00:00
41a30e0b64 Merge branch 'develop' of https://git.akkerweb.nl/FarmMaps/FarmMapsLib into develop
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
2024-08-20 10:02:37 +02:00
f14fc1a4fc Aw6020 Allow retrieving list items with date filter 2024-08-20 10:02:33 +02:00
jenkins
21ebda4753 [ci skip] Updated packages #2480
Some checks reported errors
FarmMaps.Develop/FarmMapsLib/pipeline/head Something is wrong with the build of this commit
2024-06-12 13:30:48 +00:00
3a80a6f7f3 Merge branch 'develop' of https://git.akkerweb.nl/FarmMaps/FarmMapsLib into develop
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
2024-06-12 15:29:24 +02:00
71a2ef44e6 AW-6226 Add admin function to post task on behalve of other user 2024-06-12 15:29:15 +02:00
jenkins
1610391d56 [ci skip] Updated packages #2479
Some checks reported errors
FarmMaps.Develop/FarmMapsLib/pipeline/head Something is wrong with the build of this commit
2024-06-12 10:15:19 +00:00
b778e5726c error TS2307: Cannot find module 'dist/common' or its corresponding type declarations.
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
2024-06-12 12:14:05 +02:00
fc4abf9a5b AW-6226 Add admin function to retrieve all users
Some checks failed
FarmMaps.Develop/FarmMapsLib/pipeline/head There was a failure building this commit
2024-06-12 12:11:36 +02:00
121 changed files with 20716 additions and 8137 deletions

View File

@@ -209,8 +209,8 @@
"options": {
"tsConfig": "projects/common-map/tsconfig.lib.json",
"project": "projects/common-map/ng-package.json"
}
, "configurations": {
},
"configurations": {
"production": {
"tsConfig": "projects/common-map/tsconfig.lib.prod.json"
}
@@ -253,6 +253,43 @@
}
}
}
},
"ng-openlayers": {
"projectType": "library",
"root": "projects/ng-openlayers",
"sourceRoot": "projects/ng-openlayers/src",
"prefix": "ng-openlayers",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"tsConfig": "projects/ng-openlayers/tsconfig.lib.json",
"project": "projects/ng-openlayers/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "projects/ng-openlayers/tsconfig.lib.prod.json"
}
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "projects/ng-openlayers/src/test.ts",
"tsConfig": "projects/ng-openlayers/tsconfig.spec.json",
"karmaConfig": "projects/ng-openlayers/karma.conf.js"
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"projects/ng-openlayers/**/*.ts",
"projects/ng-openlayers/**/*.html"
]
}
}
}
}
},
"cli": {

19099
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "farmmaps-lib-app",
"version": "4.5.0",
"version": "4.10.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
@@ -11,38 +11,38 @@
},
"private": true,
"dependencies": {
"@angular/animations": "^17.3.3",
"@angular/common": "^17.3.3",
"@angular/compiler": "^17.3.3",
"@angular/core": "^17.3.3",
"@angular-eslint/eslint-plugin": "^15.2.1",
"@angular/forms": "^17.3.3",
"@angular/platform-browser": "^17.3.3",
"@angular/platform-browser-dynamic": "^17.3.3",
"@angular/router": "^17.3.3",
"@angular/animations": "^18.2.3",
"@angular/common": "^18.2.3",
"@angular/compiler": "^18.2.3",
"@angular/core": "^18.2.3",
"@angular-eslint/eslint-plugin": "^18.2.0",
"@angular/forms": "^18.2.3",
"@angular/platform-browser": "^18.2.3",
"@angular/platform-browser-dynamic": "^18.2.3",
"@angular/router": "^18.2.3",
"@farmmaps/common": "file:dist/common",
"@farmmaps/common-map": "file:dist/common-map",
"@farmmaps/common-map3d": "file:dist/common-map3d",
"ng-openlayers": "17.1.3",
"ng-openlayers": "file:dist/ng-openlayers",
"@microsoft/signalr": "^3.1.16",
"@ng-bootstrap/ng-bootstrap": "^16.0.0",
"@ngrx/effects": "^17",
"@ngrx/router-store": "^17",
"@ngrx/store": "^17",
"@popperjs/core": "^2.11.6",
"angular-oauth2-oidc": "^13",
"@ng-bootstrap/ng-bootstrap": "^17.0.1",
"@ngrx/effects": "^18.0.2",
"@ngrx/router-store": "^18.0.2",
"@ngrx/store": "^18.0.2",
"@popperjs/core": "^2.11.8",
"angular-oauth2-oidc": "^17.0.2",
"assert": "^2.0.0",
"bootstrap": "^5.2.0",
"bootstrap": "^5.3.3",
"browserify-zlib": "^0.2.0",
"buffer": "^6.0.3",
"cesium": "^1.97.0",
"core-js": "^2.6.12",
"https-browserify": "^1.0.0",
"moment": "^2.29.4",
"ngrx-store-localstorage": "17.0.0",
"ngx-avatars": "1.7.0",
"ngrx-store-localstorage": "18.0.0",
"ngx-avatars": "1.8.0",
"ngx-clipboard": "16.0.0",
"ngx-image-cropper": "^7.2.1",
"ngx-image-cropper": "^7.0.0",
"ngx-uploadx": "^6.2.0",
"ol": "^8.2.0",
"olcs": "^2.13.1",
@@ -54,15 +54,15 @@
"tslib": "^2.4.0",
"url": "^0.11.0",
"util": "^0.12.4",
"zone.js": "~0.14.4"
"zone.js": "~0.14.10"
},
"devDependencies": {
"@angular-builders/custom-webpack": "^17",
"@angular-devkit/build-angular": "^17.3.3",
"@angular/cli": "^17.3.3",
"@angular/compiler-cli": "^17.3.3",
"@angular/language-service": "^17.3.3",
"@angular/localize": "^17.3.3",
"@angular-builders/custom-webpack": "^18",
"@angular-devkit/build-angular": "^18.2.3",
"@angular/cli": "^18.2.3",
"@angular/compiler-cli": "^18.2.3",
"@angular/language-service": "^18.2.3",
"@angular/localize": "^18.2.3",
"@types/arcgis-rest-api": "^10.4.5",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "^2.0.9",
@@ -70,7 +70,7 @@
"@typescript-eslint/eslint-plugin": "^6.18.0",
"@typescript-eslint/eslint-plugin-tslint": "^6.18.0",
"@typescript-eslint/parser": "^6.18.0",
"codelyzer": "^0.0.28",
"codelyzer": "^6.0.2",
"eslint": "^8.35.0",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-import": "^2.27.5",
@@ -81,7 +81,7 @@
"karma-coverage-istanbul-reporter": "^3.0.3",
"karma-jasmine": "^5.1.0",
"karma-jasmine-html-reporter": "^2.0.0",
"ng-packagr": "^17.3.0",
"ng-packagr": "^18.2.1",
"protractor": "~7.0.0",
"ts-node": "^8.8.1",
"typescript": "~5.4.4"

View File

@@ -11,20 +11,212 @@
"tslib": "^2.0.0"
},
"peerDependencies": {
"@angular/core": "^17.3.3",
"@ngrx/effects": "^17",
"@ngrx/router-store": "^17",
"@ngrx/store": "^17",
"ng-openlayers": "17.1.3",
"ngrx-store-localstorage": "^17",
"ol": "^8.2.0",
"@angular/core": "^18.2.3",
"@ngrx/effects": "^18",
"@ngrx/router-store": "^18",
"@ngrx/store": "^18",
"ng-openlayers": "file:dist/ng-openlayers",
"ngrx-store-localstorage": "^18",
"tassign": "^1.0.0"
}
},
"../../dist/libs/ng-openlayers": {
"version": "18.0.0",
"extraneous": true,
"license": "MPL-2.0",
"dependencies": {
"tslib": "^2.3.0"
},
"peerDependencies": {
"@angular/common": "^18.2.3",
"@angular/core": "^18.2.3",
"ol": "^8.2.0"
}
},
"dist/ng-openlayers": {
"peer": true
},
"node_modules/@angular/common": {
"version": "18.2.3",
"resolved": "https://registry.npmjs.org/@angular/common/-/common-18.2.3.tgz",
"integrity": "sha512-NFL4yXXImSCH7i1xnHykUjHa9vl9827fGiwSV2mnf7LjSUsyDzFD8/54dNuYN9OY8AUD+PnK0YdNro6cczVyIA==",
"peer": true,
"dependencies": {
"tslib": "^2.3.0"
},
"engines": {
"node": "^18.19.1 || ^20.11.1 || >=22.0.0"
},
"peerDependencies": {
"@angular/core": "18.2.3",
"rxjs": "^6.5.3 || ^7.4.0"
}
},
"node_modules/@angular/core": {
"version": "18.2.3",
"resolved": "https://registry.npmjs.org/@angular/core/-/core-18.2.3.tgz",
"integrity": "sha512-VGhMJxj7d0rYpqVfQrcGRB7EE/BCziotft/I/YPl6bOMPSAvMukG7DXQuJdYpNrr62ks78mlzHlZX/cdmB9Prw==",
"peer": true,
"dependencies": {
"tslib": "^2.3.0"
},
"engines": {
"node": "^18.19.1 || ^20.11.1 || >=22.0.0"
},
"peerDependencies": {
"rxjs": "^6.5.3 || ^7.4.0",
"zone.js": "~0.14.10"
}
},
"node_modules/@angular/platform-browser": {
"version": "18.2.3",
"resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-18.2.3.tgz",
"integrity": "sha512-M2ob4zN7tAcL2mx7U6KnZNqNFPFl9MlPBE0FrjQjIzAjU0wSYPIJXmaPu9aMUp9niyo+He5iX98I+URi2Yc99g==",
"peer": true,
"dependencies": {
"tslib": "^2.3.0"
},
"engines": {
"node": "^18.19.1 || ^20.11.1 || >=22.0.0"
},
"peerDependencies": {
"@angular/animations": "18.2.3",
"@angular/common": "18.2.3",
"@angular/core": "18.2.3"
},
"peerDependenciesMeta": {
"@angular/animations": {
"optional": true
}
}
},
"node_modules/@angular/router": {
"version": "18.2.3",
"resolved": "https://registry.npmjs.org/@angular/router/-/router-18.2.3.tgz",
"integrity": "sha512-fvD9eSDIiIbeYoUokoWkXzu7/ZaxlzKPUHFqX1JuKuH5ciQDeT/d7lp4mj31Bxammhohzi3+z12THJYsCkj/iQ==",
"peer": true,
"dependencies": {
"tslib": "^2.3.0"
},
"engines": {
"node": "^18.19.1 || ^20.11.1 || >=22.0.0"
},
"peerDependencies": {
"@angular/common": "18.2.3",
"@angular/core": "18.2.3",
"@angular/platform-browser": "18.2.3",
"rxjs": "^6.5.3 || ^7.4.0"
}
},
"node_modules/@ngrx/effects": {
"version": "18.0.2",
"resolved": "https://registry.npmjs.org/@ngrx/effects/-/effects-18.0.2.tgz",
"integrity": "sha512-YojXcOD9Lsq4kl2HCjENccyUM/mOlgBdtddsg9j/ojzSUgu3ZuBVKLN3atrL2TJYkbMX1MN0RzafSkL3TPGFIA==",
"peer": true,
"dependencies": {
"@ngrx/operators": "18.0.1",
"tslib": "^2.0.0"
},
"peerDependencies": {
"@angular/core": "^18.0.0",
"@ngrx/store": "18.0.2",
"rxjs": "^6.5.3 || ^7.5.0"
}
},
"node_modules/@ngrx/operators": {
"version": "18.0.1",
"resolved": "https://registry.npmjs.org/@ngrx/operators/-/operators-18.0.1.tgz",
"integrity": "sha512-M+QMrHNKgcuiLaRGZxJ4aQi5/OCRfKC4+T/63dsHyLFZ53/FFpF6a/ytSO1Q+tzOplZ5o99S+i8FVaZqNQ3LmQ==",
"peer": true,
"dependencies": {
"tslib": "^2.3.0"
},
"peerDependencies": {
"rxjs": "^6.5.3 || ^7.4.0"
}
},
"node_modules/@ngrx/router-store": {
"version": "18.0.2",
"resolved": "https://registry.npmjs.org/@ngrx/router-store/-/router-store-18.0.2.tgz",
"integrity": "sha512-jUrQ/uJJ53x8O1XbN2YxH2GpRREZlwS5gRxlCoc4fWL4Us/uS1/K6+QfRmKBPtpTKBIixqsOb+dIUV5iwBrivA==",
"peer": true,
"dependencies": {
"tslib": "^2.0.0"
},
"peerDependencies": {
"@angular/common": "^18.0.0",
"@angular/core": "^18.0.0",
"@angular/router": "^18.0.0",
"@ngrx/store": "18.0.2",
"rxjs": "^6.5.3 || ^7.5.0"
}
},
"node_modules/@ngrx/store": {
"version": "18.0.2",
"resolved": "https://registry.npmjs.org/@ngrx/store/-/store-18.0.2.tgz",
"integrity": "sha512-ajwv0+njsO4vzArp9esnFvs1wyUb1U1W8E8LSCKrcW2hWWo9o1Pezj+JRsdQwatxHfrrPFuTDyajsl6GQM/JSA==",
"peer": true,
"dependencies": {
"tslib": "^2.0.0"
},
"peerDependencies": {
"@angular/core": "^18.0.0",
"rxjs": "^6.5.3 || ^7.5.0"
}
},
"node_modules/deepmerge": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz",
"integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==",
"peer": true,
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/ng-openlayers": {
"resolved": "dist/ng-openlayers",
"link": true
},
"node_modules/ngrx-store-localstorage": {
"version": "18.0.0",
"resolved": "https://registry.npmjs.org/ngrx-store-localstorage/-/ngrx-store-localstorage-18.0.0.tgz",
"integrity": "sha512-WoDePvMWiWF9LQHe+dTqbpm8lxoKCPoIvA0/1enIPTmdLQsOpdDKhMSD5YgwuqDusNfEik3QslProTFGyXZwtw==",
"peer": true,
"dependencies": {
"deepmerge": "^4.2.2",
"tslib": "^2.3.0"
},
"peerDependencies": {
"@angular/common": "^18.0.1",
"@angular/core": "^18.0.1",
"@ngrx/store": "^18.0.0"
}
},
"node_modules/rxjs": {
"version": "7.8.1",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz",
"integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==",
"peer": true,
"dependencies": {
"tslib": "^2.1.0"
}
},
"node_modules/tassign": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/tassign/-/tassign-1.0.0.tgz",
"integrity": "sha512-k0Ti9f+A1R0BRdArEbiUHldd+A40kZ5qsiNSNk4czx61wkAoSZYjqkaQs0jC63AfgPdCXVPstDq2ZW5ZLRTCgw==",
"peer": true
},
"node_modules/tslib": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.1.tgz",
"integrity": "sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ=="
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz",
"integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA=="
},
"node_modules/zone.js": {
"version": "0.14.10",
"resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.14.10.tgz",
"integrity": "sha512-YGAhaO7J5ywOXW6InXNlLmfU194F8lVgu7bRntUF3TiG8Y3nBK0x1UJJuHUP/e8IyihkjCYqhCScpSwnlaSRkQ==",
"peer": true
}
}
}

View File

@@ -8,13 +8,12 @@
"tslib": "^2.0.0"
},
"peerDependencies": {
"@angular/core": "^17.3.3",
"ngrx-store-localstorage": "^17",
"@ngrx/effects": "^17",
"@ngrx/router-store": "^17",
"@ngrx/store": "^17",
"@angular/core": "^18.2.3",
"ngrx-store-localstorage": "^18",
"@ngrx/effects": "^18.0.2",
"@ngrx/router-store": "^18.0.2",
"@ngrx/store": "^18.0.2",
"tassign": "^1.0.0",
"ng-openlayers": "17.1.3",
"ol": "^8.2.0"
"ng-openlayers": "file:dist/ng-openlayers"
}
}

View File

@@ -1,78 +1,78 @@
import { NgModule ,ModuleWithProviders} from '@angular/core';
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
//external modules
import { AngularOpenlayersModule } from 'ng-openlayers';
import { StoreModule, ActionReducer, MetaReducer } from '@ngrx/store';
import { EffectsModule } from '@ngrx/effects';
import { NgbModule } from "@ng-bootstrap/ng-bootstrap";
import { EffectsModule } from '@ngrx/effects';
import { ActionReducer, MetaReducer, StoreModule } from '@ngrx/store';
import { AngularOpenlayersModule } from 'ng-openlayers';
//common modules
import { AppCommonModule } from '@farmmaps/common';
import { MODULE_NAME } from './module-name';
import * as mapReducers from './reducers/map.reducer';
import * as mapActions from './actions/map.actions';
import * as mapEffects from './effects/map.effects';
import { MODULE_NAME } from './module-name';
import * as mapReducers from './reducers/map.reducer';
import { IMapState} from './models/map.state';
import { ISelectedFeatures } from './models/selected.features';
import { IItemLayer,ItemLayer,ITemporalItemLayer,TemporalItemLayer } from './models/item.layer';
import { IClickedFeature } from './models/clicked.feature';
import { IItemLayer, ItemLayer, ITemporalItemLayer, TemporalItemLayer } from './models/item.layer';
import { IMapState } from './models/map.state';
import { IPeriodState } from './models/period.state';
import { ISelectedFeatures } from './models/selected.features';
// components
import { MapRoutingModule } from './common-map-routing.module';
import { FileDropTargetComponent } from './components/aol/file-drop-target/file-drop-target.component';
import { GpsLocation } from './components/aol/gps-location/gps-location.component';
import { ItemLayersComponent } from './components/aol/item-layers/item-layers.component';
import { ItemVectorSourceComponent } from './components/aol/item-vector-source/item-vector-source.component';
import { LayerListComponent } from './components/aol/layer-list/layer-list.component';
import { LayerValuesComponent } from './components/aol/layer-values/layer-values.component';
import { LayerVectorImageComponent } from './components/aol/layer-vector-image/layer-vector-image.component';
import { PanToLocation } from './components/aol/pan-to-location/pan-to-location.component';
import { RotationResetComponent } from './components/aol/rotation-reset/rotation-reset.component';
import { ZoomToExtentComponent } from './components/aol/zoom-to-extent/zoom-to-extent.component';
import { FeatureListContainerComponent } from './components/feature-list-container/feature-list-container.component';
import { FeatureListCropfieldComponent } from './components/feature-list-cropfield/feature-list-cropfield.component';
import { FeatureListCroppingschemeComponent } from './components/feature-list-croppingscheme/feature-list-croppingscheme.component';
import { FeatureListFeatureContainerComponent } from './components/feature-list-feature-container/feature-list-feature-container.component';
import { FeatureListFeatureCropfieldComponent } from './components/feature-list-feature-cropfield/feature-list-feature-cropfield.component';
import { FeatureListFeatureCroppingschemeComponent } from './components/feature-list-feature-croppingscheme/feature-list-feature-croppingscheme.component';
import { ItemWidgetListComponent} from './components/item-widget-list/item-widget-list.component';
import { AbstractItemListItemComponent, ItemListItemComponent, AbstractItemWidgetComponent } from './components/item-list-item/item-list-item.component';
import { ItemListItemContainerComponent } from './components/item-list-item-container/item-list-item-container.component';
import { AbstractItemListComponent,ItemListComponent} from './components/item-list/item-list.component';
import { AbstractSelectedItemComponent, SelectedItemComponent } from './components/selected-item/selected-item.component';
import { SelectedItemCropfieldComponent } from './components/selected-item-cropfield/selected-item-cropfield.component';
import { SelectedItemGeotiffComponent } from './components/selected-item-geotiff/selected-item-geotiff.component';
import { SelectedItemTemporalComponent} from './components/selected-item-temporal/selected-item-temporal.component';
import {SelectedItemShapeComponent } from './components/selected-item-shape/selected-item-shape.component';
import { SelectedItemContainerComponent } from './components/selected-item-container/selected-item-container.component';
import { AbstractFeatureListFeatureComponent, FeatureListFeatureComponent } from './components/feature-list-feature/feature-list-feature.component';
import {FeatureListFeatureContainerComponent } from './components/feature-list-feature-container/feature-list-feature-container.component';
import { FeatureListCroppingschemeComponent } from './components/feature-list-croppingscheme/feature-list-croppingscheme.component';
import {FeatureListCropfieldComponent } from './components/feature-list-cropfield/feature-list-cropfield.component';
import {FeatureListContainerComponent } from './components/feature-list-container/feature-list-container.component';
import { WidgetHostDirective} from './components/widget-host/widget-host.directive';
import { FeatureListComponent,AbstractFeatureListComponent} from './components/feature-list/feature-list.component';
import { FileDropTargetComponent } from './components/aol/file-drop-target/file-drop-target.component';
import { ItemVectorSourceComponent } from './components/aol/item-vector-source/item-vector-source.component';
import { ItemLayersComponent } from './components/aol/item-layers/item-layers.component';
import { ZoomToExtentComponent } from './components/aol/zoom-to-extent/zoom-to-extent.component';
import { RotationResetComponent } from './components/aol/rotation-reset/rotation-reset.component';
import { LayerListComponent } from './components/aol/layer-list/layer-list.component';
import { MetaDataModalComponent } from './components/meta-data-modal/meta-data-modal.component';
import { SelectPeriodModalComponent } from './components/select-period-modal/select-period-modal.component';
import { MapComponent } from './components/map/map.component';
import { MapSearchComponent } from './components/map-search/map-search.component';
import { MapRoutingModule } from './common-map-routing.module';
import { LegendComponent } from './components/legend/legend.component';
import { LayerVectorImageComponent } from './components/aol/layer-vector-image/layer-vector-image.component';
import {FeatureIconService} from './services/feature-icon.service';
import { GeolocationService } from './services/geolocation.service';
import {DeviceOrientationService} from './services/device-orientation.service';
import { TemporalService} from './services/temporal.service';
import { WidgetStatusComponent } from './components/widget-status/widget-status.component';
import { AbstractFeatureListComponent, FeatureListComponent } from './components/feature-list/feature-list.component';
import { GeometryThumbnailComponent } from './components/feature-thumbnail/feature-thumbnail.component';
import { ForChild } from './components/for-item/for-child.decorator';
import { ForItemType } from './components/for-item/for-itemtype.decorator';
import { ForSourceTask} from './components/for-item/for-sourcetask.decorator';
import { ForPackage } from './components/for-item/for-package.decorator';
import { PanToLocation} from './components/aol/pan-to-location/pan-to-location.component';
import { ForSourceTask } from './components/for-item/for-sourcetask.decorator';
import { ifZoomToShowDirective } from './components/if-zoom-to-show/if-zoom-to-show.directive';
import { ItemListItemContainerComponent } from './components/item-list-item-container/item-list-item-container.component';
import { AbstractItemListItemComponent, AbstractItemWidgetComponent, ItemListItemComponent } from './components/item-list-item/item-list-item.component';
import { AbstractItemListComponent, ItemListComponent } from './components/item-list/item-list.component';
import { ItemWidgetListComponent } from './components/item-widget-list/item-widget-list.component';
import { LayerSwitcher } from './components/layer-switcher/layer-switcher.component';
import { HistogramDetailsComponent } from './components/legend/histogram-details/histogram-details.component';
import { LegendComponent } from './components/legend/legend.component';
import { StatisticsDetailsComponent } from './components/legend/statistics-details/statistics-details.component';
import { ifZoomToShowDirective} from './components/if-zoom-to-show/if-zoom-to-show.directive';
import { MapSearchComponent } from './components/map-search/map-search.component';
import { MapComponent } from './components/map/map.component';
import { MetaDataModalComponent } from './components/meta-data-modal/meta-data-modal.component';
import { SelectPeriodModalComponent } from './components/select-period-modal/select-period-modal.component';
import { SelectedItemContainerComponent } from './components/selected-item-container/selected-item-container.component';
import { SelectedItemCropfieldComponent } from './components/selected-item-cropfield/selected-item-cropfield.component';
import { SelectedItemGeotiffComponent } from './components/selected-item-geotiff/selected-item-geotiff.component';
import { SelectedItemShapeComponent } from './components/selected-item-shape/selected-item-shape.component';
import { SelectedItemTemporalComponent } from './components/selected-item-temporal/selected-item-temporal.component';
import { AbstractSelectedItemComponent, SelectedItemComponent } from './components/selected-item/selected-item.component';
import { WidgetHostDirective } from './components/widget-host/widget-host.directive';
import { WidgetStatusComponent } from './components/widget-status/widget-status.component';
import { ZoomToShowAlert } from './components/zoom-to-show-alert/zoom-to-show-alert.component';
import { LayerValuesComponent } from './components/aol/layer-values/layer-values.component';
import { GeometryThumbnailComponent } from './components/feature-thumbnail/feature-thumbnail.component';
import { DeviceOrientationService } from './services/device-orientation.service';
import { FeatureIconService } from './services/feature-icon.service';
import { GeolocationService } from './services/geolocation.service';
import { TemporalService } from './services/temporal.service';
export function LocalStorageSync(reducer: ActionReducer<any>): ActionReducer<any> {
const r = function(state, action) {
@@ -104,70 +104,13 @@ export function LocalStorageSync(reducer: ActionReducer<any>): ActionReducer<any
const metaReducers: Array<MetaReducer<any, any>> = [LocalStorageSync];
export {
mapEffects,
mapReducers,
mapActions,
ZoomToExtentComponent,
ItemVectorSourceComponent,
ItemLayersComponent,
FileDropTargetComponent,
MapComponent,
MetaDataModalComponent,
RotationResetComponent,
MapSearchComponent,
SelectPeriodModalComponent,
LayerListComponent,
LegendComponent,
LayerVectorImageComponent,
FeatureListComponent,
WidgetHostDirective,
FeatureListContainerComponent,
FeatureListCroppingschemeComponent,
FeatureListCropfieldComponent,
FeatureListFeatureContainerComponent,
FeatureListFeatureComponent,
FeatureListFeatureCroppingschemeComponent,
FeatureListFeatureCropfieldComponent,
SelectedItemContainerComponent,
SelectedItemComponent,
SelectedItemCropfieldComponent,
SelectedItemGeotiffComponent,
SelectedItemTemporalComponent,
SelectedItemShapeComponent,
ItemListItemComponent,
ItemListItemContainerComponent,
ItemListComponent,
ItemWidgetListComponent,
WidgetStatusComponent,
GpsLocation,
PanToLocation,
LayerSwitcher,
AbstractFeatureListComponent,
AbstractFeatureListFeatureComponent,
AbstractSelectedItemComponent,
AbstractItemWidgetComponent,
AbstractItemListItemComponent,
AbstractItemListComponent,
FeatureIconService,
GeolocationService,
DeviceOrientationService,
TemporalService,
IMapState,
ISelectedFeatures,
IItemLayer,
ItemLayer,
IPeriodState,
ForChild,
ForItemType,
ForSourceTask,
ForPackage ,
ITemporalItemLayer,
TemporalItemLayer,
ifZoomToShowDirective,
ZoomToShowAlert,
IClickedFeature,
GeometryThumbnailComponent
}
AbstractFeatureListFeatureComponent, AbstractItemListComponent, AbstractItemListItemComponent, AbstractItemWidgetComponent, AbstractSelectedItemComponent, DeviceOrientationService, FeatureIconService, FeatureListComponent, FeatureListContainerComponent, FeatureListCropfieldComponent, FeatureListCroppingschemeComponent, FeatureListFeatureComponent, FeatureListFeatureContainerComponent, FeatureListFeatureCropfieldComponent, FeatureListFeatureCroppingschemeComponent, FileDropTargetComponent, ForChild,
ForItemType, ForPackage, ForSourceTask, GeolocationService, GeometryThumbnailComponent, GpsLocation, IClickedFeature, ifZoomToShowDirective, IItemLayer, IMapState, IPeriodState, ISelectedFeatures, ItemLayer, ItemLayersComponent, ItemListComponent, ItemListItemComponent,
ItemListItemContainerComponent, ITemporalItemLayer, ItemVectorSourceComponent, ItemWidgetListComponent, LayerListComponent, LayerSwitcher, LayerVectorImageComponent, LegendComponent, mapActions, MapComponent, mapEffects,
mapReducers, MapSearchComponent, MetaDataModalComponent, PanToLocation, RotationResetComponent, SelectedItemComponent, SelectedItemContainerComponent, SelectedItemCropfieldComponent,
SelectedItemGeotiffComponent, SelectedItemShapeComponent, SelectedItemTemporalComponent, SelectPeriodModalComponent, TemporalItemLayer, TemporalService, WidgetHostDirective, WidgetStatusComponent, ZoomToExtentComponent, ZoomToShowAlert
};
@NgModule({
imports: [

View File

@@ -11,17 +11,560 @@
"tslib": "^2.0.0"
},
"peerDependencies": {
"@angular/common": "^17.3.3",
"@angular/core": "^17.3.3",
"@angular/common": "^18.2.3",
"@angular/core": "^18.2.3",
"cesium": ">=1.82.1",
"ng-openlayers": "17.1.3",
"ng-openlayers": "file:dist/ng-openlayers",
"ol-cesium": ">=2.13.0"
}
},
"../../dist/libs/ng-openlayers": {
"version": "18.0.0",
"extraneous": true,
"license": "MPL-2.0",
"dependencies": {
"tslib": "^2.3.0"
},
"peerDependencies": {
"@angular/common": "^18.2.3",
"@angular/core": "^18.2.3",
"ol": "^8.2.0"
}
},
"dist/ng-openlayers": {
"peer": true
},
"node_modules/@angular/common": {
"version": "18.2.3",
"resolved": "https://registry.npmjs.org/@angular/common/-/common-18.2.3.tgz",
"integrity": "sha512-NFL4yXXImSCH7i1xnHykUjHa9vl9827fGiwSV2mnf7LjSUsyDzFD8/54dNuYN9OY8AUD+PnK0YdNro6cczVyIA==",
"peer": true,
"dependencies": {
"tslib": "^2.3.0"
},
"engines": {
"node": "^18.19.1 || ^20.11.1 || >=22.0.0"
},
"peerDependencies": {
"@angular/core": "18.2.3",
"rxjs": "^6.5.3 || ^7.4.0"
}
},
"node_modules/@angular/core": {
"version": "18.2.3",
"resolved": "https://registry.npmjs.org/@angular/core/-/core-18.2.3.tgz",
"integrity": "sha512-VGhMJxj7d0rYpqVfQrcGRB7EE/BCziotft/I/YPl6bOMPSAvMukG7DXQuJdYpNrr62ks78mlzHlZX/cdmB9Prw==",
"peer": true,
"dependencies": {
"tslib": "^2.3.0"
},
"engines": {
"node": "^18.19.1 || ^20.11.1 || >=22.0.0"
},
"peerDependencies": {
"rxjs": "^6.5.3 || ^7.4.0",
"zone.js": "~0.14.10"
}
},
"node_modules/@cesium/engine": {
"version": "11.0.0",
"resolved": "https://registry.npmjs.org/@cesium/engine/-/engine-11.0.0.tgz",
"integrity": "sha512-0z3mJNNly407h3/bAvGoGnjA0ygprkVz32z9x1VNmPXf9AuybKu7Q4wRrChUhC/qsNj3L45kP6KqyDuHSe2bhw==",
"peer": true,
"dependencies": {
"@tweenjs/tween.js": "^25.0.0",
"@zip.js/zip.js": "^2.7.34",
"autolinker": "^4.0.0",
"bitmap-sdf": "^1.0.3",
"dompurify": "^3.0.2",
"draco3d": "^1.5.1",
"earcut": "^3.0.0",
"grapheme-splitter": "^1.0.4",
"jsep": "^1.3.8",
"kdbush": "^4.0.1",
"ktx-parse": "^0.7.0",
"lerc": "^2.0.0",
"mersenne-twister": "^1.1.0",
"meshoptimizer": "^0.21.0",
"pako": "^2.0.4",
"protobufjs": "^7.1.0",
"rbush": "^4.0.0",
"topojson-client": "^3.1.0",
"urijs": "^1.19.7"
},
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/@cesium/widgets": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/@cesium/widgets/-/widgets-8.0.0.tgz",
"integrity": "sha512-Rnid5BbLBZjwFdbr3lgOwK3fhql/BeEbf5l9ZZE+Zc7V8Fb6wgKM8QmrL+bbJ+BtuiELp+SkNxcF97Ktifxb4g==",
"peer": true,
"dependencies": {
"@cesium/engine": "^11.0.0",
"nosleep.js": "^0.12.0"
},
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/@petamoriken/float16": {
"version": "3.8.7",
"resolved": "https://registry.npmjs.org/@petamoriken/float16/-/float16-3.8.7.tgz",
"integrity": "sha512-/Ri4xDDpe12NT6Ex/DRgHzLlobiQXEW/hmG08w1wj/YU7hLemk97c+zHQFp0iZQ9r7YqgLEXZR2sls4HxBf9NA==",
"peer": true
},
"node_modules/@protobufjs/aspromise": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz",
"integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==",
"peer": true
},
"node_modules/@protobufjs/base64": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz",
"integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==",
"peer": true
},
"node_modules/@protobufjs/codegen": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz",
"integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==",
"peer": true
},
"node_modules/@protobufjs/eventemitter": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz",
"integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==",
"peer": true
},
"node_modules/@protobufjs/fetch": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz",
"integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==",
"peer": true,
"dependencies": {
"@protobufjs/aspromise": "^1.1.1",
"@protobufjs/inquire": "^1.1.0"
}
},
"node_modules/@protobufjs/float": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz",
"integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==",
"peer": true
},
"node_modules/@protobufjs/inquire": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz",
"integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==",
"peer": true
},
"node_modules/@protobufjs/path": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz",
"integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==",
"peer": true
},
"node_modules/@protobufjs/pool": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz",
"integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==",
"peer": true
},
"node_modules/@protobufjs/utf8": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz",
"integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==",
"peer": true
},
"node_modules/@tweenjs/tween.js": {
"version": "25.0.0",
"resolved": "https://registry.npmjs.org/@tweenjs/tween.js/-/tween.js-25.0.0.tgz",
"integrity": "sha512-XKLA6syeBUaPzx4j3qwMqzzq+V4uo72BnlbOjmuljLrRqdsd3qnzvZZoxvMHZ23ndsRS4aufU6JOZYpCbU6T1A==",
"peer": true
},
"node_modules/@types/node": {
"version": "22.5.4",
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.4.tgz",
"integrity": "sha512-FDuKUJQm/ju9fT/SeX/6+gBzoPzlVCzfzmGkwKvRHQVxi4BntVbyIwf6a4Xn62mrvndLiml6z/UBXIdEVjQLXg==",
"peer": true,
"dependencies": {
"undici-types": "~6.19.2"
}
},
"node_modules/@types/rbush": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/@types/rbush/-/rbush-3.0.4.tgz",
"integrity": "sha512-knSt9cCW8jj1ZSFcFeBZaX++OucmfPxxHiRwTahZfJlnQsek7O0bazTJHWD2RVj9LEoejUYF2de3/stf+QXcXw==",
"peer": true
},
"node_modules/@zip.js/zip.js": {
"version": "2.7.52",
"resolved": "https://registry.npmjs.org/@zip.js/zip.js/-/zip.js-2.7.52.tgz",
"integrity": "sha512-+5g7FQswvrCHwYKNMd/KFxZSObctLSsQOgqBSi0LzwHo3li9Eh1w5cF5ndjQw9Zbr3ajVnd2+XyiX85gAetx1Q==",
"peer": true,
"engines": {
"bun": ">=0.7.0",
"deno": ">=1.0.0",
"node": ">=16.5.0"
}
},
"node_modules/autolinker": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/autolinker/-/autolinker-4.0.0.tgz",
"integrity": "sha512-fl5Kh6BmEEZx+IWBfEirnRUU5+cOiV0OK7PEt0RBKvJMJ8GaRseIOeDU3FKf4j3CE5HVefcjHmhYPOcaVt0bZw==",
"peer": true,
"dependencies": {
"tslib": "^2.3.0"
}
},
"node_modules/bitmap-sdf": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/bitmap-sdf/-/bitmap-sdf-1.0.4.tgz",
"integrity": "sha512-1G3U4n5JE6RAiALMxu0p1XmeZkTeCwGKykzsLTCqVzfSDaN6S7fKnkIkfejogz+iwqBWc0UYAIKnKHNN7pSfDg==",
"peer": true
},
"node_modules/cesium": {
"version": "1.121.1",
"resolved": "https://registry.npmjs.org/cesium/-/cesium-1.121.1.tgz",
"integrity": "sha512-WpdaGFd8qCOHiE9khV0sWWjCMXAX1U9Aou8MzMC/F0Akp6YqcOk4HLk4LLhZKeOjO/Bh27iTIW2mxEZ5+dtCxg==",
"peer": true,
"dependencies": {
"@cesium/engine": "^11.0.0",
"@cesium/widgets": "^8.0.0"
},
"engines": {
"node": ">=18.18.0"
}
},
"node_modules/color-name": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-2.0.0.tgz",
"integrity": "sha512-SbtvAMWvASO5TE2QP07jHBMXKafgdZz8Vrsrn96fiL+O92/FN/PLARzUW5sKt013fjAprK2d2iCn2hk2Xb5oow==",
"peer": true,
"engines": {
"node": ">=12.20"
}
},
"node_modules/color-parse": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/color-parse/-/color-parse-2.0.2.tgz",
"integrity": "sha512-eCtOz5w5ttWIUcaKLiktF+DxZO1R9KLNY/xhbV6CkhM7sR3GhVghmt6X6yOnzeaM24po+Z9/S1apbXMwA3Iepw==",
"peer": true,
"dependencies": {
"color-name": "^2.0.0"
}
},
"node_modules/color-rgba": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/color-rgba/-/color-rgba-3.0.0.tgz",
"integrity": "sha512-PPwZYkEY3M2THEHHV6Y95sGUie77S7X8v+h1r6LSAPF3/LL2xJ8duUXSrkic31Nzc4odPwHgUbiX/XuTYzQHQg==",
"peer": true,
"dependencies": {
"color-parse": "^2.0.0",
"color-space": "^2.0.0"
}
},
"node_modules/color-space": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-space/-/color-space-2.0.1.tgz",
"integrity": "sha512-nKqUYlo0vZATVOFHY810BSYjmCARrG7e5R3UE3CQlyjJTvv5kSSmPG1kzm/oDyyqjehM+lW1RnEt9It9GNa5JA==",
"peer": true
},
"node_modules/commander": {
"version": "2.20.3",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
"peer": true
},
"node_modules/dompurify": {
"version": "3.1.6",
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.1.6.tgz",
"integrity": "sha512-cTOAhc36AalkjtBpfG6O8JimdTMWNXjiePT2xQH/ppBGi/4uIpmj8eKyIkMJErXWARyINV/sB38yf8JCLF5pbQ==",
"peer": true
},
"node_modules/draco3d": {
"version": "1.5.7",
"resolved": "https://registry.npmjs.org/draco3d/-/draco3d-1.5.7.tgz",
"integrity": "sha512-m6WCKt/erDXcw+70IJXnG7M3awwQPAsZvJGX5zY7beBqpELw6RDGkYVU0W43AFxye4pDZ5i2Lbyc/NNGqwjUVQ==",
"peer": true
},
"node_modules/earcut": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/earcut/-/earcut-3.0.0.tgz",
"integrity": "sha512-41Fs7Q/PLq1SDbqjsgcY7GA42T0jvaCNGXgGtsNdvg+Yv8eIu06bxv4/PoREkZ9nMDNwnUSG9OFB9+yv8eKhDg==",
"peer": true
},
"node_modules/geotiff": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/geotiff/-/geotiff-2.1.3.tgz",
"integrity": "sha512-PT6uoF5a1+kbC3tHmZSUsLHBp2QJlHasxxxxPW47QIY1VBKpFB+FcDvX+MxER6UzgLQZ0xDzJ9s48B9JbOCTqA==",
"peer": true,
"dependencies": {
"@petamoriken/float16": "^3.4.7",
"lerc": "^3.0.0",
"pako": "^2.0.4",
"parse-headers": "^2.0.2",
"quick-lru": "^6.1.1",
"web-worker": "^1.2.0",
"xml-utils": "^1.0.2",
"zstddec": "^0.1.0"
},
"engines": {
"node": ">=10.19"
}
},
"node_modules/geotiff/node_modules/lerc": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/lerc/-/lerc-3.0.0.tgz",
"integrity": "sha512-Rm4J/WaHhRa93nCN2mwWDZFoRVF18G1f47C+kvQWyHGEZxFpTUi73p7lMVSAndyxGt6lJ2/CFbOcf9ra5p8aww==",
"peer": true
},
"node_modules/grapheme-splitter": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz",
"integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==",
"peer": true
},
"node_modules/jsep": {
"version": "1.3.9",
"resolved": "https://registry.npmjs.org/jsep/-/jsep-1.3.9.tgz",
"integrity": "sha512-i1rBX5N7VPl0eYb6+mHNp52sEuaS2Wi8CDYx1X5sn9naevL78+265XJqy1qENEk7mRKwS06NHpUqiBwR7qeodw==",
"peer": true,
"engines": {
"node": ">= 10.16.0"
}
},
"node_modules/kdbush": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/kdbush/-/kdbush-4.0.2.tgz",
"integrity": "sha512-WbCVYJ27Sz8zi9Q7Q0xHC+05iwkm3Znipc2XTlrnJbsHMYktW4hPhXUE8Ys1engBrvffoSCqbil1JQAa7clRpA==",
"peer": true
},
"node_modules/ktx-parse": {
"version": "0.7.1",
"resolved": "https://registry.npmjs.org/ktx-parse/-/ktx-parse-0.7.1.tgz",
"integrity": "sha512-FeA3g56ksdFNwjXJJsc1CCc7co+AJYDp6ipIp878zZ2bU8kWROatLYf39TQEd4/XRSUvBXovQ8gaVKWPXsCLEQ==",
"peer": true
},
"node_modules/lerc": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/lerc/-/lerc-2.0.0.tgz",
"integrity": "sha512-7qo1Mq8ZNmaR4USHHm615nEW2lPeeWJ3bTyoqFbd35DLx0LUH7C6ptt5FDCTAlbIzs3+WKrk5SkJvw8AFDE2hg==",
"peer": true
},
"node_modules/long": {
"version": "5.2.3",
"resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz",
"integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==",
"peer": true
},
"node_modules/mersenne-twister": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/mersenne-twister/-/mersenne-twister-1.1.0.tgz",
"integrity": "sha512-mUYWsMKNrm4lfygPkL3OfGzOPTR2DBlTkBNHM//F6hGp8cLThY897crAlk3/Jo17LEOOjQUrNAx6DvgO77QJkA==",
"peer": true
},
"node_modules/meshoptimizer": {
"version": "0.21.0",
"resolved": "https://registry.npmjs.org/meshoptimizer/-/meshoptimizer-0.21.0.tgz",
"integrity": "sha512-WabtlpnK/GgD0GMwYd1fBTfYHf4MIcQPEg6dt7y4GuDcY51RzLSkSNE8ZogD7U3Vs2/fIf4z89TOLpA80EOnhg==",
"peer": true
},
"node_modules/ng-openlayers": {
"resolved": "dist/ng-openlayers",
"link": true
},
"node_modules/nosleep.js": {
"version": "0.12.0",
"resolved": "https://registry.npmjs.org/nosleep.js/-/nosleep.js-0.12.0.tgz",
"integrity": "sha512-9d1HbpKLh3sdWlhXMhU6MMH+wQzKkrgfRkYV0EBdvt99YJfj0ilCJrWRDYG2130Tm4GXbEoTCx5b34JSaP+HhA==",
"peer": true
},
"node_modules/ol": {
"version": "10.1.0",
"resolved": "https://registry.npmjs.org/ol/-/ol-10.1.0.tgz",
"integrity": "sha512-/efepydpzhFoeczA9KAN5t7G0WpFhP46ZXEfSl6JbZ7ipQZ2axpkYB2qt0qcOUlPFYMt7/XQFApH652KB08tTg==",
"peer": true,
"dependencies": {
"@types/rbush": "^3.0.3",
"color-rgba": "^3.0.0",
"color-space": "^2.0.1",
"earcut": "^3.0.0",
"geotiff": "^2.0.7",
"pbf": "4.0.1",
"rbush": "^4.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/openlayers"
}
},
"node_modules/ol-cesium": {
"version": "2.17.0",
"resolved": "https://registry.npmjs.org/ol-cesium/-/ol-cesium-2.17.0.tgz",
"integrity": "sha512-XaMXjQYuq2eMPAgAx2e1wjN4I4QwfmPC+9YgU4xoMCj/MBj8oDQusyloQ4TaovypqbZg+0jJDDSZc7BhXckBwA==",
"peer": true,
"peerDependencies": {
"cesium": ">= 1.62.0",
"ol": ">= 6.0.1 || 7 || 8"
}
},
"node_modules/pako": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz",
"integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==",
"peer": true
},
"node_modules/parse-headers": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.5.tgz",
"integrity": "sha512-ft3iAoLOB/MlwbNXgzy43SWGP6sQki2jQvAyBg/zDFAgr9bfNWZIUj42Kw2eJIl8kEi4PbgE6U1Zau/HwI75HA==",
"peer": true
},
"node_modules/pbf": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/pbf/-/pbf-4.0.1.tgz",
"integrity": "sha512-SuLdBvS42z33m8ejRbInMapQe8n0D3vN/Xd5fmWM3tufNgRQFBpaW2YVJxQZV4iPNqb0vEFvssMEo5w9c6BTIA==",
"peer": true,
"dependencies": {
"resolve-protobuf-schema": "^2.1.0"
},
"bin": {
"pbf": "bin/pbf"
}
},
"node_modules/protobufjs": {
"version": "7.4.0",
"resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.4.0.tgz",
"integrity": "sha512-mRUWCc3KUU4w1jU8sGxICXH/gNS94DvI1gxqDvBzhj1JpcsimQkYiOJfwsPUykUI5ZaspFbSgmBLER8IrQ3tqw==",
"hasInstallScript": true,
"peer": true,
"dependencies": {
"@protobufjs/aspromise": "^1.1.2",
"@protobufjs/base64": "^1.1.2",
"@protobufjs/codegen": "^2.0.4",
"@protobufjs/eventemitter": "^1.1.0",
"@protobufjs/fetch": "^1.1.0",
"@protobufjs/float": "^1.0.2",
"@protobufjs/inquire": "^1.1.0",
"@protobufjs/path": "^1.1.2",
"@protobufjs/pool": "^1.1.0",
"@protobufjs/utf8": "^1.1.0",
"@types/node": ">=13.7.0",
"long": "^5.0.0"
},
"engines": {
"node": ">=12.0.0"
}
},
"node_modules/protocol-buffers-schema": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.6.0.tgz",
"integrity": "sha512-TdDRD+/QNdrCGCE7v8340QyuXd4kIWIgapsE2+n/SaGiSSbomYl4TjHlvIoCWRpE7wFt02EpB35VVA2ImcBVqw==",
"peer": true
},
"node_modules/quick-lru": {
"version": "6.1.2",
"resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-6.1.2.tgz",
"integrity": "sha512-AAFUA5O1d83pIHEhJwWCq/RQcRukCkn/NSm2QsTEMle5f2hP0ChI2+3Xb051PZCkLryI/Ir1MVKviT2FIloaTQ==",
"peer": true,
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/quickselect": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/quickselect/-/quickselect-3.0.0.tgz",
"integrity": "sha512-XdjUArbK4Bm5fLLvlm5KpTFOiOThgfWWI4axAZDWg4E/0mKdZyI9tNEfds27qCi1ze/vwTR16kvmmGhRra3c2g==",
"peer": true
},
"node_modules/rbush": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/rbush/-/rbush-4.0.1.tgz",
"integrity": "sha512-IP0UpfeWQujYC8Jg162rMNc01Rf0gWMMAb2Uxus/Q0qOFw4lCcq6ZnQEZwUoJqWyUGJ9th7JjwI4yIWo+uvoAQ==",
"peer": true,
"dependencies": {
"quickselect": "^3.0.0"
}
},
"node_modules/resolve-protobuf-schema": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/resolve-protobuf-schema/-/resolve-protobuf-schema-2.1.0.tgz",
"integrity": "sha512-kI5ffTiZWmJaS/huM8wZfEMer1eRd7oJQhDuxeCLe3t7N7mX3z94CN0xPxBQxFYQTSNz9T0i+v6inKqSdK8xrQ==",
"peer": true,
"dependencies": {
"protocol-buffers-schema": "^3.3.1"
}
},
"node_modules/rxjs": {
"version": "7.8.1",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz",
"integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==",
"peer": true,
"dependencies": {
"tslib": "^2.1.0"
}
},
"node_modules/topojson-client": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/topojson-client/-/topojson-client-3.1.0.tgz",
"integrity": "sha512-605uxS6bcYxGXw9qi62XyrV6Q3xwbndjachmNxu8HWTtVPxZfEJN9fd/SZS1Q54Sn2y0TMyMxFj/cJINqGHrKw==",
"peer": true,
"dependencies": {
"commander": "2"
},
"bin": {
"topo2geo": "bin/topo2geo",
"topomerge": "bin/topomerge",
"topoquantize": "bin/topoquantize"
}
},
"node_modules/tslib": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz",
"integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg=="
},
"node_modules/undici-types": {
"version": "6.19.8",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz",
"integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==",
"peer": true
},
"node_modules/urijs": {
"version": "1.19.11",
"resolved": "https://registry.npmjs.org/urijs/-/urijs-1.19.11.tgz",
"integrity": "sha512-HXgFDgDommxn5/bIv0cnQZsPhHDA90NPHD6+c/v21U5+Sx5hoP8+dP9IZXBU1gIfvdRfhG8cel9QNPeionfcCQ==",
"peer": true
},
"node_modules/web-worker": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/web-worker/-/web-worker-1.3.0.tgz",
"integrity": "sha512-BSR9wyRsy/KOValMgd5kMyr3JzpdeoR9KVId8u5GVlTTAtNChlsE4yTxeY7zMdNSyOmoKBv8NH2qeRY9Tg+IaA==",
"peer": true
},
"node_modules/xml-utils": {
"version": "1.10.1",
"resolved": "https://registry.npmjs.org/xml-utils/-/xml-utils-1.10.1.tgz",
"integrity": "sha512-Dn6vJ1Z9v1tepSjvnCpwk5QqwIPcEFKdgnjqfYOABv1ngSofuAhtlugcUC3ehS1OHdgDWSG6C5mvj+Qm15udTQ==",
"peer": true
},
"node_modules/zone.js": {
"version": "0.14.10",
"resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.14.10.tgz",
"integrity": "sha512-YGAhaO7J5ywOXW6InXNlLmfU194F8lVgu7bRntUF3TiG8Y3nBK0x1UJJuHUP/e8IyihkjCYqhCScpSwnlaSRkQ==",
"peer": true
},
"node_modules/zstddec": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/zstddec/-/zstddec-0.1.0.tgz",
"integrity": "sha512-w2NTI8+3l3eeltKAdK8QpiLo/flRAr2p8AGeakfMZOXBxOg9HIu4LVDxBi81sYgVhFhdJjv1OrB5ssI8uFPoLg==",
"peer": true
}
}
}

View File

@@ -4,14 +4,14 @@
"publishConfig": {
"registry": "https://repository.akkerweb.nl/repository/npm-hosted/"
},
"peerDependencies": {
"@angular/common": "^17.3.3",
"@angular/core": "^17.3.3",
"ng-openlayers": "17.1.3",
"cesium": ">=1.82.1",
"ol-cesium": ">=2.13.0"
},
"dependencies": {
"tslib": "^2.0.0"
},
"peerDependencies": {
"@angular/common": "^18.2.3",
"@angular/core": "^18.2.3",
"ng-openlayers": "file:dist/ng-openlayers",
"cesium": ">=1.82.1",
"ol-cesium": ">=2.13.0"
}
}

View File

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

View File

@@ -49,7 +49,11 @@ export class Switch2D3DComponent {
this.interactions=[];
this.map.instance.getInteractions().forEach((i) => {
if(i.getActive()) {
this.interactions.push(i);
// AW-6241 TODO How to fix?
// error TS2345: Argument of type 'import("C:/Project/Farmmaps/FarmMapsLib/node_modules/ol/interaction/Interaction").default'
// is not assignable to parameter of type 'import("C:/Project/Farmmaps/FarmMapsLib/projects/common-map3d/node_modules/ol/interaction/Interaction").default'.
// Line below commented out
// this.interactions.push(i);
i.setActive(false);
}
});

File diff suppressed because it is too large Load Diff

View File

@@ -1,25 +1,25 @@
{
"name": "@farmmaps/common",
"version": "2.0.0",
"version": "2.1.0",
"publishConfig": {
"registry": "https://repository.akkerweb.nl/repository/npm-hosted/"
},
"peerDependencies": {
"@ng-bootstrap/ng-bootstrap": "^16.0.0",
"@angular/common": "^17.3.3",
"@angular/core": "^17.3.3",
"@angular/forms": "^17.3.3",
"@ngrx/effects": "^17",
"@ngrx/router-store": "^17",
"@ngrx/store": "^17",
"@ng-bootstrap/ng-bootstrap": "^17.0.1",
"@angular/common": "^18.2.3",
"@angular/core": "^18.2.3",
"@angular/forms": "^18.2.3",
"@ngrx/effects": "^18.0.2",
"@ngrx/router-store": "^18.0.2",
"@ngrx/store": "^18.0.2",
"tassign": "^1.0.0",
"bootstrap": "^5.2.0",
"bootstrap": "^5.3.3",
"@microsoft/signalr": "^3.1.16",
"ngx-uploadx": "^6.2.0",
"angular-oauth2-oidc": "^13",
"angular-oauth2-oidc": "^17.0.2",
"moment": "^2.29.4",
"ngx-avatars": "1.7.0",
"ngx-image-cropper": "^7.2.1",
"ngx-avatars": "1.8.0",
"ngx-image-cropper": "^7.0.0",
"ngx-clipboard": "16.0.0"
}
}

View File

@@ -1,16 +1,16 @@
// angular modules
import { NgModule, APP_INITIALIZER, ModuleWithProviders, Injector, Optional, SkipSelf,InjectionToken } from '@angular/core';
import { CommonModule, DatePipe } from '@angular/common';
import { HttpClientModule, HttpClient, HTTP_INTERCEPTORS } from '@angular/common/http';
import { CommonModule } from '@angular/common';
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
import { InjectionToken, NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
// external modules
import { OAuthModule, AuthConfig, OAuthService, OAuthStorage } from 'angular-oauth2-oidc';
import { StoreModule, Store } from '@ngrx/store';
import { EffectsModule } from '@ngrx/effects';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { UploadxModule } from 'ngx-uploadx';
import { EffectsModule } from '@ngrx/effects';
import { StoreModule } from '@ngrx/store';
import { OAuthModule } from 'angular-oauth2-oidc';
import { ClipboardModule } from 'ngx-clipboard';
import { UploadxModule } from 'ngx-uploadx';
// routing module
@@ -19,129 +19,70 @@ import { AppCommonRoutingModule } from './common-routing.module';
import { MODULE_NAME } from './module-name';
//components
import { SafePipe } from './shared/safe.pipe';
import { AuthConfigFactory, IAuthconfigFactory } from './shared/authconfigFactory';
import { AppComponent } from './components/app/app.component';
import { AuthCallbackComponent } from './components/auth-callback/auth-callback.component';
import { SessionClearedComponent } from './components/session-cleared/session-cleared.component';
import { ResumableFileUploadComponent } from './components/resumable-file-upload/resumable-file-upload.component';
import { NotFoundComponent } from './components/not-found/not-found.component';
import { NotImplementedComponent } from './components/not-implemented/not-implemented.component';
import { SidePanelComponent } from './components/side-panel/side-panel.component';
import { TimespanComponent } from './components/timespan/timespan.component';
import { TagInputComponent } from './components/tag-input/tag-input.component';
import { MenuBackgroundComponent } from './components/menu-background/menu-background.component';
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 { HasRoleDirective } from './components/has-role/has-role.directive';
import { UserMenuComponent} from './components/user-menu/user-menu.component';
import { ThumbnailComponent } from './components/thumbnail/thumbnail.component';
import { Alert } from './enumerations/alert.enum';
import { IEventMessage } from './models/event.message';
import { IItem, Item } from './models/item';
import { WeatherCurrentObservation } from './models/weatherCurrentObservation';
import { IItemType } from './models/item.type';
import { IItemLinkType} from './models/itemlink.type';
import {IUrlType} from './models/url.type';
import { IItemTypes } from './models/item.types';
import { IItemTask, ItemTask } from './models/itemTask';
import { IListItem } from './models/list.item';
import { ITypeaheadItem } from './models/typeahead.item'
import { IJsonline } from './models/json-line';
import { ISenMLItem } from './models/senml-item';
import { IPackage,IPackages } from './models/package';
import { IUser } from './models/user';
import { IQueryState } from './models/query.state';
import { IDataLayer } from './models/data.layer';
import { IColor,IGradientstop} from './models/gradient';
import * as commonActions from './actions/app-common.actions';
import * as commonReducers from './reducers/app-common.reducer';
import * as commonEffects from './effects/app-common.effects';
import { SecureOAuthStorage} from './shared/secureOAuthStorage';
import { GradientComponent } from './components/gradient/gradient.component';
import { GradientSelectComponent } from './components/gradient-select/gradient-select.component';
import { AppMenuComponent } from './components/app-menu/app-menu.component';
import { NotificationMenuComponent} from './components/notification-menu/notification-menu.component';
import { HelpMenuComponent} from './components/help-menu/help-menu.component';
import { BackButtonComponent } from './components/back-button/back-button.component';
import { EditImageModalComponent } from './components/edit-image-modal/edit-image-modal.component';
import { AvatarComponent } from './components/avatar/avatar.component';
import { ItemLinkComponent } from './components/item-link/item-link.component';
import { AvatarModule } from 'ngx-avatars';
import { ImageCropperModule } from 'ngx-image-cropper';
import * as commonActions from './actions/app-common.actions';
import { AppMenuComponent } from './components/app-menu/app-menu.component';
import { AppComponent } from './components/app/app.component';
import { AuthCallbackComponent } from './components/auth-callback/auth-callback.component';
import { AvatarComponent } from './components/avatar/avatar.component';
import { BackButtonComponent } from './components/back-button/back-button.component';
import { EditImageModalComponent } from './components/edit-image-modal/edit-image-modal.component';
import { GradientSelectComponent } from './components/gradient-select/gradient-select.component';
import { GradientComponent } from './components/gradient/gradient.component';
import { HasClaimDirective } from './components/has-claim/has-claim.directive';
import { HasPackageDirective } from './components/has-package/has-package.directive';
import { HasRoleDirective } from './components/has-role/has-role.directive';
import { HelpMenuComponent } from './components/help-menu/help-menu.component';
import { ItemLinkComponent } from './components/item-link/item-link.component';
import { MenuBackgroundComponent } from './components/menu-background/menu-background.component';
import { NotFoundComponent } from './components/not-found/not-found.component';
import { NotImplementedComponent } from './components/not-implemented/not-implemented.component';
import { NotificationMenuComponent } from './components/notification-menu/notification-menu.component';
import { PackageExistsDirective } from './components/package-exists/package-exists.directive';
import { ResumableFileUploadComponent } from './components/resumable-file-upload/resumable-file-upload.component';
import { SessionClearedComponent } from './components/session-cleared/session-cleared.component';
import { SidePanelComponent } from './components/side-panel/side-panel.component';
import { TagInputComponent } from './components/tag-input/tag-input.component';
import { ThumbnailComponent } from './components/thumbnail/thumbnail.component';
import { TimespanComponent } from './components/timespan/timespan.component';
import { UserMenuComponent } from './components/user-menu/user-menu.component';
import * as commonEffects from './effects/app-common.effects';
import { Alert } from './enumerations/alert.enum';
import { IDataLayer } from './models/data.layer';
import { IEventMessage } from './models/event.message';
import { IColor, IGradientstop } from './models/gradient';
import { IItem, Item } from './models/item';
import { IItemType } from './models/item.type';
import { IItemTypes } from './models/item.types';
import { IItemLinkType } from './models/itemlink.type';
import { IItemTask, ItemTask } from './models/itemTask';
import { IJsonline } from './models/json-line';
import { IListItem } from './models/list.item';
import { IPackage, IPackages } from './models/package';
import { IQueryState } from './models/query.state';
import { ISenMLItem } from './models/senml-item';
import { ITypeaheadItem } from './models/typeahead.item';
import { IUrlType } from './models/url.type';
import { IUser } from './models/user';
import { WeatherCurrentObservation } from './models/weatherCurrentObservation';
import * as commonReducers from './reducers/app-common.reducer';
import { AuthConfigFactory, IAuthconfigFactory } from './shared/authconfigFactory';
import { SafePipe } from './shared/safe.pipe';
import { SecureOAuthStorage } from './shared/secureOAuthStorage';
export const FM_COMMON_STARTPAGE = new InjectionToken<string>('fm-common-startpage');
export {
SafePipe,
AuthCallbackComponent,
AppComponent,
SessionClearedComponent,
ResumableFileUploadComponent,
NotFoundComponent,
NotImplementedComponent,
SidePanelComponent,
TimespanComponent,
TagInputComponent,
UserMenuComponent,
ThumbnailComponent,
HasPackageDirective,
PackageExistsDirective,
HasClaimDirective,
HasRoleDirective,
Alert,
IEventMessage,
IItem,
Item,
IItemType,
IItemLinkType,
IUrlType,
IItemTypes,
IItemTask,
ItemTask,
IListItem,
ITypeaheadItem,
IUser,
IQueryState,
IPackage,
IPackages,
commonActions,
commonReducers,
IAuthconfigFactory,
AuthConfigFactory,
MenuBackgroundComponent,
SecureOAuthStorage,
WeatherCurrentObservation,
IJsonline,
ISenMLItem,
IDataLayer,
IColor,
IGradientstop,
BackButtonComponent,
AvatarComponent,
ItemLinkComponent,
EditImageModalComponent,
Alert, AppComponent, AuthCallbackComponent, AuthConfigFactory, AvatarComponent, BackButtonComponent, commonActions,
commonReducers, EditImageModalComponent,
GradientComponent,
GradientSelectComponent
GradientSelectComponent, HasClaimDirective, HasPackageDirective, HasRoleDirective, IAuthconfigFactory, IColor, IDataLayer, IEventMessage, IGradientstop, IItem, IItemLinkType, IItemTask, IItemType, IItemTypes, IJsonline, IListItem, IPackage,
IPackages, IQueryState, ISenMLItem, Item, ItemLinkComponent, ItemTask, ITypeaheadItem, IUrlType, IUser, MenuBackgroundComponent, NotFoundComponent,
NotImplementedComponent, PackageExistsDirective, ResumableFileUploadComponent, SafePipe, SecureOAuthStorage, SessionClearedComponent, SidePanelComponent, TagInputComponent, ThumbnailComponent, TimespanComponent, UserMenuComponent, WeatherCurrentObservation
};
@NgModule({
imports: [
CommonModule,
HttpClientModule,
AppCommonRoutingModule,
StoreModule.forFeature(MODULE_NAME, commonReducers.reducer),
EffectsModule.forFeature([commonEffects.AppCommonEffects]),
OAuthModule.forRoot(),
NgbModule,
FormsModule,
UploadxModule,
ClipboardModule,
AvatarModule,
ImageCropperModule
],
declarations: [
@NgModule({ declarations: [
AppComponent,
AuthCallbackComponent,
SidePanelComponent,
@@ -198,7 +139,16 @@ export {
AvatarComponent,
ItemLinkComponent,
EditImageModalComponent
]
})
], imports: [CommonModule,
AppCommonRoutingModule,
StoreModule.forFeature(MODULE_NAME, commonReducers.reducer),
EffectsModule.forFeature([commonEffects.AppCommonEffects]),
OAuthModule.forRoot(),
NgbModule,
FormsModule,
UploadxModule,
ClipboardModule,
AvatarModule,
ImageCropperModule], providers: [provideHttpClient(withInterceptorsFromDi())] })
export class AppCommonModule {
}

View File

@@ -148,7 +148,7 @@ export class AppCommonEffects {
ofType(appCommonActions.VIEWITEM),
withLatestFrom(this.store$.select(appCommonReducers.selectGetItemTypes)),
switchMap(([action, itemtypes]) => {
const a = action as appCommonActions.EditItem;
const a = action as appCommonActions.ViewItem;
const itemType = itemtypes[a.item.itemType];
const viewer = itemType.viewer;
const editor = itemType.editor;

View File

@@ -1,7 +1,9 @@
import { HttpClient, HttpParams } from "@angular/common/http";
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { IItem } from '../models/item';
import { HttpClient, HttpParams } from "@angular/common/http";
import { IItemTask } from '../models/itemTask';
import { IUser } from '../models/user';
import { AppConfig } from "../shared/app.config";
import { ItemTypeService } from './itemtype.service';
@@ -42,4 +44,12 @@ export class AdminService {
deleteItem(code: string): Observable<any> {
return this.httpClient.delete<any>(`${this.ApiEndpoint()}/api/v1/admin/${code}`);
}
getAllUsers(): Observable<IUser[]> {
return this.httpClient.get<IUser[]>(`${this.ApiEndpoint()}/api/v1/admin/users`);
}
postItemTask(item: IItem, task: IItemTask): Observable<IItemTask> {
return this.httpClient.post<IItemTask>(`${this.ApiEndpoint()}/api/v1/admin/${item.code}/tasks`, task);
}
}

View File

@@ -22,6 +22,10 @@ export class FolderService {
return this.httpClient.get<IListItem>(`${this.ApiEndpoint()}/api/v1/folders/${code}`);
}
getMyRoot(): Observable<IListItem> {
return this.httpClient.get<IListItem>(`${this.ApiEndpoint()}/api/v1/folders/my_root`);
}
getMyRoots(): Observable<IListItem[]> {
return this.httpClient.get<IListItem[]>(`${this.ApiEndpoint()}/api/v1/folders/my_roots`);
}

View File

@@ -79,7 +79,9 @@ export class ItemService {
return this.httpClient.get<IItem>(`${this.ApiEndpoint()}/api/v1/items/${code}/${itemType}`);
}
getItemList(itemType?: string, dataFilter?: any, level?: number, atItemLocationItemCode?: string, indexed?: boolean, validToday?: boolean,tags?:string,crs?:string): Observable<IItem[]> {
getItemList(itemType?: string, dataFilter?: any, level?: number, atItemLocationItemCode?: string,
indexed?: boolean, validToday?: boolean,tags?:string,crs?:string, startDate?: Date, endDate?: Date,
skip?: number, take?: number): Observable<IItem[]> {
let params = new HttpParams();
if(itemType) params = params.append("it", itemType);
if(dataFilter) params = params.append("df", JSON.stringify(dataFilter));
@@ -89,10 +91,22 @@ export class ItemService {
if (validToday) params = params.append("vt", validToday ? "true" : "false");
if (tags) params = params.append("t", tags);
if (crs) params = params.append("crs", crs);
if (startDate) params = params.append("sDate", startDate.toISOString());
if (endDate) params = params.append("eDate", endDate.toISOString());
if(skip) params = params.append("skip", skip);
if(take) params = params.append("take", take);
return this.httpClient.get<IItem[]>(`${this.ApiEndpoint()}/api/v1/items/`, { params: params });
}
getChildItemList(parentcode: string, itemType: string, dataFilter?: any, level = 1, deep = true,
getItemListCount(itemType: string, startDate?: Date, endDate?: Date): Observable<number> {
let params = new HttpParams();
params = params.append("it", itemType);
if (startDate) params = params.append("sDate", startDate.toISOString());
if (endDate) params = params.append("eDate", endDate.toISOString());
return this.httpClient.get<number>(`${this.ApiEndpoint()}/api/v1/items/count`, { params: params });
}
getChildItemList(parentcode: string, itemType?: string, dataFilter?: any, level = 1, deep = true,
startDate?: Date, endDate?: Date, skip?: number, take?: number): Observable<IItem[]> {
let params = new HttpParams();
if(itemType != null) {
@@ -111,9 +125,11 @@ export class ItemService {
return this.httpClient.get<IItem[]>(`${this.ApiEndpoint()}/api/v1/items/${parentcode}/children`, { params: params });
}
getChildItemListCount(parentcode: string, itemType: string,dataFilter?: any): Observable<number> {
getChildItemListCount(parentcode: string, itemType?: string,dataFilter?: any): Observable<number> {
let params = new HttpParams();
if(itemType != null) {
params = params.append("it", itemType);
}
if (dataFilter != null) {
params = params.append("df", JSON.stringify(dataFilter));
}

View File

@@ -1,12 +1,7 @@
import { Injectable, Injector, Inject } from '@angular/core';
import { DOCUMENT } from '@angular/common'
import { AppConfig } from "./app.config";
import {
HttpRequest,
HttpHandler,
HttpEvent,
HttpInterceptor
} from '@angular/common/http';
import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor } from '@angular/common/http';
import { OAuthService } from 'angular-oauth2-oidc';
import { Observable } from 'rxjs';

View File

@@ -18,9 +18,7 @@
],
"paths": {
"@angular/*": [
"node_modules/@angular/*"
]
}
},

View File

@@ -0,0 +1,54 @@
{
"extends": "../../.eslintrc.json",
"ignorePatterns": [
"!**/*"
],
"overrides": [
{
"files": [
"*.ts"
],
"parserOptions": {
"project": [
"libs/ng-openlayers/tsconfig.*?.json"
],
"createDefaultProgram": true
},
"rules": {
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "aol",
"style": "kebab-case"
}
],
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "aol",
"style": "camelCase"
}
],
"@typescript-eslint/explicit-member-accessibility": [
"off",
{
"accessibility": "explicit"
}
],
"arrow-parens": [
"off",
"always"
],
"import/order": "off"
}
},
{
"files": [
"*.html"
],
"rules": {}
}
]
}

2
projects/ng-openlayers/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
/node_modules

View File

@@ -0,0 +1,32 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma'),
],
client: {
clearContext: false, // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, '../../coverage/ng-openlayers'),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true,
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true,
});
};

View File

@@ -0,0 +1,10 @@
{
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../dist/ng-openlayers",
"assets": [
"ngcc.config.js"
],
"lib": {
"entryFile": "src/public-api.ts"
}
}

View File

@@ -0,0 +1,3 @@
module.exports = {
ignorableDeepImportMatchers: [/ol\//],
};

292
projects/ng-openlayers/package-lock.json generated Normal file
View File

@@ -0,0 +1,292 @@
{
"name": "ng-openlayers",
"version": "18.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "ng-openlayers",
"version": "18.0.0",
"license": "MPL-2.0",
"dependencies": {
"tslib": "^2.3.0"
},
"peerDependencies": {
"@angular/common": "^18.2.3",
"@angular/core": "^18.2.3",
"ol": "^8.2.0"
}
},
"node_modules/@angular/common": {
"version": "18.2.3",
"resolved": "https://registry.npmjs.org/@angular/common/-/common-18.2.3.tgz",
"integrity": "sha512-NFL4yXXImSCH7i1xnHykUjHa9vl9827fGiwSV2mnf7LjSUsyDzFD8/54dNuYN9OY8AUD+PnK0YdNro6cczVyIA==",
"license": "MIT",
"peer": true,
"dependencies": {
"tslib": "^2.3.0"
},
"engines": {
"node": "^18.19.1 || ^20.11.1 || >=22.0.0"
},
"peerDependencies": {
"@angular/core": "18.2.3",
"rxjs": "^6.5.3 || ^7.4.0"
}
},
"node_modules/@angular/core": {
"version": "18.2.3",
"resolved": "https://registry.npmjs.org/@angular/core/-/core-18.2.3.tgz",
"integrity": "sha512-VGhMJxj7d0rYpqVfQrcGRB7EE/BCziotft/I/YPl6bOMPSAvMukG7DXQuJdYpNrr62ks78mlzHlZX/cdmB9Prw==",
"license": "MIT",
"peer": true,
"dependencies": {
"tslib": "^2.3.0"
},
"engines": {
"node": "^18.19.1 || ^20.11.1 || >=22.0.0"
},
"peerDependencies": {
"rxjs": "^6.5.3 || ^7.4.0",
"zone.js": "~0.14.10"
}
},
"node_modules/@petamoriken/float16": {
"version": "3.8.7",
"resolved": "https://registry.npmjs.org/@petamoriken/float16/-/float16-3.8.7.tgz",
"integrity": "sha512-/Ri4xDDpe12NT6Ex/DRgHzLlobiQXEW/hmG08w1wj/YU7hLemk97c+zHQFp0iZQ9r7YqgLEXZR2sls4HxBf9NA==",
"license": "MIT",
"peer": true
},
"node_modules/color-name": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-2.0.0.tgz",
"integrity": "sha512-SbtvAMWvASO5TE2QP07jHBMXKafgdZz8Vrsrn96fiL+O92/FN/PLARzUW5sKt013fjAprK2d2iCn2hk2Xb5oow==",
"license": "MIT",
"peer": true,
"engines": {
"node": ">=12.20"
}
},
"node_modules/color-parse": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/color-parse/-/color-parse-2.0.2.tgz",
"integrity": "sha512-eCtOz5w5ttWIUcaKLiktF+DxZO1R9KLNY/xhbV6CkhM7sR3GhVghmt6X6yOnzeaM24po+Z9/S1apbXMwA3Iepw==",
"license": "MIT",
"peer": true,
"dependencies": {
"color-name": "^2.0.0"
}
},
"node_modules/color-rgba": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/color-rgba/-/color-rgba-3.0.0.tgz",
"integrity": "sha512-PPwZYkEY3M2THEHHV6Y95sGUie77S7X8v+h1r6LSAPF3/LL2xJ8duUXSrkic31Nzc4odPwHgUbiX/XuTYzQHQg==",
"license": "MIT",
"peer": true,
"dependencies": {
"color-parse": "^2.0.0",
"color-space": "^2.0.0"
}
},
"node_modules/color-space": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-space/-/color-space-2.0.1.tgz",
"integrity": "sha512-nKqUYlo0vZATVOFHY810BSYjmCARrG7e5R3UE3CQlyjJTvv5kSSmPG1kzm/oDyyqjehM+lW1RnEt9It9GNa5JA==",
"license": "MIT",
"peer": true
},
"node_modules/earcut": {
"version": "2.2.4",
"resolved": "https://registry.npmjs.org/earcut/-/earcut-2.2.4.tgz",
"integrity": "sha512-/pjZsA1b4RPHbeWZQn66SWS8nZZWLQQ23oE3Eam7aroEFGEvwKAsJfZ9ytiEMycfzXWpca4FA9QIOehf7PocBQ==",
"license": "ISC",
"peer": true
},
"node_modules/geotiff": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/geotiff/-/geotiff-2.1.3.tgz",
"integrity": "sha512-PT6uoF5a1+kbC3tHmZSUsLHBp2QJlHasxxxxPW47QIY1VBKpFB+FcDvX+MxER6UzgLQZ0xDzJ9s48B9JbOCTqA==",
"license": "MIT",
"peer": true,
"dependencies": {
"@petamoriken/float16": "^3.4.7",
"lerc": "^3.0.0",
"pako": "^2.0.4",
"parse-headers": "^2.0.2",
"quick-lru": "^6.1.1",
"web-worker": "^1.2.0",
"xml-utils": "^1.0.2",
"zstddec": "^0.1.0"
},
"engines": {
"node": ">=10.19"
}
},
"node_modules/ieee754": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
"integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
],
"license": "BSD-3-Clause",
"peer": true
},
"node_modules/lerc": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/lerc/-/lerc-3.0.0.tgz",
"integrity": "sha512-Rm4J/WaHhRa93nCN2mwWDZFoRVF18G1f47C+kvQWyHGEZxFpTUi73p7lMVSAndyxGt6lJ2/CFbOcf9ra5p8aww==",
"license": "Apache-2.0",
"peer": true
},
"node_modules/ol": {
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/ol/-/ol-8.2.0.tgz",
"integrity": "sha512-/m1ddd7Jsp4Kbg+l7+ozR5aKHAZNQOBAoNZ5pM9Jvh4Etkf0WGkXr9qXd7PnhmwiC1Hnc2Toz9XjCzBBvexfXw==",
"license": "BSD-2-Clause",
"peer": true,
"dependencies": {
"color-rgba": "^3.0.0",
"color-space": "^2.0.1",
"earcut": "^2.2.3",
"geotiff": "^2.0.7",
"pbf": "3.2.1",
"rbush": "^3.0.1"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/openlayers"
}
},
"node_modules/pako": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz",
"integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==",
"license": "(MIT AND Zlib)",
"peer": true
},
"node_modules/parse-headers": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.5.tgz",
"integrity": "sha512-ft3iAoLOB/MlwbNXgzy43SWGP6sQki2jQvAyBg/zDFAgr9bfNWZIUj42Kw2eJIl8kEi4PbgE6U1Zau/HwI75HA==",
"license": "MIT",
"peer": true
},
"node_modules/pbf": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/pbf/-/pbf-3.2.1.tgz",
"integrity": "sha512-ClrV7pNOn7rtmoQVF4TS1vyU0WhYRnP92fzbfF75jAIwpnzdJXf8iTd4CMEqO4yUenH6NDqLiwjqlh6QgZzgLQ==",
"license": "BSD-3-Clause",
"peer": true,
"dependencies": {
"ieee754": "^1.1.12",
"resolve-protobuf-schema": "^2.1.0"
},
"bin": {
"pbf": "bin/pbf"
}
},
"node_modules/protocol-buffers-schema": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.6.0.tgz",
"integrity": "sha512-TdDRD+/QNdrCGCE7v8340QyuXd4kIWIgapsE2+n/SaGiSSbomYl4TjHlvIoCWRpE7wFt02EpB35VVA2ImcBVqw==",
"license": "MIT",
"peer": true
},
"node_modules/quick-lru": {
"version": "6.1.2",
"resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-6.1.2.tgz",
"integrity": "sha512-AAFUA5O1d83pIHEhJwWCq/RQcRukCkn/NSm2QsTEMle5f2hP0ChI2+3Xb051PZCkLryI/Ir1MVKviT2FIloaTQ==",
"license": "MIT",
"peer": true,
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/quickselect": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/quickselect/-/quickselect-2.0.0.tgz",
"integrity": "sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw==",
"license": "ISC",
"peer": true
},
"node_modules/rbush": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/rbush/-/rbush-3.0.1.tgz",
"integrity": "sha512-XRaVO0YecOpEuIvbhbpTrZgoiI6xBlz6hnlr6EHhd+0x9ase6EmeN+hdwwUaJvLcsFFQ8iWVF1GAK1yB0BWi0w==",
"license": "MIT",
"peer": true,
"dependencies": {
"quickselect": "^2.0.0"
}
},
"node_modules/resolve-protobuf-schema": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/resolve-protobuf-schema/-/resolve-protobuf-schema-2.1.0.tgz",
"integrity": "sha512-kI5ffTiZWmJaS/huM8wZfEMer1eRd7oJQhDuxeCLe3t7N7mX3z94CN0xPxBQxFYQTSNz9T0i+v6inKqSdK8xrQ==",
"license": "MIT",
"peer": true,
"dependencies": {
"protocol-buffers-schema": "^3.3.1"
}
},
"node_modules/rxjs": {
"version": "7.8.1",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz",
"integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==",
"license": "Apache-2.0",
"peer": true,
"dependencies": {
"tslib": "^2.1.0"
}
},
"node_modules/tslib": {
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz",
"integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA=="
},
"node_modules/web-worker": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/web-worker/-/web-worker-1.3.0.tgz",
"integrity": "sha512-BSR9wyRsy/KOValMgd5kMyr3JzpdeoR9KVId8u5GVlTTAtNChlsE4yTxeY7zMdNSyOmoKBv8NH2qeRY9Tg+IaA==",
"license": "Apache-2.0",
"peer": true
},
"node_modules/xml-utils": {
"version": "1.10.1",
"resolved": "https://registry.npmjs.org/xml-utils/-/xml-utils-1.10.1.tgz",
"integrity": "sha512-Dn6vJ1Z9v1tepSjvnCpwk5QqwIPcEFKdgnjqfYOABv1ngSofuAhtlugcUC3ehS1OHdgDWSG6C5mvj+Qm15udTQ==",
"license": "CC0-1.0",
"peer": true
},
"node_modules/zone.js": {
"version": "0.14.10",
"resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.14.10.tgz",
"integrity": "sha512-YGAhaO7J5ywOXW6InXNlLmfU194F8lVgu7bRntUF3TiG8Y3nBK0x1UJJuHUP/e8IyihkjCYqhCScpSwnlaSRkQ==",
"license": "MIT",
"peer": true
},
"node_modules/zstddec": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/zstddec/-/zstddec-0.1.0.tgz",
"integrity": "sha512-w2NTI8+3l3eeltKAdK8QpiLo/flRAr2p8AGeakfMZOXBxOg9HIu4LVDxBi81sYgVhFhdJjv1OrB5ssI8uFPoLg==",
"license": "MIT AND BSD-3-Clause",
"peer": true
}
}
}

View File

@@ -0,0 +1,39 @@
{
"name": "ng-openlayers",
"version": "18.0.0",
"description": "OpenLayers library for Angular (migrated from angular 17 to 18)",
"author": "Kamil Furtak (kamil.furtak@gmail.com) / Farmmaps",
"repository": {
"type": "git",
"url": "https://github.com/kamilfurtak/ng-openlayers.git"
},
"bugs": {
"url": "https://github.com/kamilfurtak/ng-openlayers/issues"
},
"homepage": "https://github.com/kamilfurtak/ng-openlayers",
"keywords": [
"ngx-openlayers",
"angular",
"angular18",
"openlayers",
"openlayers8",
"ol8"
],
"license": "MPL-2.0",
"private": false,
"scripts": {
"release": "standard-version -m \"chore(release): version %s\" -t \"\"",
"prepublishOnly": "cp projects/ng-openlayers/README.md dist/ng-openlayers/README.md"
},
"standard-version": {
"postchangelog": "cp projects/ng-openlayers/CHANGELOG.md dist/ng-openlayers/CHANGELOG.md"
},
"dependencies": {
"tslib": "^2.3.0"
},
"peerDependencies": {
"@angular/common": "^18.2.3",
"@angular/core": "^18.2.3",
"ol": "^8.2.0"
}
}

View File

@@ -0,0 +1,38 @@
{
"name": "ng-openlayers",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"sourceRoot": "libs/ng-openlayers/src",
"prefix": "lib",
"targets": {
"build": {
"executor": "@nx/angular:package",
"options": {
"tsConfig": "libs/ng-openlayers/tsconfig.lib.json",
"project": "libs/ng-openlayers/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "libs/ng-openlayers/tsconfig.lib.prod.json"
}
}
},
"test": {
"executor": "@angular-devkit/build-angular:karma",
"options": {
"main": "libs/ng-openlayers/src/test.ts",
"tsConfig": "libs/ng-openlayers/tsconfig.spec.json",
"karmaConfig": "libs/ng-openlayers/karma.conf.js"
}
},
"lint": {
"executor": "@nx/eslint:lint",
"options": {
"lintFilePatterns": [
"libs/ng-openlayers/**/*.ts",
"libs/ng-openlayers/**/*.html"
]
}
}
}
}

View File

@@ -0,0 +1,15 @@
import { Component, ElementRef, OnInit } from '@angular/core';
@Component({
selector: 'aol-attribution',
template: '<ng-content></ng-content>',
})
export class AttributionComponent implements OnInit {
label: string;
constructor(private elementRef: ElementRef) {}
ngOnInit() {
this.label = this.elementRef.nativeElement.innerHTML;
}
}

View File

@@ -0,0 +1,25 @@
import { AfterViewInit, Component, ContentChildren, Host, QueryList } from '@angular/core';
import { SourceComponent } from './sources/source.component';
import { AttributionComponent } from './attribution.component';
@Component({
selector: 'aol-attributions',
template: '<ng-content></ng-content>',
})
export class AttributionsComponent implements AfterViewInit {
@ContentChildren(AttributionComponent)
attributions: QueryList<AttributionComponent>;
instance: Array<string>;
constructor(@Host() private source: SourceComponent) {}
/* we can do this at the very end */
ngAfterViewInit() {
if (this.attributions.length) {
this.instance = this.attributions.map((cmp) => cmp.label);
// console.log('setting attributions:', this.instance);
this.source.instance.setAttributions(this.instance);
}
}
}

View File

@@ -0,0 +1,89 @@
import { Component, Input, OnChanges, OnInit, Optional, SimpleChanges } from '@angular/core';
import { MapComponent } from './map.component';
import { GeometryLinestringComponent } from './geom/geometrylinestring.component';
import { GeometryPolygonComponent } from './geom/geometrypolygon.component';
import { GeometryMultiPointComponent } from './geom/geometrymultipoint.component';
import { GeometryMultiLinestringComponent } from './geom/geometrymultilinestring.component';
import { GeometryMultiPolygonComponent } from './geom/geometrymultipolygon.component';
import { Coordinate } from 'ol/coordinate';
import { transform } from 'ol/proj';
@Component({
selector: 'aol-collection-coordinates',
template: ` <div class="aol-collection-coordinates"></div> `,
})
export class CollectionCoordinatesComponent implements OnChanges, OnInit {
@Input()
coordinates: Coordinate[] | Coordinate[][] | Coordinate[][][];
@Input()
srid = 'EPSG:3857';
private host: any;
private mapSrid = 'EPSG:3857';
constructor(
private map: MapComponent,
@Optional() geometryLinestring: GeometryLinestringComponent,
@Optional() geometryPolygon: GeometryPolygonComponent,
@Optional() geometryMultipoint: GeometryMultiPointComponent,
@Optional() geometryMultilinestring: GeometryMultiLinestringComponent,
@Optional() geometryMultipolygon: GeometryMultiPolygonComponent
) {
if (!!geometryLinestring) {
this.host = geometryLinestring;
} else if (!!geometryPolygon) {
this.host = geometryPolygon;
} else if (!!geometryMultipoint) {
this.host = geometryMultipoint;
} else if (!!geometryMultilinestring) {
this.host = geometryMultilinestring;
} else if (!!geometryMultipolygon) {
this.host = geometryMultipolygon;
} else {
throw new Error('aol-collection-coordinates must be a child of a geometry component');
}
}
ngOnInit() {
this.map.instance.on('change:view', (e) => this.onMapViewChanged(e));
this.mapSrid = this.map.instance.getView().getProjection().getCode();
this.transformCoordinates();
}
ngOnChanges(changes: SimpleChanges) {
this.transformCoordinates();
}
private onMapViewChanged(event) {
this.mapSrid = event.target.get(event.key).getProjection().getCode();
this.transformCoordinates();
}
private transformCoordinates() {
let transformedCoordinates: Coordinate[] | Coordinate[][] | Coordinate[][][];
if (this.srid === this.mapSrid) {
transformedCoordinates = this.coordinates;
} else {
switch (this.host.componentType) {
case 'geometry-linestring':
case 'geometry-multipoint':
transformedCoordinates = (this.coordinates as Coordinate[]).map((c) => transform(c, this.srid, this.mapSrid));
break;
case 'geometry-polygon':
case 'geometry-multilinestring':
transformedCoordinates = (this.coordinates as Coordinate[][]).map((cc) =>
cc.map((c) => transform(c, this.srid, this.mapSrid))
);
break;
case 'geometry-multipolygon':
transformedCoordinates = (this.coordinates as Coordinate[][][]).map((ccc) =>
ccc.map((cc) => cc.map((c) => transform(c, this.srid, this.mapSrid)))
);
break;
}
}
this.host.instance.setCoordinates(transformedCoordinates);
}
}

View File

@@ -0,0 +1,9 @@
import { Component, ElementRef } from '@angular/core';
@Component({
selector: 'aol-content',
template: '<ng-content></ng-content>',
})
export class ContentComponent {
constructor(public elementRef: ElementRef) {}
}

View File

@@ -0,0 +1,33 @@
import { Component, ElementRef, Input, OnDestroy, OnInit } from '@angular/core';
import { Attribution } from 'ol/control';
import { MapComponent } from '../map.component';
@Component({
selector: 'aol-control-attribution',
template: ``,
})
export class ControlAttributionComponent implements OnInit, OnDestroy {
@Input()
collapsible: boolean;
public componentType = 'control';
instance: Attribution;
target: HTMLElement;
constructor(
private map: MapComponent,
private element: ElementRef
) {}
ngOnInit() {
this.target = this.element.nativeElement;
// console.log('ol.control.Attribution init: ', this);
this.instance = new Attribution(this);
this.map.instance.addControl(this.instance);
}
ngOnDestroy() {
// console.log('removing aol-control-attribution');
this.map.instance.removeControl(this.instance);
}
}

View File

@@ -0,0 +1,33 @@
import { Component, ContentChild, OnDestroy, OnInit } from '@angular/core';
import { Control } from 'ol/control';
import { MapComponent } from '../map.component';
import { ContentComponent } from '../content.component';
@Component({
selector: 'aol-control',
template: ` <ng-content></ng-content> `,
})
export class ControlComponent implements OnInit, OnDestroy {
@ContentChild(ContentComponent, { static: true })
content: ContentComponent;
public componentType = 'control';
instance: Control;
element: HTMLElement;
constructor(private map: MapComponent) {}
ngOnInit() {
if (this.content) {
this.element = this.content.elementRef.nativeElement;
this.instance = new Control(this);
this.map.instance.addControl(this.instance);
}
}
ngOnDestroy() {
if (this.instance) {
this.map.instance.removeControl(this.instance);
}
}
}

View File

@@ -0,0 +1,42 @@
import { Component, OnDestroy, OnInit, Input } from '@angular/core';
import { Control, defaults } from 'ol/control';
import { Collection } from 'ol';
import { Options as AttributionOptions } from 'ol/control/Attribution';
import { Options as RotateOptions } from 'ol/control/Rotate';
import { Options as ZoomOptions } from 'ol/control/Zoom';
import { MapComponent } from '../map.component';
@Component({
selector: 'aol-control-defaults',
template: '',
})
export class DefaultControlComponent implements OnInit, OnDestroy {
@Input()
attribution: boolean;
@Input()
attributionOptions: AttributionOptions;
@Input()
rotate: boolean;
@Input()
rotateOptions: RotateOptions;
@Input()
zoom: boolean;
@Input()
zoomOptions: ZoomOptions;
instance: Collection<Control>;
constructor(private map: MapComponent) {}
ngOnInit() {
// console.log('ol.control.defaults init: ', this);
this.instance = defaults(this);
this.instance.forEach((c) => this.map.instance.addControl(c));
}
ngOnDestroy() {
// console.log('removing aol-control-defaults');
this.instance.forEach((c) => this.map.instance.removeControl(c));
}
}

View File

@@ -0,0 +1,36 @@
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
import { FullScreen } from 'ol/control';
import { MapComponent } from '../map.component';
@Component({
selector: 'aol-control-fullscreen',
template: ` <ng-content></ng-content> `,
})
export class ControlFullScreenComponent implements OnInit, OnDestroy {
@Input()
className: string;
@Input()
label: string;
@Input()
labelActive: string;
@Input()
tipLabel: string;
@Input()
keys: boolean;
instance: FullScreen;
constructor(private map: MapComponent) {
// console.log('instancing aol-control-fullscreen');
}
ngOnInit() {
this.instance = new FullScreen(this);
this.map.instance.addControl(this.instance);
}
ngOnDestroy() {
// console.log('removing aol-control-fullscreen');
this.map.instance.removeControl(this.instance);
}
}

View File

@@ -0,0 +1,36 @@
import { Component, ElementRef, Input, OnDestroy, OnInit } from '@angular/core';
import MousePosition from 'ol/control/MousePosition';
import { MapComponent } from '../map.component';
import { CoordinateFormat } from 'ol/coordinate';
import { ProjectionLike } from 'ol/proj';
@Component({
selector: 'aol-control-mouseposition',
template: ``,
})
export class ControlMousePositionComponent implements OnInit, OnDestroy {
@Input()
coordinateFormat: CoordinateFormat;
@Input()
projection: ProjectionLike;
instance: MousePosition;
target: HTMLElement;
constructor(
private map: MapComponent,
private element: ElementRef
) {}
ngOnInit() {
this.target = this.element.nativeElement;
// console.log('ol.control.MousePosition init: ', this);
this.instance = new MousePosition(this);
this.map.instance.addControl(this.instance);
}
ngOnDestroy() {
// console.log('removing aol-control-mouseposition');
this.map.instance.removeControl(this.instance);
}
}

View File

@@ -0,0 +1,53 @@
import { Component, Input, OnDestroy, OnInit, OnChanges, SimpleChanges } from '@angular/core';
import { Layer } from 'ol/layer';
import { View } from 'ol';
import { OverviewMap } from 'ol/control';
import { MapComponent } from '../map.component';
@Component({
selector: 'aol-control-overviewmap',
template: ` <ng-content></ng-content> `,
})
export class ControlOverviewMapComponent implements OnInit, OnChanges, OnDestroy {
@Input()
collapsed: boolean;
@Input()
collapseLabel: string;
@Input()
collapsible: boolean;
@Input()
label: string;
@Input()
layers: Layer[];
@Input()
target: HTMLElement;
@Input()
tipLabel: string;
@Input()
view: View;
instance: OverviewMap;
constructor(private map: MapComponent) {}
ngOnInit() {
this.instance = new OverviewMap(this);
this.map.instance.addControl(this.instance);
}
ngOnDestroy() {
this.map.instance.removeControl(this.instance);
}
ngOnChanges(changes: SimpleChanges) {
if (this.instance != null && changes.hasOwnProperty('view')) {
this.reloadInstance();
}
}
private reloadInstance() {
this.map.instance.removeControl(this.instance);
this.instance = new OverviewMap(this);
this.map.instance.addControl(this.instance);
}
}

View File

@@ -0,0 +1,36 @@
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
import { Rotate } from 'ol/control';
import { MapComponent } from '../map.component';
@Component({
selector: 'aol-control-rotate',
template: ` <ng-content></ng-content> `,
})
export class ControlRotateComponent implements OnInit, OnDestroy {
@Input()
className: string;
@Input()
label: string;
@Input()
tipLabel: string;
@Input()
duration: number;
@Input()
autoHide: boolean;
instance: Rotate;
constructor(private map: MapComponent) {
// console.log('instancing aol-control-rotate');
}
ngOnInit() {
this.instance = new Rotate(this);
this.map.instance.addControl(this.instance);
}
ngOnDestroy() {
// console.log('removing aol-control-rotate');
this.map.instance.removeControl(this.instance);
}
}

View File

@@ -0,0 +1,26 @@
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
import { ScaleLine } from 'ol/control';
import { MapComponent } from '../map.component';
import { Units } from 'ol/control/ScaleLine';
@Component({
selector: 'aol-control-scaleline',
template: ` <ng-content></ng-content> `,
})
export class ControlScaleLineComponent implements OnInit, OnDestroy {
@Input()
units: Units;
instance: ScaleLine;
constructor(private map: MapComponent) {}
ngOnInit() {
this.instance = new ScaleLine(this);
this.map.instance.addControl(this.instance);
}
ngOnDestroy() {
this.map.instance.removeControl(this.instance);
}
}

View File

@@ -0,0 +1,38 @@
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
import { Zoom } from 'ol/control';
import { MapComponent } from '../map.component';
@Component({
selector: 'aol-control-zoom',
template: ` <ng-content></ng-content> `,
})
export class ControlZoomComponent implements OnInit, OnDestroy {
@Input()
duration: number;
@Input()
zoomInLabel: string | HTMLElement;
@Input()
zoomOutLabel: string | HTMLElement;
@Input()
zoomInTipLabel: string;
@Input()
zoomOutTipLabel: string;
@Input()
delta: number;
instance: Zoom;
constructor(private map: MapComponent) {
// console.log('instancing aol-control-zoom');
}
ngOnInit() {
this.instance = new Zoom(this);
this.map.instance.addControl(this.instance);
}
ngOnDestroy() {
// console.log('removing aol-control-zoom');
this.map.instance.removeControl(this.instance);
}
}

View File

@@ -0,0 +1,34 @@
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
import { ZoomSlider } from 'ol/control';
import { MapComponent } from '../map.component';
@Component({
selector: 'aol-control-zoomslider',
template: ` <ng-content></ng-content> `,
})
export class ControlZoomSliderComponent implements OnInit, OnDestroy {
@Input()
className: string;
@Input()
duration: number;
@Input()
maxResolution: number;
@Input()
minResolution: number;
instance: ZoomSlider;
constructor(private map: MapComponent) {
// console.log('instancing aol-control-zoomslider');
}
ngOnInit() {
this.instance = new ZoomSlider(this);
this.map.instance.addControl(this.instance);
}
ngOnDestroy() {
// console.log('removing aol-control-zoomslider');
this.map.instance.removeControl(this.instance);
}
}

View File

@@ -0,0 +1,35 @@
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
import { ZoomToExtent } from 'ol/control';
import { MapComponent } from '../map.component';
import { Extent } from 'ol/extent';
@Component({
selector: 'aol-control-zoomtoextent',
template: ` <ng-content></ng-content> `,
})
export class ControlZoomToExtentComponent implements OnInit, OnDestroy {
@Input()
className: string;
@Input()
label: string | HTMLElement;
@Input()
tipLabel: string;
@Input()
extent: Extent;
instance: ZoomToExtent;
constructor(private map: MapComponent) {
// console.log('instancing aol-control-zoomtoextent');
}
ngOnInit() {
this.instance = new ZoomToExtent(this);
this.map.instance.addControl(this.instance);
}
ngOnDestroy() {
// console.log('removing aol-control-zoomtoextent');
this.map.instance.removeControl(this.instance);
}
}

View File

@@ -0,0 +1,80 @@
import { Component, Optional, OnChanges, Input, SimpleChanges, OnInit } from '@angular/core';
import { transform } from 'ol/proj';
import { MapComponent } from './map.component';
import { GeometryPointComponent } from './geom/geometrypoint.component';
import { GeometryCircleComponent } from './geom/geometrycircle.component';
import { ViewComponent } from './view.component';
import { OverlayComponent } from './overlay.component';
@Component({
selector: 'aol-coordinate',
template: ` <div class="aol-coordinate"></div> `,
})
export class CoordinateComponent implements OnChanges, OnInit {
@Input()
x: number;
@Input()
y: number;
@Input()
srid = 'EPSG:3857';
private host: any;
private mapSrid = 'EPSG:3857';
constructor(
private map: MapComponent,
@Optional() viewHost: ViewComponent,
@Optional() geometryPointHost: GeometryPointComponent,
@Optional() geometryCircleHost: GeometryCircleComponent,
@Optional() overlayHost: OverlayComponent
) {
// console.log('instancing aol-coordinate');
if (geometryPointHost !== null) {
this.host = geometryPointHost;
} else if (geometryCircleHost !== null) {
this.host = geometryCircleHost;
} else if (viewHost !== null) {
this.host = viewHost;
} else if (overlayHost !== null) {
this.host = overlayHost;
}
}
ngOnInit() {
this.map.instance.on('change:view', (e) => this.onMapViewChanged(e));
this.mapSrid = this.map.instance.getView().getProjection().getCode();
this.transformCoordinates();
}
ngOnChanges(changes: SimpleChanges) {
this.transformCoordinates();
}
private onMapViewChanged(event) {
this.mapSrid = event.target.get(event.key).getProjection().getCode();
this.transformCoordinates();
}
private transformCoordinates() {
let transformedCoordinates: number[];
if (this.srid === this.mapSrid) {
transformedCoordinates = [this.x, this.y];
} else {
transformedCoordinates = transform([this.x, this.y], this.srid, this.mapSrid);
}
switch (this.host.componentType) {
case 'geometry-point':
this.host.instance.setCoordinates(transformedCoordinates);
break;
case 'geometry-circle':
case 'view':
this.host.instance.setCenter(transformedCoordinates);
break;
case 'overlay':
this.host.instance.setPosition(transformedCoordinates);
break;
}
}
}

View File

@@ -0,0 +1,35 @@
import { Component, OnInit, OnDestroy, OnChanges, Input, SimpleChanges } from '@angular/core';
import { Feature } from 'ol';
import { SourceVectorComponent } from './sources/vector.component';
@Component({
selector: 'aol-feature',
template: ` <ng-content></ng-content> `,
})
export class FeatureComponent implements OnInit, OnDestroy, OnChanges {
@Input()
id: string | number | undefined;
public componentType = 'feature';
public instance: Feature;
constructor(private host: SourceVectorComponent) {}
ngOnInit() {
this.instance = new Feature();
if (this.id !== undefined) {
this.instance.setId(this.id);
}
this.host.instance.addFeature(this.instance);
}
ngOnDestroy() {
this.host.instance.removeFeature(this.instance);
}
ngOnChanges(changes: SimpleChanges) {
if (this.instance) {
this.instance.setId(this.id);
}
}
}

View File

@@ -0,0 +1,6 @@
import Feature from 'ol/format/Feature';
export class FormatComponent {
public instance: Feature;
public componentType = 'format';
}

View File

@@ -0,0 +1,27 @@
import { Component, forwardRef, Input } from '@angular/core';
import { FormatComponent } from './format.component';
import { MVT } from 'ol/format';
import { FeatureClass } from 'ol/Feature';
@Component({
selector: 'aol-format-mvt',
template: '',
providers: [{ provide: FormatComponent, useExisting: forwardRef(() => FormatMVTComponent) }],
})
export class FormatMVTComponent extends FormatComponent {
@Input()
featureClass: FeatureClass;
@Input()
geometryName: string;
@Input()
layerName: string;
@Input()
layers: string[];
instance: MVT;
constructor() {
super();
this.instance = new MVT(this);
}
}

View File

@@ -0,0 +1,28 @@
import { Component, Input, OnInit } from '@angular/core';
import { FeatureComponent } from '../feature.component';
import { Circle } from 'ol/geom';
import { SimpleGeometryComponent } from './simplegeometry.component';
import { MapComponent } from '../map.component';
@Component({
selector: 'aol-geometry-circle',
template: ` <ng-content></ng-content> `,
})
export class GeometryCircleComponent extends SimpleGeometryComponent implements OnInit {
@Input()
get radius(): number {
return this.instance.getRadius();
}
set radius(radius: number) {
this.instance.setRadius(radius);
}
public componentType = 'geometry-circle';
public instance: Circle;
constructor(map: MapComponent, host: FeatureComponent) {
super(map, host);
// defaulting coordinates to [0,0]. To be overridden in child component.
this.instance = new Circle([0, 0]);
}
}

View File

@@ -0,0 +1,26 @@
import { Component, OnInit } from '@angular/core';
import { FeatureComponent } from '../feature.component';
import { SimpleGeometryComponent } from './simplegeometry.component';
import { MapComponent } from '../map.component';
import { LineString } from 'ol/geom';
@Component({
selector: 'aol-geometry-linestring',
template: ` <ng-content></ng-content> `,
})
export class GeometryLinestringComponent extends SimpleGeometryComponent implements OnInit {
public componentType = 'geometry-linestring';
public instance: LineString;
constructor(map: MapComponent, host: FeatureComponent) {
super(map, host);
}
ngOnInit() {
this.instance = new LineString([
[0, 0],
[1, 1],
]);
super.ngOnInit();
}
}

View File

@@ -0,0 +1,28 @@
import { Component, OnInit } from '@angular/core';
import { FeatureComponent } from '../feature.component';
import { SimpleGeometryComponent } from './simplegeometry.component';
import { MapComponent } from '../map.component';
import { MultiLineString } from 'ol/geom';
@Component({
selector: 'aol-geometry-multilinestring',
template: ` <ng-content></ng-content> `,
})
export class GeometryMultiLinestringComponent extends SimpleGeometryComponent implements OnInit {
public componentType = 'geometry-multilinestring';
public instance: MultiLineString;
constructor(map: MapComponent, host: FeatureComponent) {
super(map, host);
}
ngOnInit() {
this.instance = new MultiLineString([
[
[0, 0],
[1, 1],
],
]);
super.ngOnInit();
}
}

View File

@@ -0,0 +1,26 @@
import { Component, OnInit } from '@angular/core';
import { FeatureComponent } from '../feature.component';
import { SimpleGeometryComponent } from './simplegeometry.component';
import { MapComponent } from '../map.component';
import { MultiPoint } from 'ol/geom';
@Component({
selector: 'aol-geometry-multipoint',
template: ` <ng-content></ng-content> `,
})
export class GeometryMultiPointComponent extends SimpleGeometryComponent implements OnInit {
public componentType = 'geometry-multipoint';
public instance: MultiPoint;
constructor(map: MapComponent, host: FeatureComponent) {
super(map, host);
}
ngOnInit() {
this.instance = new MultiPoint([
[0, 0],
[1, 1],
]);
super.ngOnInit();
}
}

View File

@@ -0,0 +1,31 @@
import { Component, OnInit } from '@angular/core';
import { FeatureComponent } from '../feature.component';
import { SimpleGeometryComponent } from './simplegeometry.component';
import { MapComponent } from '../map.component';
import { MultiPolygon } from 'ol/geom';
@Component({
selector: 'aol-geometry-multipolygon',
template: ` <ng-content></ng-content> `,
})
export class GeometryMultiPolygonComponent extends SimpleGeometryComponent implements OnInit {
public componentType = 'geometry-multipolygon';
public instance: MultiPolygon;
constructor(map: MapComponent, host: FeatureComponent) {
super(map, host);
}
ngOnInit() {
this.instance = new MultiPolygon([
[
[
[0, 0],
[1, 1],
[0, 1],
],
],
]);
super.ngOnInit();
}
}

View File

@@ -0,0 +1,23 @@
import { Component, OnInit } from '@angular/core';
import { FeatureComponent } from '../feature.component';
import { SimpleGeometryComponent } from './simplegeometry.component';
import { MapComponent } from '../map.component';
import { Point } from 'ol/geom';
@Component({
selector: 'aol-geometry-point',
template: ` <ng-content></ng-content> `,
})
export class GeometryPointComponent extends SimpleGeometryComponent implements OnInit {
public componentType = 'geometry-point';
public instance: Point;
constructor(map: MapComponent, host: FeatureComponent) {
super(map, host);
}
ngOnInit() {
this.instance = new Point([0, 0]);
super.ngOnInit();
}
}

View File

@@ -0,0 +1,29 @@
import { Component, OnInit } from '@angular/core';
import { FeatureComponent } from '../feature.component';
import { SimpleGeometryComponent } from './simplegeometry.component';
import { MapComponent } from '../map.component';
import { Polygon } from 'ol/geom';
@Component({
selector: 'aol-geometry-polygon',
template: ` <ng-content></ng-content> `,
})
export class GeometryPolygonComponent extends SimpleGeometryComponent implements OnInit {
public componentType = 'geometry-polygon';
public instance: Polygon;
constructor(map: MapComponent, host: FeatureComponent) {
super(map, host);
}
ngOnInit() {
this.instance = new Polygon([
[
[0, 0],
[1, 1],
[0, 1],
],
]);
super.ngOnInit();
}
}

View File

@@ -0,0 +1,22 @@
import { Input, OnInit, Directive } from '@angular/core';
import { FeatureComponent } from '../feature.component';
import { MapComponent } from '../map.component';
import SimpleGeometry from 'ol/geom/SimpleGeometry';
@Directive()
// eslint-disable-next-line @angular-eslint/directive-class-suffix
export abstract class SimpleGeometryComponent implements OnInit {
@Input() srid: string;
public instance: SimpleGeometry;
public componentType = 'simple-geometry';
protected constructor(
protected map: MapComponent,
protected host: FeatureComponent
) {}
ngOnInit() {
this.host.instance.setGeometry(this.instance);
}
}

View File

@@ -0,0 +1,57 @@
import { Component, Input, AfterContentInit, OnChanges, SimpleChanges, OnDestroy } from '@angular/core';
import { Graticule } from 'ol';
import { Stroke } from 'ol/style';
import { MapComponent } from './map.component';
@Component({
selector: 'aol-graticule',
template: '<ng-content></ng-content>',
})
export class GraticuleComponent implements AfterContentInit, OnChanges, OnDestroy {
@Input()
strokeStyle: Stroke;
@Input()
showLabels: boolean;
@Input()
lonLabelPosition: number;
@Input()
latLabelPosition: number;
instance: any;
public componentType = 'graticule';
constructor(private map: MapComponent) {}
ngOnChanges(changes: SimpleChanges) {
const properties: { [index: string]: any } = {};
if (!this.instance) {
return;
}
for (const key in changes) {
if (changes.hasOwnProperty(key)) {
properties[key] = changes[key].currentValue;
}
}
if (properties) {
this.instance = new Graticule(properties);
}
this.instance.setMap(this.map.instance);
}
ngAfterContentInit(): void {
this.instance = new Graticule({
strokeStyle: this.strokeStyle,
showLabels: this.showLabels,
lonLabelPosition: this.lonLabelPosition,
latLabelPosition: this.latLabelPosition,
});
this.instance.setMap(this.map.instance);
}
ngOnDestroy(): void {
this.instance.setMap(null);
}
}

View File

@@ -0,0 +1,46 @@
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
import { defaults, Interaction } from 'ol/interaction';
import { Collection } from 'ol';
import { MapComponent } from '../map.component';
@Component({
selector: 'aol-interaction-default',
template: '',
})
export class DefaultInteractionComponent implements OnInit, OnDestroy {
@Input()
altShiftDragRotate: boolean;
@Input()
onFocusOnly: boolean;
@Input()
doubleClickZoom: boolean;
@Input()
keyboard: boolean;
@Input()
mouseWheelZoom: boolean;
@Input()
shiftDragZoom: boolean;
@Input()
dragPan: boolean;
@Input()
pinchRotate: boolean;
@Input()
pinchZoom: boolean;
@Input()
zoomDelta: number;
@Input()
zoomDuration: number;
instance: Collection<Interaction>;
constructor(private map: MapComponent) {}
ngOnInit() {
this.instance = defaults(this);
this.instance.forEach((i) => this.map.instance.addInteraction(i));
}
ngOnDestroy() {
this.instance.forEach((i) => this.map.instance.removeInteraction(i));
}
}

View File

@@ -0,0 +1,27 @@
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
import { DoubleClickZoom } from 'ol/interaction';
import { MapComponent } from '../map.component';
@Component({
selector: 'aol-interaction-doubleclickzoom',
template: '',
})
export class DoubleClickZoomInteractionComponent implements OnInit, OnDestroy {
@Input()
duration: number;
@Input()
delta: number;
instance: DoubleClickZoom;
constructor(private map: MapComponent) {}
ngOnInit() {
this.instance = new DoubleClickZoom(this);
this.map.instance.addInteraction(this.instance);
}
ngOnDestroy() {
this.map.instance.removeInteraction(this.instance);
}
}

View File

@@ -0,0 +1,31 @@
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
import { DragAndDrop } from 'ol/interaction';
import FeatureFormat from 'ol/format/Feature';
import { MapComponent } from '../map.component';
import { ProjectionLike } from 'ol/proj';
@Component({
selector: 'aol-interaction-draganddrop',
template: '',
})
export class DragAndDropInteractionComponent implements OnInit, OnDestroy {
@Input()
formatConstructors: FeatureFormat[];
@Input()
projection: ProjectionLike;
@Input()
target: HTMLElement;
instance: DragAndDrop;
constructor(private map: MapComponent) {}
ngOnInit() {
this.instance = new DragAndDrop(this);
this.map.instance.addInteraction(this.instance);
}
ngOnDestroy() {
this.map.instance.removeInteraction(this.instance);
}
}

View File

@@ -0,0 +1,31 @@
import { Component, OnDestroy, OnInit, Input } from '@angular/core';
import { DragBox } from 'ol/interaction';
import { MapComponent } from '../map.component';
import { Condition } from 'ol/events/condition';
import { EndCondition } from 'ol/interaction/DragBox';
@Component({
selector: 'aol-interaction-dragbox',
template: '',
})
export class DragBoxInteractionComponent implements OnInit, OnDestroy {
@Input()
className: string;
@Input()
condition: Condition;
@Input()
boxEndCondition: EndCondition;
instance: DragBox;
constructor(private map: MapComponent) {}
ngOnInit() {
this.instance = new DragBox(this);
this.map.instance.addInteraction(this.instance);
}
ngOnDestroy() {
this.map.instance.removeInteraction(this.instance);
}
}

View File

@@ -0,0 +1,29 @@
import { Component, OnDestroy, OnInit, Input } from '@angular/core';
import { DragPan } from 'ol/interaction';
import Kinetic from 'ol/Kinetic';
import { MapComponent } from '../map.component';
import { Condition } from 'ol/events/condition';
@Component({
selector: 'aol-interaction-dragpan',
template: '',
})
export class DragPanInteractionComponent implements OnInit, OnDestroy {
@Input()
condition: Condition;
@Input()
kinetic: Kinetic;
instance: DragPan;
constructor(private map: MapComponent) {}
ngOnInit() {
this.instance = new DragPan(this);
this.map.instance.addInteraction(this.instance);
}
ngOnDestroy() {
this.map.instance.removeInteraction(this.instance);
}
}

View File

@@ -0,0 +1,28 @@
import { Component, OnDestroy, OnInit, Input } from '@angular/core';
import { DragRotate } from 'ol/interaction';
import { MapComponent } from '../map.component';
import { Condition } from 'ol/events/condition';
@Component({
selector: 'aol-interaction-dragrotate',
template: '',
})
export class DragRotateInteractionComponent implements OnInit, OnDestroy {
@Input()
condition: Condition;
@Input()
duration: number;
instance: DragRotate;
constructor(private map: MapComponent) {}
ngOnInit() {
this.instance = new DragRotate(this);
this.map.instance.addInteraction(this.instance);
}
ngOnDestroy() {
this.map.instance.removeInteraction(this.instance);
}
}

View File

@@ -0,0 +1,28 @@
import { Component, OnDestroy, OnInit, Input } from '@angular/core';
import { DragRotateAndZoom } from 'ol/interaction';
import { MapComponent } from '../map.component';
import { Condition } from 'ol/events/condition';
@Component({
selector: 'aol-interaction-dragrotateandzoom',
template: '',
})
export class DragRotateAndZoomInteractionComponent implements OnInit, OnDestroy {
@Input()
condition: Condition;
@Input()
duration: number;
instance: DragRotateAndZoom;
constructor(private map: MapComponent) {}
ngOnInit() {
this.instance = new DragRotateAndZoom(this);
this.map.instance.addInteraction(this.instance);
}
ngOnDestroy() {
this.map.instance.removeInteraction(this.instance);
}
}

View File

@@ -0,0 +1,32 @@
import { Component, OnDestroy, OnInit, Input } from '@angular/core';
import { DragZoom } from 'ol/interaction';
import { MapComponent } from '../map.component';
import { Condition } from 'ol/events/condition';
@Component({
selector: 'aol-interaction-dragzoom',
template: '',
})
export class DragZoomInteractionComponent implements OnInit, OnDestroy {
@Input()
className: string;
@Input()
condition: Condition;
@Input()
duration: number;
@Input()
out: boolean;
instance: DragZoom;
constructor(private map: MapComponent) {}
ngOnInit() {
this.instance = new DragZoom(this);
this.map.instance.addInteraction(this.instance);
}
ngOnDestroy() {
this.map.instance.removeInteraction(this.instance);
}
}

View File

@@ -0,0 +1,84 @@
import { Component, Input, OnDestroy, OnInit, EventEmitter, Output } from '@angular/core';
import { MapComponent } from '../map.component';
import { Draw } from 'ol/interaction';
import { Collection, Feature } from 'ol';
import { Vector } from 'ol/source';
import { Style } from 'ol/style';
import { DrawEvent, GeometryFunction } from 'ol/interaction/Draw';
import { StyleFunction } from 'ol/style/Style';
import { Condition } from 'ol/events/condition';
import { Type } from 'ol/geom/Geometry';
import { ObjectEvent } from 'ol/Object';
import BaseEvent from 'ol/events/Event';
@Component({
selector: 'aol-interaction-draw',
template: '',
})
export class DrawInteractionComponent implements OnInit, OnDestroy {
@Input()
clickTolerance?: number;
@Input()
features?: Collection<Feature>;
@Input()
source?: Vector;
@Input()
snapTolerance?: number;
@Input()
type: Type;
@Input()
maxPoints?: number;
@Input()
minPoints?: number;
@Input()
finishCondition?: Condition;
@Input()
style?: Style | Style[] | StyleFunction;
@Input()
geometryFunction?: GeometryFunction;
@Input()
geometryName?: string;
@Input()
condition?: Condition;
@Input()
freehandCondition?: Condition;
@Input()
freehand?: boolean;
@Input()
wrapX?: boolean;
@Output()
olChange = new EventEmitter<DrawEvent>();
@Output()
olChangeActive = new EventEmitter<ObjectEvent>();
@Output()
olDrawAbort = new EventEmitter<DrawEvent>();
@Output()
drawEnd = new EventEmitter<DrawEvent>();
@Output()
drawStart = new EventEmitter<DrawEvent>();
@Output()
olError = new EventEmitter<BaseEvent>();
@Output()
propertyChange = new EventEmitter<ObjectEvent>();
instance: Draw;
constructor(private map: MapComponent) {}
ngOnInit() {
this.instance = new Draw(this);
this.instance.on('change', (event: DrawEvent) => this.olChange.emit(event));
this.instance.on('change:active', (event: ObjectEvent) => this.olChangeActive.emit(event));
this.instance.on('drawabort', (event: DrawEvent) => this.olDrawAbort.emit(event));
this.instance.on('drawend', (event: DrawEvent) => this.drawEnd.emit(event));
this.instance.on('drawstart', (event: DrawEvent) => this.drawStart.emit(event));
this.instance.on('error', (event: BaseEvent) => this.olError.emit(event));
this.instance.on('propertychange', (event: ObjectEvent) => this.propertyChange.emit(event));
this.map.instance.addInteraction(this.instance);
}
ngOnDestroy() {
this.map.instance.removeInteraction(this.instance);
}
}

View File

@@ -0,0 +1,27 @@
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
import { KeyboardPan } from 'ol/interaction';
import { MapComponent } from '../map.component';
@Component({
selector: 'aol-interaction-keyboardpan',
template: '',
})
export class KeyboardPanInteractionComponent implements OnInit, OnDestroy {
@Input()
duration: number;
@Input()
pixelDelta: number;
instance: KeyboardPan;
constructor(private map: MapComponent) {}
ngOnInit() {
this.instance = new KeyboardPan(this);
this.map.instance.addInteraction(this.instance);
}
ngOnDestroy() {
this.map.instance.removeInteraction(this.instance);
}
}

View File

@@ -0,0 +1,27 @@
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
import { KeyboardZoom } from 'ol/interaction';
import { MapComponent } from '../map.component';
@Component({
selector: 'aol-interaction-keyboardpan',
template: '',
})
export class KeyboardZoomInteractionComponent implements OnInit, OnDestroy {
@Input()
duration: number;
@Input()
delta: number;
instance: KeyboardZoom;
constructor(private map: MapComponent) {}
ngOnInit() {
this.instance = new KeyboardZoom(this);
this.map.instance.addInteraction(this.instance);
}
ngOnDestroy() {
this.map.instance.removeInteraction(this.instance);
}
}

View File

@@ -0,0 +1,65 @@
import { Component, OnDestroy, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { MapComponent } from '../map.component';
import { Modify } from 'ol/interaction';
import { Collection, Feature } from 'ol';
import { Style } from 'ol/style';
import { Vector } from 'ol/source';
import { ModifyEvent } from 'ol/interaction/Modify';
import { StyleFunction } from 'ol/style/Style';
import { Condition } from 'ol/events/condition';
import { ObjectEvent } from 'ol/Object';
import { DrawEvent } from 'ol/interaction/Draw';
import BaseEvent from 'ol/events/Event';
@Component({
selector: 'aol-interaction-modify',
template: '',
})
export class ModifyInteractionComponent implements OnInit, OnDestroy {
@Input()
condition?: Condition;
@Input()
deleteCondition?: Condition;
@Input()
pixelTolerance?: number;
@Input()
style?: Style | Style[] | StyleFunction;
@Input()
features: Collection<Feature>;
@Input()
wrapX?: boolean;
@Input()
source?: Vector;
@Output()
olChange = new EventEmitter<DrawEvent>();
@Output()
olChangeActive = new EventEmitter<ObjectEvent>();
@Output()
olError = new EventEmitter<BaseEvent>();
@Output()
olModifyEnd = new EventEmitter<ModifyEvent>();
@Output()
olModifyStart = new EventEmitter<ModifyEvent>();
@Output()
propertyChange = new EventEmitter<ObjectEvent>();
instance: Modify;
constructor(private map: MapComponent) {}
ngOnInit() {
this.instance = new Modify(this);
this.instance.on('change', (event: DrawEvent) => this.olChange.emit(event));
this.instance.on('change:active', (event: ObjectEvent) => this.olChangeActive.emit(event));
this.instance.on('error', (event: BaseEvent) => this.olError.emit(event));
this.instance.on('modifyend', (event: ModifyEvent) => this.olModifyEnd.emit(event));
this.instance.on('modifystart', (event: ModifyEvent) => this.olModifyStart.emit(event));
this.instance.on('propertychange', (event: ObjectEvent) => this.propertyChange.emit(event));
this.map.instance.addInteraction(this.instance);
}
ngOnDestroy() {
this.map.instance.removeInteraction(this.instance);
}
}

View File

@@ -0,0 +1,29 @@
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
import { MouseWheelZoom } from 'ol/interaction';
import { MapComponent } from '../map.component';
@Component({
selector: 'aol-interaction-mousewheelzoom',
template: '',
})
export class MouseWheelZoomInteractionComponent implements OnInit, OnDestroy {
@Input()
duration: number;
@Input()
timeout: number;
@Input()
useAnchor: boolean;
instance: MouseWheelZoom;
constructor(private map: MapComponent) {}
ngOnInit() {
this.instance = new MouseWheelZoom(this);
this.map.instance.addInteraction(this.instance);
}
ngOnDestroy() {
this.map.instance.removeInteraction(this.instance);
}
}

View File

@@ -0,0 +1,27 @@
import { Component, OnDestroy, OnInit, Input } from '@angular/core';
import { PinchZoom } from 'ol/interaction';
import { MapComponent } from '../map.component';
@Component({
selector: 'aol-interaction-pinchzoom',
template: '',
})
export class PinchZoomInteractionComponent implements OnInit, OnDestroy {
@Input()
duration: number;
@Input()
constrainResolution: boolean;
instance: PinchZoom;
constructor(private map: MapComponent) {}
ngOnInit() {
this.instance = new PinchZoom(this);
this.map.instance.addInteraction(this.instance);
}
ngOnDestroy() {
this.map.instance.removeInteraction(this.instance);
}
}

View File

@@ -0,0 +1,68 @@
import { Component, OnDestroy, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { MapComponent } from '../map.component';
import { Select } from 'ol/interaction';
import { Layer } from 'ol/layer';
import { Style } from 'ol/style';
import { Collection, Feature } from 'ol';
import { SelectEvent, FilterFunction } from 'ol/interaction/Select';
import { StyleFunction } from 'ol/style/Style';
import { Condition } from 'ol/events/condition';
import { ObjectEvent } from 'ol/Object';
import BaseEvent from 'ol/events/Event';
@Component({
selector: 'aol-interaction-select',
template: '',
})
export class SelectInteractionComponent implements OnInit, OnDestroy {
@Input()
addCondition?: Condition;
@Input()
condition?: Condition;
@Input()
layers?: Layer[] | ((layer: Layer) => boolean);
@Input()
style?: Style | Style[] | StyleFunction;
@Input()
removeCondition?: Condition;
@Input()
toggleCondition?: Condition;
@Input()
multi?: boolean;
@Input()
features?: Collection<Feature>;
@Input()
filter?: FilterFunction;
@Input()
wrapX?: boolean;
@Output()
olChange = new EventEmitter<SelectEvent>();
@Output()
olChangeActive = new EventEmitter<ObjectEvent>();
@Output()
olError = new EventEmitter<BaseEvent>();
@Output()
propertyChange = new EventEmitter<ObjectEvent>();
@Output()
olSelect = new EventEmitter<SelectEvent>();
instance: Select;
constructor(private map: MapComponent) {}
ngOnInit() {
this.instance = new Select(this);
this.instance.on('change', (event: SelectEvent) => this.olChange.emit(event));
this.instance.on('change:active', (event: ObjectEvent) => this.olChangeActive.emit(event));
this.instance.on('error', (event: BaseEvent) => this.olError.emit(event));
this.instance.on('propertychange', (event: ObjectEvent) => this.propertyChange.emit(event));
this.instance.on('select', (event: SelectEvent) => this.olSelect.emit(event));
this.map.instance.addInteraction(this.instance);
}
ngOnDestroy() {
this.map.instance.removeInteraction(this.instance);
}
}

View File

@@ -0,0 +1,58 @@
import { Component, OnDestroy, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { Translate } from 'ol/interaction';
import { Collection, Feature } from 'ol';
import { Layer } from 'ol/layer';
import { TranslateEvent } from 'ol/interaction/Translate';
import { MapComponent } from '../map.component';
import BaseEvent from 'ol/events/Event';
import { ObjectEvent } from 'ol/Object';
@Component({
selector: 'aol-interaction-translate',
template: '',
})
export class TranslateInteractionComponent implements OnInit, OnDestroy {
@Input()
features?: Collection<Feature>;
@Input()
layers?: Layer[] | ((layer: Layer) => boolean);
@Input()
hitTolerance?: number;
@Output()
olChange = new EventEmitter<BaseEvent>();
@Output()
olChangeActive = new EventEmitter<ObjectEvent>();
@Output()
olError = new EventEmitter<BaseEvent>();
@Output()
propertyChange = new EventEmitter<ObjectEvent>();
@Output()
translateEnd = new EventEmitter<TranslateEvent>();
@Output()
translateStart = new EventEmitter<TranslateEvent>();
@Output()
translating = new EventEmitter<TranslateEvent>();
instance: Translate;
constructor(private map: MapComponent) {}
ngOnInit() {
this.instance = new Translate(this);
this.instance.on('change', (event: BaseEvent) => this.olChange.emit(event));
this.instance.on('change:active', (event: ObjectEvent) => this.olChangeActive.emit(event));
this.instance.on('error', (event: BaseEvent) => this.olError.emit(event));
this.instance.on('propertychange', (event: ObjectEvent) => this.propertyChange.emit(event));
this.instance.on('translateend', (event: TranslateEvent) => this.translateEnd.emit(event));
this.instance.on('translatestart', (event: TranslateEvent) => this.translateStart.emit(event));
this.instance.on('translating', (event: TranslateEvent) => this.translating.emit(event));
this.map.instance.addInteraction(this.instance);
}
ngOnDestroy() {
this.map.instance.removeInteraction(this.instance);
}
}

View File

@@ -0,0 +1,68 @@
import { OnDestroy, OnInit, OnChanges, Input, SimpleChanges, Directive } from '@angular/core';
import Event from 'ol/events/Event';
import { MapComponent } from '../map.component';
import { LayerGroupComponent } from './layergroup.component';
import { Extent } from 'ol/extent';
@Directive()
// eslint-disable-next-line @angular-eslint/directive-class-suffix
export abstract class LayerComponent implements OnInit, OnChanges, OnDestroy {
@Input()
opacity: number;
@Input()
visible: boolean;
@Input()
extent: Extent;
@Input()
zIndex: number;
@Input()
minResolution: number;
@Input()
maxResolution: number;
@Input()
prerender: (evt: Event) => void;
@Input()
postrender: (evt: Event) => void;
public instance: any;
public componentType = 'layer';
protected constructor(protected host: MapComponent | LayerGroupComponent) {}
ngOnInit() {
if (this.prerender !== null && this.prerender !== undefined) {
this.instance.on('prerender', this.prerender);
}
if (this.postrender !== null && this.postrender !== undefined) {
this.instance.on('postrender', this.postrender);
}
this.host.instance.getLayers().push(this.instance);
}
ngOnDestroy() {
this.host.instance.getLayers().remove(this.instance);
}
ngOnChanges(changes: SimpleChanges) {
const properties: { [index: string]: any } = {};
if (!this.instance) {
return;
}
for (const key in changes) {
if (changes.hasOwnProperty(key)) {
properties[key] = changes[key].currentValue;
if (key === 'prerender') {
this.instance.un('prerender', changes[key].previousValue);
this.instance.on('prerender', changes[key].currentValue);
}
if (key === 'postrender') {
this.instance.un('postrender', changes[key].previousValue);
this.instance.on('postrender', changes[key].currentValue);
}
}
}
// console.log('changes detected in aol-layer, setting new properties: ', properties);
this.instance.setProperties(properties, false);
}
}

View File

@@ -0,0 +1,27 @@
import { Component, OnDestroy, OnInit, SkipSelf, Optional } from '@angular/core';
import { Group } from 'ol/layer';
import { LayerComponent } from './layer.component';
import { MapComponent } from '../map.component';
@Component({
selector: 'aol-layer-group',
template: ` <ng-content></ng-content> `,
})
export class LayerGroupComponent extends LayerComponent implements OnInit, OnDestroy {
public instance: Group;
constructor(
map: MapComponent,
@SkipSelf()
@Optional()
group?: LayerGroupComponent
) {
super(group || map);
}
ngOnInit() {
// console.log(`creating ol.layer.Group instance with:`, this);
this.instance = new Group(this);
super.ngOnInit();
}
}

View File

@@ -0,0 +1,38 @@
import { Component, Input, OnChanges, OnInit, Optional, SimpleChanges } from '@angular/core';
import { Image } from 'ol/layer';
import { MapComponent } from '../map.component';
import { LayerComponent } from './layer.component';
import { LayerGroupComponent } from './layergroup.component';
import { Extent } from 'ol/extent';
@Component({
selector: 'aol-layer-image',
template: ` <ng-content></ng-content> `,
})
export class LayerImageComponent extends LayerComponent implements OnInit, OnChanges {
@Input()
opacity: number;
@Input()
visible: boolean;
@Input()
extent: Extent;
@Input()
minResolution: number;
@Input()
maxResolution: number;
@Input()
zIndex: number;
constructor(map: MapComponent, @Optional() group?: LayerGroupComponent) {
super(group || map);
}
ngOnInit() {
this.instance = new Image(this);
super.ngOnInit();
}
ngOnChanges(changes: SimpleChanges) {
super.ngOnChanges(changes);
}
}

View File

@@ -0,0 +1,30 @@
import { Component, OnDestroy, OnInit, Input, Optional, OnChanges, SimpleChanges } from '@angular/core';
import { Tile } from 'ol/layer';
import { MapComponent } from '../map.component';
import { LayerComponent } from './layer.component';
import { LayerGroupComponent } from './layergroup.component';
@Component({
selector: 'aol-layer-tile',
template: ` <ng-content></ng-content> `,
})
export class LayerTileComponent extends LayerComponent implements OnInit, OnDestroy, OnChanges {
@Input()
preload: number;
@Input()
useInterimTilesOnError: boolean;
constructor(map: MapComponent, @Optional() group?: LayerGroupComponent) {
super(group || map);
}
ngOnInit() {
// console.log('creating ol.layer.Tile instance with:', this);
this.instance = new Tile(this);
super.ngOnInit();
}
ngOnChanges(changes: SimpleChanges) {
super.ngOnChanges(changes);
}
}

View File

@@ -0,0 +1,39 @@
import { Component, OnDestroy, OnInit, Input, Optional, OnChanges, SimpleChanges } from '@angular/core';
import { MapComponent } from '../map.component';
import { Vector } from 'ol/layer';
import { Style } from 'ol/style';
import { StyleFunction } from 'ol/style/Style';
import { LayerComponent } from './layer.component';
import { LayerGroupComponent } from './layergroup.component';
@Component({
selector: 'aol-layer-vector',
template: ` <ng-content></ng-content> `,
})
export class LayerVectorComponent extends LayerComponent implements OnInit, OnDestroy, OnChanges {
@Input()
renderBuffer: number;
@Input()
style: Style | Style[] | StyleFunction;
@Input()
updateWhileAnimating: boolean;
@Input()
updateWhileInteracting: boolean;
constructor(map: MapComponent, @Optional() group?: LayerGroupComponent) {
super(group || map);
}
ngOnInit() {
// console.log('creating ol.layer.Vector instance with:', this);
this.instance = new Vector(this);
super.ngOnInit();
}
ngOnChanges(changes: SimpleChanges) {
super.ngOnChanges(changes);
}
}

View File

@@ -0,0 +1,44 @@
import { Component, OnInit, Input, Optional, SimpleChanges, OnChanges } from '@angular/core';
import { VectorTile } from 'ol/layer';
import { Feature } from 'ol';
import { Style } from 'ol/style';
import { MapComponent } from '../map.component';
import { LayerComponent } from './layer.component';
import { LayerGroupComponent } from './layergroup.component';
import { StyleFunction } from 'ol/style/Style';
@Component({
selector: 'aol-layer-vectortile',
template: ` <ng-content></ng-content> `,
})
export class LayerVectorTileComponent extends LayerComponent implements OnInit, OnChanges {
@Input()
renderBuffer: number;
@Input()
renderMode: any | string;
/* not marked as optional in the typings */
@Input()
renderOrder: (feature1: Feature, feature2: Feature) => number;
@Input()
style: Style | Style[] | StyleFunction;
@Input()
updateWhileAnimating: boolean;
@Input()
updateWhileInteracting: boolean;
@Input()
visible: boolean;
constructor(map: MapComponent, @Optional() group?: LayerGroupComponent) {
super(group || map);
}
ngOnInit() {
// console.log('creating ol.layer.VectorTile instance with:', this);
this.instance = new VectorTile(this);
super.ngOnInit();
}
ngOnChanges(changes: SimpleChanges) {
super.ngOnChanges(changes);
}
}

View File

@@ -0,0 +1,142 @@
import {
Component,
OnInit,
ElementRef,
Input,
Output,
EventEmitter,
AfterViewInit,
SimpleChanges,
OnChanges,
} from '@angular/core';
import { Map } from 'ol';
import MapBrowserEvent from 'ol/MapBrowserEvent';
import MapEvent from 'ol/MapEvent';
import { ObjectEvent } from 'ol/Object';
import RenderEvent from 'ol/render/Event';
import { Control } from 'ol/control';
import { Interaction } from 'ol/interaction';
import { DrawEvent } from 'ol/interaction/Draw';
import BaseEvent from 'ol/events/Event';
@Component({
selector: 'aol-map',
template: `
<div [style.width]="width" [style.height]="height"></div>
<ng-content></ng-content>
`,
})
export class MapComponent implements OnInit, AfterViewInit, OnChanges {
@Input()
width = '100%';
@Input()
height = '100%';
@Input()
pixelRatio: number;
@Input()
keyboardEventTarget: HTMLElement | string;
@Input()
loadTilesWhileAnimating: boolean;
@Input()
loadTilesWhileInteracting: boolean;
@Input()
logo: string | boolean;
@Input()
renderer: 'canvas' | 'webgl';
@Output()
olChange = new EventEmitter<DrawEvent>();
@Output()
olChangeLayerGroup = new EventEmitter<ObjectEvent>();
@Output()
olChangeSize = new EventEmitter<ObjectEvent>();
@Output()
olChangeTarget = new EventEmitter<ObjectEvent>();
@Output()
olChangeView = new EventEmitter<ObjectEvent>();
@Output()
olClick = new EventEmitter<MapBrowserEvent<MouseEvent>>();
@Output()
dblClick = new EventEmitter<MapBrowserEvent<MouseEvent>>();
@Output()
olError = new EventEmitter<BaseEvent>();
@Output()
loadEnd = new EventEmitter<MapEvent>();
@Output()
loadStart = new EventEmitter<MapEvent>();
@Output()
moveEnd = new EventEmitter<MapEvent>();
@Output()
moveStart = new EventEmitter<MapEvent>();
@Output()
pointerDrag = new EventEmitter<MapBrowserEvent<MouseEvent>>();
@Output()
pointerMove = new EventEmitter<MapBrowserEvent<MouseEvent>>();
@Output()
olPostCompose = new EventEmitter<RenderEvent>();
@Output()
olPostRender = new EventEmitter<RenderEvent>();
@Output()
olPreCompose = new EventEmitter<RenderEvent>();
@Output()
olPropertyChange = new EventEmitter<ObjectEvent>();
@Output()
postRender = new EventEmitter<MapEvent>();
@Output()
propertyChange = new EventEmitter<ObjectEvent>();
@Output()
singleClick = new EventEmitter<MapBrowserEvent<MouseEvent>>();
public instance: Map;
public componentType = 'map';
// we pass empty arrays to not get default controls/interactions because we have our own directives
controls: Control[] = [];
interactions: Interaction[] = [];
constructor(private host: ElementRef) {}
ngOnInit() {
// console.log('creating ol.Map instance with:', this);
this.instance = new Map(this);
this.instance.setTarget(this.host.nativeElement.firstElementChild);
this.instance.on('change', (event: DrawEvent) => this.olChange.emit(event));
this.instance.on('change:layergroup', (event: ObjectEvent) => this.olChangeLayerGroup.emit(event));
this.instance.on('change:size', (event: ObjectEvent) => this.olChangeSize.emit(event));
this.instance.on('change:target', (event: ObjectEvent) => this.olChangeTarget.emit(event));
this.instance.on('change:view', (event: ObjectEvent) => this.olChangeView.emit(event));
this.instance.on('click', (event: MapBrowserEvent<MouseEvent>) => this.olClick.emit(event));
this.instance.on('dblclick', (event: MapBrowserEvent<MouseEvent>) => this.dblClick.emit(event));
this.instance.on('error', (event: BaseEvent) => this.olError.emit(event));
this.instance.on('loadend', (event: MapEvent) => this.loadEnd.emit(event));
this.instance.on('loadstart', (event: MapEvent) => this.loadStart.emit(event));
this.instance.on('moveend', (event: MapEvent) => this.moveEnd.emit(event));
this.instance.on('movestart', (event: MapEvent) => this.moveStart.emit(event));
this.instance.on('pointerdrag', (event: MapBrowserEvent<MouseEvent>) => this.pointerDrag.emit(event));
this.instance.on('pointermove', (event: MapBrowserEvent<MouseEvent>) => this.pointerMove.emit(event));
this.instance.on('postcompose', (event: RenderEvent) => this.olPostCompose.emit(event));
this.instance.on('postrender', (event: RenderEvent) => this.olPostRender.emit(event));
this.instance.on('postrender', (event: MapEvent) => this.postRender.emit(event));
this.instance.on('precompose', (event: RenderEvent) => this.olPreCompose.emit(event));
this.instance.on('propertychange', (event: ObjectEvent) => this.olPropertyChange.emit(event));
this.instance.on('singleclick', (event: MapBrowserEvent<MouseEvent>) => this.singleClick.emit(event));
}
ngOnChanges(changes: SimpleChanges) {
const properties: { [index: string]: any } = {};
if (!this.instance) {
return;
}
for (const key in changes) {
if (changes.hasOwnProperty(key)) {
properties[key] = changes[key].currentValue;
}
}
// console.log('changes detected in aol-map, setting new properties: ', properties);
this.instance.setProperties(properties, false);
}
ngAfterViewInit() {
this.instance.updateSize();
}
}

View File

@@ -0,0 +1,50 @@
import { Component, ContentChild, Input, OnDestroy, OnInit } from '@angular/core';
import { MapComponent } from './map.component';
import Overlay, { PanOptions, Positioning } from 'ol/Overlay';
import { ContentComponent } from './content.component';
@Component({
selector: 'aol-overlay',
template: '<ng-content></ng-content>',
})
export class OverlayComponent implements OnInit, OnDestroy {
@ContentChild(ContentComponent, { static: true })
content: ContentComponent;
@Input()
id: number | string;
@Input()
offset: number[];
@Input()
positioning: Positioning;
@Input()
stopEvent: boolean;
@Input()
insertFirst: boolean;
@Input()
autoPan: boolean;
@Input()
autoPanAnimation: PanOptions;
@Input()
autoPanMargin: number;
componentType = 'overlay';
instance: Overlay;
element: HTMLElement;
constructor(private map: MapComponent) {}
ngOnInit() {
if (this.content) {
this.element = this.content.elementRef.nativeElement;
this.instance = new Overlay(this);
this.map.instance.addOverlay(this.instance);
}
}
ngOnDestroy() {
if (this.instance) {
this.map.instance.removeOverlay(this.instance);
}
}
}

View File

@@ -0,0 +1,42 @@
import { Component, Host, Input, OnInit, forwardRef } from '@angular/core';
import { BingMaps } from 'ol/source';
import { SourceComponent } from './source.component';
import { LayerTileComponent } from '../layers/layertile.component';
import { LoadFunction } from 'ol/Tile';
@Component({
selector: 'aol-source-bingmaps',
template: ` <div class="aol-source-bingmaps"></div> `,
providers: [{ provide: SourceComponent, useExisting: forwardRef(() => SourceBingmapsComponent) }],
})
export class SourceBingmapsComponent extends SourceComponent implements OnInit {
@Input()
cacheSize: number;
@Input()
hidpi: boolean;
@Input()
culture: string;
@Input()
key: string;
@Input()
imagerySet: 'Road' | 'Aerial' | 'AerialWithLabels' | 'collinsBart' | 'ordnanceSurvey' = 'Aerial';
@Input()
maxZoom: number;
@Input()
reprojectionErrorThreshold: number;
@Input()
tileLoadFunction: LoadFunction;
@Input()
wrapX: boolean;
instance: BingMaps;
constructor(@Host() layer: LayerTileComponent) {
super(layer);
}
ngOnInit() {
this.instance = new BingMaps(this);
this.host.instance.setSource(this.instance);
}
}

View File

@@ -0,0 +1,54 @@
import {
AfterContentInit,
Component,
ContentChild,
forwardRef,
Host,
Input,
OnChanges,
SimpleChanges,
} from '@angular/core';
import { Feature } from 'ol';
import { Point } from 'ol/geom';
import { Cluster, Vector } from 'ol/source';
import { LayerVectorComponent } from '../layers/layervector.component';
import { SourceComponent } from './source.component';
import { SourceVectorComponent } from './vector.component';
@Component({
selector: 'aol-source-cluster',
template: ` <ng-content></ng-content> `,
providers: [{ provide: SourceComponent, useExisting: forwardRef(() => SourceClusterComponent) }],
})
export class SourceClusterComponent extends SourceComponent implements AfterContentInit, OnChanges {
@Input()
distance: number;
@Input()
geometryFunction?: (feature: Feature) => Point;
@Input()
wrapX?: boolean;
@ContentChild(SourceVectorComponent, { static: false })
sourceVectorComponent: SourceVectorComponent;
instance: Cluster;
source: Vector;
constructor(@Host() layer: LayerVectorComponent) {
super(layer);
}
ngAfterContentInit() {
this.source = this.sourceVectorComponent.instance;
this.instance = new Cluster(this);
this.host.instance.setSource(this.instance);
}
ngOnChanges(changes: SimpleChanges) {
if (this.instance && changes.hasOwnProperty('distance')) {
this.instance.setDistance(this.distance);
}
}
}

View File

@@ -0,0 +1,36 @@
import { Component, Host, Input, OnInit, forwardRef } from '@angular/core';
import { LayerVectorComponent } from '../layers/layervector.component';
import { SourceComponent } from './source.component';
import FeatureFormat from 'ol/format/Feature';
import { Vector } from 'ol/source';
import { GeoJSON } from 'ol/format';
import { ProjectionLike } from 'ol/proj';
@Component({
selector: 'aol-source-geojson',
template: ` <ng-content></ng-content> `,
providers: [{ provide: SourceComponent, useExisting: forwardRef(() => SourceGeoJSONComponent) }],
})
export class SourceGeoJSONComponent extends SourceComponent implements OnInit {
@Input()
defaultDataProjection: ProjectionLike;
@Input()
featureProjection: ProjectionLike;
@Input()
geometryName: string;
@Input()
url: string;
instance: Vector;
format: FeatureFormat;
constructor(@Host() layer: LayerVectorComponent) {
super(layer);
}
ngOnInit() {
this.format = new GeoJSON(this);
this.instance = new Vector(this);
this.host.instance.setSource(this.instance);
}
}

View File

@@ -0,0 +1,62 @@
import {
Component,
EventEmitter,
forwardRef,
Host,
Input,
OnChanges,
OnInit,
Output,
SimpleChanges,
} from '@angular/core';
import ImageArcGISRest from 'ol/source/ImageArcGISRest';
import { LayerImageComponent } from '../layers/layerimage.component';
import { SourceComponent } from './source.component';
import { ProjectionLike } from 'ol/proj';
import { AttributionLike } from 'ol/source/Source';
import { LoadFunction } from 'ol/Image';
import { ImageSourceEvent } from 'ol/source/Image';
@Component({
selector: 'aol-source-imagearcgisrest',
template: ` <ng-content></ng-content> `,
providers: [{ provide: SourceComponent, useExisting: forwardRef(() => SourceImageArcGISRestComponent) }],
})
export class SourceImageArcGISRestComponent extends SourceComponent implements OnInit, OnChanges {
@Input() projection: ProjectionLike | string;
@Input() url: string;
@Input() attributions: AttributionLike;
@Input() crossOrigin?: string;
@Input() imageLoadFunction?: LoadFunction;
@Input() params?: { [k: string]: any };
@Input() ratio = 1.5;
@Input() resolutions?: number[];
@Input() wrapX?: boolean;
@Output()
imageLoadStart = new EventEmitter<ImageSourceEvent>();
@Output()
imageLoadEnd = new EventEmitter<ImageSourceEvent>();
@Output()
imageLoadError = new EventEmitter<ImageSourceEvent>();
instance: ImageArcGISRest;
constructor(@Host() layer: LayerImageComponent) {
super(layer);
}
ngOnInit() {
this.instance = new ImageArcGISRest(this);
this.host.instance.setSource(this.instance);
this.instance.on('imageloadstart', (event: ImageSourceEvent) => this.imageLoadStart.emit(event));
this.instance.on('imageloadend', (event: ImageSourceEvent) => this.imageLoadEnd.emit(event));
this.instance.on('imageloaderror', (event: ImageSourceEvent) => this.imageLoadError.emit(event));
}
ngOnChanges(changes: SimpleChanges) {
if (this.instance && changes.hasOwnProperty('params')) {
this.instance.updateParams(this.params);
}
}
}

View File

@@ -0,0 +1,88 @@
import {
Component,
Host,
Input,
forwardRef,
Output,
EventEmitter,
OnChanges,
SimpleChanges,
OnInit,
} from '@angular/core';
import { ImageStatic } from 'ol/source';
import { SourceComponent } from './source.component';
import { LayerImageComponent } from '../layers/layerimage.component';
import { ProjectionLike } from 'ol/proj';
import { Extent } from 'ol/extent';
import { AttributionLike } from 'ol/source/Source';
import { LoadFunction } from 'ol/Image';
import { Size } from 'ol/size';
import { ImageSourceEvent } from 'ol/source/Image';
@Component({
selector: 'aol-source-imagestatic',
template: ` <ng-content></ng-content> `,
providers: [{ provide: SourceComponent, useExisting: forwardRef(() => SourceImageStaticComponent) }],
})
export class SourceImageStaticComponent extends SourceComponent implements OnInit, OnChanges {
@Input()
projection: ProjectionLike | string;
@Input()
imageExtent: Extent;
@Input()
url: string;
@Input()
attributions: AttributionLike;
@Input()
crossOrigin?: string;
@Input()
imageLoadFunction?: LoadFunction;
@Input()
imageSize?: Size;
@Output()
imageLoadStart = new EventEmitter<ImageSourceEvent>();
@Output()
imageLoadEnd = new EventEmitter<ImageSourceEvent>();
@Output()
imageLoadError = new EventEmitter<ImageSourceEvent>();
instance: ImageStatic;
constructor(@Host() layer: LayerImageComponent) {
super(layer);
}
setLayerSource(): void {
this.instance = new ImageStatic(this);
this.host.instance.setSource(this.instance);
this.instance.on('imageloadstart', (event: ImageSourceEvent) => this.imageLoadStart.emit(event));
this.instance.on('imageloadend', (event: ImageSourceEvent) => this.imageLoadEnd.emit(event));
this.instance.on('imageloaderror', (event: ImageSourceEvent) => this.imageLoadError.emit(event));
}
ngOnInit() {
this.setLayerSource();
}
ngOnChanges(changes: SimpleChanges) {
const properties: { [index: string]: any } = {};
if (!this.instance) {
return;
}
for (const key in changes) {
if (changes.hasOwnProperty(key)) {
switch (key) {
case 'url':
this.url = changes[key].currentValue;
this.setLayerSource();
break;
default:
break;
}
properties[key] = changes[key].currentValue;
}
}
this.instance.setProperties(properties, false);
}
}

View File

@@ -0,0 +1,74 @@
import {
Component,
Host,
Input,
OnChanges,
OnInit,
forwardRef,
SimpleChanges,
Output,
EventEmitter,
} from '@angular/core';
import { ImageWMS } from 'ol/source';
import { LayerImageComponent } from '../layers/layerimage.component';
import { SourceComponent } from './source.component';
import { ProjectionLike } from 'ol/proj';
import { AttributionLike } from 'ol/source/Source';
import { LoadFunction } from 'ol/Image';
import { ImageSourceEvent } from 'ol/source/Image';
import { ServerType } from 'ol/source/wms';
@Component({
selector: 'aol-source-imagewms',
template: ` <ng-content></ng-content> `,
providers: [{ provide: SourceComponent, useExisting: forwardRef(() => SourceImageWMSComponent) }],
})
export class SourceImageWMSComponent extends SourceComponent implements OnChanges, OnInit {
@Input()
attributions: AttributionLike;
@Input()
crossOrigin: string;
@Input()
hidpi: boolean;
@Input()
serverType: ServerType;
@Input()
imageLoadFunction?: LoadFunction;
@Input()
params: { [key: string]: any };
@Input()
projection: ProjectionLike | string;
@Input()
ratio: number;
@Input()
resolutions: Array<number>;
@Input()
url: string;
@Output()
imageLoadStart = new EventEmitter<ImageSourceEvent>();
@Output()
imageLoadEnd = new EventEmitter<ImageSourceEvent>();
@Output()
imageLoadError = new EventEmitter<ImageSourceEvent>();
instance: ImageWMS;
constructor(@Host() layer: LayerImageComponent) {
super(layer);
}
ngOnInit() {
this.instance = new ImageWMS(this);
this.host.instance.setSource(this.instance);
this.instance.on('imageloadstart', (event: ImageSourceEvent) => this.imageLoadStart.emit(event));
this.instance.on('imageloadend', (event: ImageSourceEvent) => this.imageLoadEnd.emit(event));
this.instance.on('imageloaderror', (event: ImageSourceEvent) => this.imageLoadError.emit(event));
}
ngOnChanges(changes: SimpleChanges) {
if (this.instance && changes.hasOwnProperty('params')) {
this.instance.updateParams(this.params);
}
}
}

View File

@@ -0,0 +1,62 @@
import { AfterContentInit, Component, EventEmitter, forwardRef, Host, Input, Optional, Output } from '@angular/core';
import { OSM } from 'ol/source';
import { AttributionLike } from 'ol/source/Source';
import { TileSourceEvent } from 'ol/source/Tile';
import { LoadFunction } from 'ol/Tile';
import { LayerTileComponent } from '../layers/layertile.component';
import { SourceComponent } from './source.component';
import { SourceXYZComponent } from './xyz.component';
@Component({
selector: 'aol-source-osm',
template: ` <div class="aol-source-osm"></div> `,
providers: [{ provide: SourceComponent, useExisting: forwardRef(() => SourceOsmComponent) }],
})
export class SourceOsmComponent extends SourceXYZComponent implements AfterContentInit {
@Input()
attributions: AttributionLike;
@Input()
cacheSize: number;
@Input()
crossOrigin: string;
@Input()
maxZoom: number;
@Input()
opaque: boolean;
@Input()
reprojectionErrorThreshold: number;
@Input()
tileLoadFunction: LoadFunction;
@Input()
url: string;
@Input()
wrapX: boolean;
@Output()
tileLoadStart = new EventEmitter<TileSourceEvent>();
@Output()
tileLoadEnd = new EventEmitter<TileSourceEvent>();
@Output()
tileLoadError = new EventEmitter<TileSourceEvent>();
instance: OSM;
constructor(
@Optional()
@Host()
protected layer?: LayerTileComponent
) {
super(layer);
}
ngAfterContentInit() {
if (this.tileGridXYZ) {
this.tileGrid = this.tileGridXYZ.instance;
}
this.instance = new OSM(this);
this.instance.on('tileloadstart', (event: TileSourceEvent) => this.tileLoadStart.emit(event));
this.instance.on('tileloadend', (event: TileSourceEvent) => this.tileLoadEnd.emit(event));
this.instance.on('tileloaderror', (event: TileSourceEvent) => this.tileLoadError.emit(event));
this.register(this.instance);
}
}

View File

@@ -0,0 +1,68 @@
import {
AfterContentInit,
Component,
ContentChild,
EventEmitter,
forwardRef,
Host,
Input,
Output,
} from '@angular/core';
import { Raster, Source } from 'ol/source';
import { Operation, RasterSourceEvent } from 'ol/source/Raster';
import { LayerImageComponent } from '../layers/layerimage.component';
import { SourceComponent } from './source.component';
@Component({
selector: 'aol-source-raster',
template: ` <ng-content></ng-content> `,
providers: [
{
provide: SourceComponent,
useExisting: forwardRef(() => SourceRasterComponent),
},
],
})
export class SourceRasterComponent extends SourceComponent implements AfterContentInit {
@Input()
operation?: Operation;
@Input()
threads?: number;
@Input()
lib?: any;
@Input()
operationType?: 'pixel' | 'image';
@Output()
beforeOperations = new EventEmitter<RasterSourceEvent>();
@Output()
afterOperations = new EventEmitter<RasterSourceEvent>();
instance: Raster;
sources: Source[] = [];
@ContentChild(SourceComponent, { static: false })
set source(sourceComponent: SourceComponent) {
this.sources = [sourceComponent.instance];
if (this.instance) {
// Openlayer doesn't handle sources update. Just recreate Raster instance.
this.init();
}
}
constructor(@Host() layer: LayerImageComponent) {
super(layer);
}
ngAfterContentInit() {
this.init();
}
init() {
this.instance = new Raster(this);
this.instance.on('beforeoperations', (event: RasterSourceEvent) => this.beforeOperations.emit(event));
this.instance.on('afteroperations', (event: RasterSourceEvent) => this.afterOperations.emit(event));
this.register(this.instance);
}
}

View File

@@ -0,0 +1,28 @@
import { Input, OnDestroy, Directive } from '@angular/core';
import Source from 'ol/source/Source';
import { LayerComponent } from '../layers/layer.component';
@Directive()
// eslint-disable-next-line @angular-eslint/directive-class-suffix
export abstract class SourceComponent implements OnDestroy {
@Input()
attributions: any;
public instance: Source;
public componentType = 'source';
protected constructor(protected host: LayerComponent) {}
ngOnDestroy() {
if (this.host && this.host.instance) {
this.host.instance.setSource(null);
}
}
protected register(s: Source) {
if (this.host) {
this.host.instance.setSource(s);
}
}
}

View File

@@ -0,0 +1,25 @@
import { Component, Host, Input, OnInit, forwardRef } from '@angular/core';
import { TileJSON } from 'ol/source';
import { LayerTileComponent } from '../layers/layertile.component';
import { SourceComponent } from './source.component';
@Component({
selector: 'aol-source-tilejson',
template: ` <ng-content></ng-content> `,
providers: [{ provide: SourceComponent, useExisting: forwardRef(() => SourceTileJSONComponent) }],
})
export class SourceTileJSONComponent extends SourceComponent implements OnInit {
@Input()
url: string;
instance: TileJSON;
constructor(@Host() layer: LayerTileComponent) {
super(layer);
}
ngOnInit() {
this.instance = new TileJSON(this);
this.host.instance.setSource(this.instance);
}
}

View File

@@ -0,0 +1,58 @@
import { Component, Host, Input, OnChanges, OnInit, forwardRef, SimpleChanges } from '@angular/core';
import { LayerTileComponent } from '../layers/layertile.component';
import { SourceComponent } from './source.component';
import { TileWMS } from 'ol/source';
import TileGrid from 'ol/tilegrid/TileGrid';
import { LoadFunction } from 'ol/Tile';
import { ServerType } from 'ol/source/wms';
@Component({
selector: 'aol-source-tilewms',
template: ` <ng-content></ng-content> `,
providers: [{ provide: SourceComponent, useExisting: forwardRef(() => SourceTileWMSComponent) }],
})
export class SourceTileWMSComponent extends SourceComponent implements OnChanges, OnInit {
@Input()
cacheSize: number;
@Input()
crossOrigin: string;
@Input()
gutter: number;
@Input()
hidpi: boolean;
@Input()
params: { [key: string]: any };
@Input()
projection: string;
@Input()
reprojectionErrorThreshold: number;
@Input()
serverType: ServerType;
@Input()
tileGrid: TileGrid;
@Input()
tileLoadFunction: LoadFunction;
@Input()
url: string;
@Input()
urls: string[];
@Input()
wrapX: boolean;
instance: TileWMS;
constructor(@Host() layer: LayerTileComponent) {
super(layer);
}
ngOnInit() {
this.instance = new TileWMS(this);
this.host.instance.setSource(this.instance);
}
ngOnChanges(changes: SimpleChanges) {
if (this.instance && changes.hasOwnProperty('params')) {
this.instance.updateParams(this.params);
}
}
}

View File

@@ -0,0 +1,117 @@
import {
Component,
Host,
Input,
forwardRef,
AfterContentInit,
ContentChild,
SimpleChanges,
OnChanges,
Output,
EventEmitter,
} from '@angular/core';
import { LayerTileComponent } from '../layers/layertile.component';
import { SourceComponent } from './source.component';
import { TileGridWMTSComponent } from '../tilegridwmts.component';
import { WMTS as SourceWMTS } from 'ol/source';
import WMTS from 'ol/tilegrid/WMTS';
import { ProjectionLike } from 'ol/proj';
import { LoadFunction } from 'ol/Tile';
import { TileSourceEvent } from 'ol/source/Tile';
import { RequestEncoding } from 'ol/source/WMTS';
@Component({
selector: 'aol-source-tilewmts',
template: ` <ng-content></ng-content> `,
providers: [{ provide: SourceComponent, useExisting: forwardRef(() => SourceTileWMTSComponent) }],
})
export class SourceTileWMTSComponent extends SourceComponent implements AfterContentInit, OnChanges {
@Input()
cacheSize?: number;
@Input()
crossOrigin?: string;
@Input()
tileGrid: WMTS;
@Input()
projection: ProjectionLike;
@Input()
reprojectionErrorThreshold?: number;
@Input()
requestEncoding?: RequestEncoding | undefined;
@Input()
layer: string;
@Input()
style: string;
@Input()
tileClass?: any;
@Input()
tilePixelRatio?: number;
@Input()
version?: string;
@Input()
format?: string;
@Input()
matrixSet: string;
@Input()
dimensions?: any;
@Input()
url?: string;
@Input()
tileLoadFunction?: LoadFunction;
@Input()
urls?: string[];
@Input()
wrapX?: boolean;
@Output()
tileLoadStart = new EventEmitter<TileSourceEvent>();
@Output()
tileLoadEnd = new EventEmitter<TileSourceEvent>();
@Output()
tileLoadError = new EventEmitter<TileSourceEvent>();
@ContentChild(TileGridWMTSComponent, { static: false })
tileGridWMTS: TileGridWMTSComponent;
instance: SourceWMTS;
constructor(@Host() layer: LayerTileComponent) {
super(layer);
}
ngOnChanges(changes: SimpleChanges) {
const properties: { [index: string]: any } = {};
if (!this.instance) {
return;
}
for (const key in changes) {
if (changes.hasOwnProperty(key)) {
switch (key) {
case 'url':
this.url = changes[key].currentValue;
this.setLayerSource();
break;
default:
break;
}
properties[key] = changes[key].currentValue;
}
}
this.instance.setProperties(properties, false);
}
setLayerSource(): void {
this.instance = new SourceWMTS(this);
this.instance.on('tileloadstart', (event: TileSourceEvent) => this.tileLoadStart.emit(event));
this.instance.on('tileloadend', (event: TileSourceEvent) => this.tileLoadEnd.emit(event));
this.instance.on('tileloaderror', (event: TileSourceEvent) => this.tileLoadError.emit(event));
this.host.instance.setSource(this.instance);
}
ngAfterContentInit(): void {
if (this.tileGridWMTS) {
this.tileGrid = this.tileGridWMTS.instance;
this.setLayerSource();
}
}
}

View File

@@ -0,0 +1,26 @@
import { Component, Host, Input, OnInit, forwardRef } from '@angular/core';
import { SourceComponent } from './source.component';
import { LayerTileComponent } from '../layers/layertile.component';
import { UTFGrid } from 'ol/source';
import { Config } from 'ol/source/TileJSON';
@Component({
selector: 'aol-source-utfgrid',
template: ` <ng-content></ng-content> `,
providers: [{ provide: SourceComponent, useExisting: forwardRef(() => SourceUTFGridComponent) }],
})
export class SourceUTFGridComponent extends SourceComponent implements OnInit {
@Input() tileJSON: Config;
@Input() url: string;
instance: UTFGrid;
constructor(@Host() layer: LayerTileComponent) {
super(layer);
}
ngOnInit() {
this.instance = new UTFGrid(this);
this.host.instance.setSource(this.instance);
}
}

View File

@@ -0,0 +1,37 @@
import { Component, Host, Input, OnInit, forwardRef } from '@angular/core';
import { Vector } from 'ol/source';
import Feature from 'ol/format/Feature';
import { LayerVectorComponent } from '../layers/layervector.component';
import { SourceComponent } from './source.component';
import { LoadingStrategy } from 'ol/source/Vector';
@Component({
selector: 'aol-source-vector',
template: ` <ng-content></ng-content> `,
providers: [{ provide: SourceComponent, useExisting: forwardRef(() => SourceVectorComponent) }],
})
export class SourceVectorComponent extends SourceComponent implements OnInit {
@Input()
overlaps: boolean;
@Input()
useSpatialIndex: boolean;
@Input()
wrapX: boolean;
@Input()
url: string;
@Input()
format: Feature;
@Input()
strategy: LoadingStrategy;
instance: Vector;
constructor(@Host() layer: LayerVectorComponent) {
super(layer);
}
ngOnInit() {
this.instance = new Vector(this);
this.host.instance.setSource(this.instance);
}
}

View File

@@ -0,0 +1,56 @@
import { Component, Host, Input, forwardRef, ContentChild, AfterContentInit } from '@angular/core';
import { VectorTile } from 'ol/source';
import Feature from 'ol/format/Feature';
import TileGrid from 'ol/tilegrid/TileGrid';
import { LayerVectorTileComponent } from '../layers/layervectortile.component';
import { FormatComponent } from '../formats/format.component';
import { TileGridComponent } from '../tilegrid.component';
import { SourceComponent } from './source.component';
import { ProjectionLike } from 'ol/proj';
import { UrlFunction } from 'ol/Tile';
@Component({
selector: 'aol-source-vectortile',
template: ` <ng-content></ng-content> `,
providers: [{ provide: SourceComponent, useExisting: forwardRef(() => SourceVectorTileComponent) }],
})
export class SourceVectorTileComponent extends SourceComponent implements AfterContentInit {
@Input()
cacheSize: number;
@Input()
overlaps: boolean;
@Input()
projection: ProjectionLike;
@Input()
tilePixelRatio: number;
@Input()
tileUrlFunction: UrlFunction;
@Input()
url: string;
@Input()
urls: string[];
@Input()
wrapX: boolean;
@ContentChild(FormatComponent, { static: false })
formatComponent: FormatComponent;
@ContentChild(TileGridComponent, { static: false })
tileGridComponent: TileGridComponent;
public instance: VectorTile;
format: Feature;
tileGrid: TileGrid;
constructor(@Host() layer: LayerVectorTileComponent) {
super(layer);
}
/* need the children to construct the OL3 object */
ngAfterContentInit() {
this.format = this.formatComponent.instance;
this.tileGrid = this.tileGridComponent.instance;
// console.log('creating ol.source.VectorTile instance with:', this);
this.instance = new VectorTile(this);
this.host.instance.setSource(this.instance);
}
}

View File

@@ -0,0 +1,115 @@
import {
AfterContentInit,
Component,
ContentChild,
EventEmitter,
forwardRef,
Host,
Input,
OnChanges,
Optional,
Output,
SimpleChanges,
} from '@angular/core';
import { Size } from 'ol/size';
import { XYZ } from 'ol/source';
import { TileSourceEvent } from 'ol/source/Tile';
import { LoadFunction, UrlFunction } from 'ol/Tile';
import TileGrid from 'ol/tilegrid/TileGrid';
import { LayerTileComponent } from '../layers/layertile.component';
import { TileGridComponent } from '../tilegrid.component';
import { SourceComponent } from './source.component';
@Component({
selector: 'aol-source-xyz',
template: ` <ng-content></ng-content> `,
providers: [{ provide: SourceComponent, useExisting: forwardRef(() => SourceXYZComponent) }],
})
export class SourceXYZComponent extends SourceComponent implements AfterContentInit, OnChanges {
@Input()
cacheSize: number;
@Input()
crossOrigin: string;
@Input()
opaque: boolean;
@Input()
projection: string;
@Input()
reprojectionErrorThreshold: number;
@Input()
minZoom: number;
@Input()
maxZoom: number;
@Input()
tileGrid: TileGrid;
@Input()
tileLoadFunction?: LoadFunction;
@Input()
tilePixelRatio: number;
@Input()
tileSize: number | Size;
@Input()
tileUrlFunction?: UrlFunction;
@Input()
url: string;
@Input()
urls: string[];
@Input()
wrapX: boolean;
@ContentChild(TileGridComponent, { static: false })
tileGridXYZ: TileGridComponent;
@Output()
tileLoadStart = new EventEmitter<TileSourceEvent>();
@Output()
tileLoadEnd = new EventEmitter<TileSourceEvent>();
@Output()
tileLoadError = new EventEmitter<TileSourceEvent>();
instance: XYZ;
constructor(
@Optional()
@Host()
protected layer?: LayerTileComponent
) {
super(layer);
}
ngAfterContentInit() {
if (this.tileGridXYZ) {
this.tileGrid = this.tileGridXYZ.instance;
}
this.init();
}
ngOnChanges(changes: SimpleChanges) {
const properties: { [index: string]: any } = {};
if (!this.instance) {
return;
}
for (const key in changes) {
if (changes.hasOwnProperty(key)) {
properties[key] = changes[key].currentValue;
}
}
this.instance.setProperties(properties, false);
if (changes.hasOwnProperty('url')) {
this.init();
}
}
init() {
this.instance = new XYZ(this);
this.instance.on('tileloadstart', (event: TileSourceEvent) => this.tileLoadStart.emit(event));
this.instance.on('tileloadend', (event: TileSourceEvent) => this.tileLoadEnd.emit(event));
this.instance.on('tileloaderror', (event: TileSourceEvent) => this.tileLoadError.emit(event));
this.register(this.instance);
}
}

View File

@@ -0,0 +1,58 @@
import { Component, Input, Host, AfterContentInit, OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
import { Circle, Fill, Stroke } from 'ol/style';
import { StyleComponent } from './style.component';
@Component({
selector: 'aol-style-circle',
template: ` <ng-content></ng-content> `,
})
export class StyleCircleComponent implements AfterContentInit, OnChanges, OnDestroy {
@Input()
fill: Fill;
@Input()
radius: number;
@Input()
snapToPixel: boolean;
@Input()
stroke: Stroke;
public componentType = 'style-circle';
public instance: Circle;
constructor(@Host() private host: StyleComponent) {}
/**
* WORK-AROUND: since the re-rendering is not triggered on style change
* we trigger a radius change.
* see openlayers #6233 and #5775
*/
update() {
if (!!this.instance) {
// console.log('setting ol.style.Circle instance\'s radius');
this.instance.setRadius(this.radius);
}
this.host.update();
}
ngAfterContentInit() {
// console.log('creating ol.style.Circle instance with: ', this);
this.instance = new Circle(this);
this.host.instance.setImage(this.instance);
this.host.update();
}
ngOnChanges(changes: SimpleChanges) {
if (!this.instance) {
return;
}
if (changes.radius) {
this.instance.setRadius(changes.radius.currentValue);
}
// console.log('changes detected in aol-style-circle, setting new radius: ', changes['radius'].currentValue);
}
ngOnDestroy() {
// console.log('removing aol-style-circle');
this.host.instance.setImage(null);
}
}

View File

@@ -0,0 +1,68 @@
import { Component, Input, Optional, OnInit, OnChanges, SimpleChanges } from '@angular/core';
import { Fill } from 'ol/style';
import { StyleComponent } from './style.component';
import { StyleCircleComponent } from './circle.component';
import { StyleTextComponent } from './text.component';
import { Color } from 'ol/color';
import { ColorLike } from 'ol/colorlike';
@Component({
selector: 'aol-style-fill',
template: ` <div class="aol-style-fill"></div> `,
})
export class StyleFillComponent implements OnInit, OnChanges {
@Input()
color: Color | ColorLike;
public instance: Fill;
private readonly host: StyleComponent | StyleCircleComponent | StyleTextComponent;
constructor(
@Optional() styleHost: StyleComponent,
@Optional() styleCircleHost: StyleCircleComponent,
@Optional() styleTextHost: StyleTextComponent
) {
if (!styleHost) {
throw new Error('aol-style-stroke must be a descendant of aol-style');
}
if (!!styleTextHost) {
this.host = styleTextHost;
} else if (!!styleCircleHost) {
this.host = styleCircleHost;
} else {
this.host = styleHost;
}
// console.log('creating aol-style-fill with: ', this);
}
ngOnInit() {
// console.log('creating ol.style.Fill instance with: ', this);
this.instance = new Fill(this);
switch (this.host.componentType) {
case 'style':
this.host.instance.setFill(this.instance);
// console.log('setting ol.style instance\'s fill:', this.host);
break;
case 'style-text':
this.host.instance.setFill(this.instance);
break;
case 'style-circle':
(this.host as StyleCircleComponent).fill = this.instance;
// console.log('setting ol.style.circle instance\'s fill:', this.host);
break;
default:
throw new Error('unknown host type: ' + this.host);
}
}
ngOnChanges(changes: SimpleChanges) {
if (!this.instance) {
return;
}
if (changes.color) {
this.instance.setColor(changes.color.currentValue);
}
this.host.update();
// console.log('changes detected in aol-style-fill, setting new color: ', changes);
}
}

View File

@@ -0,0 +1,80 @@
import { Component, Input, Host, OnInit, OnChanges, SimpleChanges } from '@angular/core';
import { Icon } from 'ol/style';
// TODO https://github.com/openlayers/openlayers/issues/12694
// import IconAnchorUnits from 'ol/style/IconAnchorUnits';
// import IconOrigin from 'ol/style/IconOrigin';
import { StyleComponent } from './style.component';
import { IconAnchorUnits, IconOrigin } from 'ol/style/Icon';
@Component({
selector: 'aol-style-icon',
template: ` <div class="aol-style-icon"></div> `,
})
export class StyleIconComponent implements OnInit, OnChanges {
@Input()
anchor: [number, number];
@Input()
anchorXUnits: IconAnchorUnits;
@Input()
anchorYUnits: IconAnchorUnits;
@Input()
anchorOrigin: IconOrigin;
@Input()
color: [number, number, number, number];
@Input()
crossOrigin: IconOrigin;
@Input()
img: HTMLCanvasElement | HTMLImageElement;
@Input()
offset: [number, number];
@Input()
offsetOrigin: IconOrigin;
@Input()
opacity: number;
@Input()
scale: number;
@Input()
snapToPixel: boolean;
@Input()
rotateWithView: boolean;
@Input()
rotation: number;
@Input()
size: [number, number];
@Input()
imgSize: [number, number];
@Input()
src: string;
public instance: Icon;
constructor(@Host() private host: StyleComponent) {}
ngOnInit() {
// console.log('creating ol.style.Icon instance with: ', this);
this.instance = new Icon(this);
this.host.instance.setImage(this.instance);
}
ngOnChanges(changes: SimpleChanges) {
if (!this.instance) {
return;
}
if (changes.opacity) {
this.instance.setOpacity(changes.opacity.currentValue);
}
if (changes.rotation) {
this.instance.setRotation(changes.rotation.currentValue);
}
if (changes.scale) {
this.instance.setScale(changes.scale.currentValue);
}
if (changes.src) {
this.instance = new Icon(this);
this.host.instance.setImage(this.instance);
}
this.host.update();
// console.log('changes detected in aol-style-icon: ', changes);
}
}

View File

@@ -0,0 +1,95 @@
import { Component, Input, Optional, OnInit, OnChanges, SimpleChanges } from '@angular/core';
import { Stroke } from 'ol/style';
import { StyleComponent } from './style.component';
import { StyleCircleComponent } from './circle.component';
import { StyleTextComponent } from './text.component';
import { Color } from 'ol/color';
import { ColorLike } from 'ol/colorlike';
@Component({
selector: 'aol-style-stroke',
template: ` <div class="aol-style-stroke"></div> `,
})
export class StyleStrokeComponent implements OnInit, OnChanges {
@Input()
color: Color | ColorLike;
@Input()
lineCap: CanvasLineCap | undefined;
@Input()
lineDash: number[];
@Input()
lineJoin: CanvasLineJoin | undefined;
@Input()
miterLimit: number;
@Input()
width: number;
public instance: Stroke;
/* the typings do not have the setters */
private readonly host: StyleComponent | StyleCircleComponent | StyleTextComponent;
constructor(
@Optional() styleHost: StyleComponent,
@Optional() styleCircleHost: StyleCircleComponent,
@Optional() styleTextHost: StyleTextComponent
) {
if (!styleHost) {
throw new Error('aol-style-stroke must be a descendant of aol-style');
}
if (!!styleTextHost) {
this.host = styleTextHost;
} else if (!!styleCircleHost) {
this.host = styleCircleHost;
} else {
this.host = styleHost;
}
// console.log('creating aol-style-stroke with: ', this);
}
ngOnInit() {
// console.log('creating ol.style.Stroke instance with: ', this);
this.instance = new Stroke(this);
switch (this.host.componentType) {
case 'style':
this.host.instance.setStroke(this.instance);
// console.log('setting ol.style instance\'s stroke:', this.host);
break;
case 'style-text':
this.host.instance.setStroke(this.instance);
break;
case 'style-circle':
(this.host as StyleCircleComponent).stroke = this.instance;
// console.log('setting ol.style.circle instance\'s stroke:', this.host);
break;
default:
throw new Error('unknown host type: ' + this.host);
// break;
}
}
ngOnChanges(changes: SimpleChanges) {
if (!this.instance) {
return;
}
if (changes.color) {
this.instance.setColor(changes.color.currentValue);
}
if (changes.lineCap) {
this.instance.setLineCap(changes.lineCap.currentValue);
}
if (changes.lineDash) {
this.instance.setLineDash(changes.lineDash.currentValue);
}
if (changes.lineJoin) {
this.instance.setLineJoin(changes.lineJoin.currentValue);
}
if (changes.miterLimit) {
this.instance.setMiterLimit(changes.miterLimit.currentValue);
}
if (changes.width) {
this.instance.setWidth(changes.width.currentValue);
}
this.host.update();
// console.log('changes detected in aol-style-stroke, setting new properties: ', changes);
}
}

View File

@@ -0,0 +1,48 @@
import { Component, Input, Optional, OnInit } from '@angular/core';
import { Fill, Image, Stroke, Style, Text } from 'ol/style';
import { Geometry } from 'ol/geom';
import { FeatureComponent } from '../feature.component';
import { LayerVectorComponent } from '../layers/layervector.component';
import { GeometryFunction } from 'ol/style/Style';
@Component({
selector: 'aol-style',
template: ` <ng-content></ng-content> `,
})
export class StyleComponent implements OnInit {
@Input()
geometry: string | Geometry | GeometryFunction;
@Input()
fill: Fill;
@Input()
image: Image;
@Input()
stroke: Stroke;
@Input()
text: Text;
@Input()
zIndex: number;
public instance: Style;
public componentType = 'style';
private readonly host: FeatureComponent | LayerVectorComponent;
constructor(@Optional() featureHost: FeatureComponent, @Optional() layerHost: LayerVectorComponent) {
// console.log('creating aol-style');
this.host = !!featureHost ? featureHost : layerHost;
if (!this.host) {
throw new Error('aol-style must be applied to a feature or a layer');
}
}
update() {
// console.log('updating style\'s host: ', this.host);
this.host.instance.changed();
}
ngOnInit() {
// console.log('creating aol-style instance with: ', this);
this.instance = new Style(this);
this.host.instance.setStyle(this.instance);
}
}

Some files were not shown because too many files have changed in this diff Show More