Compare commits
7 Commits
2024.04
...
25935241a2
Author | SHA1 | Date | |
---|---|---|---|
25935241a2 | |||
56be829faa | |||
18381975ef | |||
bdd3d7fe4d | |||
6a23d1c9cf | |||
f45a873145 | |||
d771fd5530 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -51,5 +51,5 @@ projects/common-map/node_modules/
|
|||||||
.angular/*
|
.angular/*
|
||||||
projects/common-map3d/node_modules/
|
projects/common-map3d/node_modules/
|
||||||
projects/common-map/node_modules/
|
projects/common-map/node_modules/
|
||||||
projects/ng-openlayers/node_modules/
|
projects/ngx-openlayers/node_modules/
|
||||||
projects/common/node_modules/
|
projects/common/node_modules/
|
||||||
|
@@ -51,7 +51,7 @@ npm install -g @angular/cli
|
|||||||
npm install
|
npm install
|
||||||
ng serve
|
ng serve
|
||||||
```
|
```
|
||||||
*Go*`
|
*Go*
|
||||||
|
|
||||||
Point your browser to http://localhost:4200
|
Point your browser to http://localhost:4200
|
||||||
|
|
||||||
|
37
angular.json
37
angular.json
@@ -253,6 +253,43 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"ngx-openlayers": {
|
||||||
|
"projectType": "library",
|
||||||
|
"root": "projects/ngx-openlayers",
|
||||||
|
"sourceRoot": "projects/ngx-openlayers/src",
|
||||||
|
"prefix": "lib",
|
||||||
|
"architect": {
|
||||||
|
"build": {
|
||||||
|
"builder": "@angular-devkit/build-angular:ng-packagr",
|
||||||
|
"options": {
|
||||||
|
"tsConfig": "projects/ngx-openlayers/tsconfig.lib.json",
|
||||||
|
"project": "projects/ngx-openlayers/ng-package.json"
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"production": {
|
||||||
|
"tsConfig": "projects/ngx-openlayers/tsconfig.lib.prod.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"test": {
|
||||||
|
"builder": "@angular-devkit/build-angular:karma",
|
||||||
|
"options": {
|
||||||
|
"main": "projects/ngx-openlayers/src/test.ts",
|
||||||
|
"tsConfig": "projects/ngx-openlayers/tsconfig.spec.json",
|
||||||
|
"karmaConfig": "projects/ngx-openlayers/karma.conf.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"lint": {
|
||||||
|
"builder": "@angular-eslint/builder:lint",
|
||||||
|
"options": {
|
||||||
|
"lintFilePatterns": [
|
||||||
|
"projects/ngx-openlayers/**/*.ts",
|
||||||
|
"projects/ngx-openlayers/**/*.html"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"cli": {
|
"cli": {
|
||||||
|
21223
package-lock.json
generated
21223
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
66
package.json
66
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "farmmaps-lib-app",
|
"name": "farmmaps-lib-app",
|
||||||
"version": "4.5.0",
|
"version": "4.2.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
"start": "ng serve",
|
"start": "ng serve",
|
||||||
@@ -11,26 +11,26 @@
|
|||||||
},
|
},
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"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-eslint/eslint-plugin": "^15.2.1",
|
||||||
"@angular/forms": "^17.3.3",
|
"@angular/animations": "^16.2.12",
|
||||||
"@angular/platform-browser": "^17.3.3",
|
"@angular/common": "^16.2.12",
|
||||||
"@angular/platform-browser-dynamic": "^17.3.3",
|
"@angular/compiler": "^16.2.12",
|
||||||
"@angular/router": "^17.3.3",
|
"@angular/core": "^16.2.12",
|
||||||
|
"@angular/forms": "^16.2.12",
|
||||||
|
"@angular/platform-browser": "^16.2.12",
|
||||||
|
"@angular/platform-browser-dynamic": "^16.2.12",
|
||||||
|
"@angular/router": "^16.2.12",
|
||||||
"@farmmaps/common": "file:dist/common",
|
"@farmmaps/common": "file:dist/common",
|
||||||
"@farmmaps/common-map": "file:dist/common-map",
|
"@farmmaps/common-map": "file:dist/common-map",
|
||||||
"@farmmaps/common-map3d": "file:dist/common-map3d",
|
"@farmmaps/common-map3d": "file:dist/common-map3d",
|
||||||
"ng-openlayers": "17.1.3",
|
"ngx-openlayers": "file:dist/ngx-openlayers",
|
||||||
"@microsoft/signalr": "^3.1.16",
|
"@microsoft/signalr": "^3.1.16",
|
||||||
"@ng-bootstrap/ng-bootstrap": "^16.0.0",
|
"@ng-bootstrap/ng-bootstrap": "^15.0.0",
|
||||||
"@ngrx/effects": "^17",
|
"@ngrx/effects": "^16",
|
||||||
"@ngrx/router-store": "^17",
|
"@ngrx/router-store": "^16",
|
||||||
"@ngrx/store": "^17",
|
"@ngrx/store": "^16",
|
||||||
"@popperjs/core": "^2.11.6",
|
"@popperjs/core": "^2.11.6",
|
||||||
"angular-oauth2-oidc": "^13",
|
"angular-oauth2-oidc": "^16",
|
||||||
"assert": "^2.0.0",
|
"assert": "^2.0.0",
|
||||||
"bootstrap": "^5.2.0",
|
"bootstrap": "^5.2.0",
|
||||||
"browserify-zlib": "^0.2.0",
|
"browserify-zlib": "^0.2.0",
|
||||||
@@ -39,12 +39,12 @@
|
|||||||
"core-js": "^2.6.12",
|
"core-js": "^2.6.12",
|
||||||
"https-browserify": "^1.0.0",
|
"https-browserify": "^1.0.0",
|
||||||
"moment": "^2.29.4",
|
"moment": "^2.29.4",
|
||||||
"ngrx-store-localstorage": "17.0.0",
|
"ngrx-store-localstorage": "^16",
|
||||||
"ngx-avatars": "1.7.0",
|
"ngx-avatars": "^1.7.0",
|
||||||
"ngx-clipboard": "16.0.0",
|
"ngx-clipboard": "^15.0.1",
|
||||||
"ngx-image-cropper": "^7.2.1",
|
"ngx-image-cropper": "^6.0.0",
|
||||||
"ngx-uploadx": "^6.2.0",
|
"ngx-uploadx": "^5.2.0",
|
||||||
"ol": "^8.2.0",
|
"ol": "~6.3.1",
|
||||||
"olcs": "^2.13.1",
|
"olcs": "^2.13.1",
|
||||||
"resumablejs": "^1.1.0",
|
"resumablejs": "^1.1.0",
|
||||||
"rxjs": "^7.8.1",
|
"rxjs": "^7.8.1",
|
||||||
@@ -54,22 +54,22 @@
|
|||||||
"tslib": "^2.4.0",
|
"tslib": "^2.4.0",
|
||||||
"url": "^0.11.0",
|
"url": "^0.11.0",
|
||||||
"util": "^0.12.4",
|
"util": "^0.12.4",
|
||||||
"zone.js": "~0.14.4"
|
"zone.js": "~0.13.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular-builders/custom-webpack": "^17",
|
"@angular-builders/custom-webpack": "^16",
|
||||||
"@angular-devkit/build-angular": "^17.3.3",
|
"@angular-devkit/build-angular": "^16.2.11",
|
||||||
"@angular/cli": "^17.3.3",
|
"@angular/cli": "^16.2.11",
|
||||||
"@angular/compiler-cli": "^17.3.3",
|
"@angular/compiler-cli": "^16.2.12",
|
||||||
"@angular/language-service": "^17.3.3",
|
"@angular/language-service": "^16.2.12",
|
||||||
"@angular/localize": "^17.3.3",
|
"@angular/localize": "^16.2.12",
|
||||||
"@types/arcgis-rest-api": "^10.4.5",
|
"@types/arcgis-rest-api": "^10.4.5",
|
||||||
"@types/jasmine": "~2.8.8",
|
"@types/jasmine": "~2.8.8",
|
||||||
"@types/jasminewd2": "^2.0.9",
|
"@types/jasminewd2": "^2.0.9",
|
||||||
"@types/node": "^12.20.15",
|
"@types/node": "^12.20.15",
|
||||||
"@typescript-eslint/eslint-plugin": "^6.18.0",
|
"@typescript-eslint/eslint-plugin": "^5.54.0",
|
||||||
"@typescript-eslint/eslint-plugin-tslint": "^6.18.0",
|
"@typescript-eslint/eslint-plugin-tslint": "^5.54.0",
|
||||||
"@typescript-eslint/parser": "^6.18.0",
|
"@typescript-eslint/parser": "^5.54.0",
|
||||||
"codelyzer": "^0.0.28",
|
"codelyzer": "^0.0.28",
|
||||||
"eslint": "^8.35.0",
|
"eslint": "^8.35.0",
|
||||||
"eslint-config-prettier": "^8.6.0",
|
"eslint-config-prettier": "^8.6.0",
|
||||||
@@ -81,9 +81,9 @@
|
|||||||
"karma-coverage-istanbul-reporter": "^3.0.3",
|
"karma-coverage-istanbul-reporter": "^3.0.3",
|
||||||
"karma-jasmine": "^5.1.0",
|
"karma-jasmine": "^5.1.0",
|
||||||
"karma-jasmine-html-reporter": "^2.0.0",
|
"karma-jasmine-html-reporter": "^2.0.0",
|
||||||
"ng-packagr": "^17.3.0",
|
"ng-packagr": "^16.2.3",
|
||||||
"protractor": "~7.0.0",
|
"protractor": "~7.0.0",
|
||||||
"ts-node": "^8.8.1",
|
"ts-node": "^8.8.1",
|
||||||
"typescript": "~5.4.4"
|
"typescript": "~4.9.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
44
projects/common-map/package-lock.json
generated
44
projects/common-map/package-lock.json
generated
@@ -8,23 +8,45 @@
|
|||||||
"name": "@farmmaps/common-map",
|
"name": "@farmmaps/common-map",
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"ngx-avatars": "^1.6.1",
|
||||||
"tslib": "^2.0.0"
|
"tslib": "^2.0.0"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@angular/core": "^17.3.3",
|
"@angular/core": ">=16.0.0",
|
||||||
"@ngrx/effects": "^17",
|
"@ngrx/effects": ">=16.0.0",
|
||||||
"@ngrx/router-store": "^17",
|
"@ngrx/router-store": ">=16.0.0",
|
||||||
"@ngrx/store": "^17",
|
"@ngrx/store": ">=16.0.0",
|
||||||
"ng-openlayers": "17.1.3",
|
"ngrx-store-localstorage": ">=16.0.0",
|
||||||
"ngrx-store-localstorage": "^17",
|
"ngx-openlayers": "file:dist/ngx-openlayers",
|
||||||
"ol": "^8.2.0",
|
"ol": ">=6.8.1",
|
||||||
"tassign": "^1.0.0"
|
"tassign": ">=1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/ngx-avatars": {
|
||||||
|
"version": "1.7.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/ngx-avatars/-/ngx-avatars-1.7.0.tgz",
|
||||||
|
"integrity": "sha512-wD1mDx809QOhsh33P6DsgXc58SQ1PjSN0Xq9FzkXmynHDCmboHyg4DjD4aL+GQKcn5n0Lg/AtRbhWvVb7Xvd8A==",
|
||||||
|
"dependencies": {
|
||||||
|
"ts-md5": "^1.3.1",
|
||||||
|
"tslib": "^2.6.2"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@angular/common": "^17.0.0",
|
||||||
|
"@angular/core": "^17.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/ts-md5": {
|
||||||
|
"version": "1.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/ts-md5/-/ts-md5-1.3.1.tgz",
|
||||||
|
"integrity": "sha512-DiwiXfwvcTeZ5wCE0z+2A9EseZsztaiZtGrtSaY5JOD7ekPnR/GoIVD5gXZAlK9Na9Kvpo9Waz5rW64WKAWApg==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/tslib": {
|
"node_modules/tslib": {
|
||||||
"version": "2.0.1",
|
"version": "2.6.2",
|
||||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz",
|
||||||
"integrity": "sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ=="
|
"integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q=="
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -8,13 +8,13 @@
|
|||||||
"tslib": "^2.0.0"
|
"tslib": "^2.0.0"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@angular/core": "^17.3.3",
|
"@angular/core": ">=16.0.0",
|
||||||
"ngrx-store-localstorage": "^17",
|
"ngrx-store-localstorage": ">=16.0.0",
|
||||||
"@ngrx/effects": "^17",
|
"@ngrx/effects": ">=16.0.0",
|
||||||
"@ngrx/router-store": "^17",
|
"@ngrx/router-store":">=16.0.0",
|
||||||
"@ngrx/store": "^17",
|
"@ngrx/store":">=16.0.0",
|
||||||
"tassign": "^1.0.0",
|
"tassign": ">=1.0.0",
|
||||||
"ng-openlayers": "17.1.3",
|
"ngx-openlayers": "file:dist/ngx-openlayers",
|
||||||
"ol": "^8.2.0"
|
"ol": ">=6.8.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -58,7 +58,7 @@ export const GETLAYERVALUESUCCESS = '[Map] GetLayerValueSuccess'
|
|||||||
export const TOGGLESHOWDATALAYERSLIDE = '[Map] ToggleShowDataLayerSlide'
|
export const TOGGLESHOWDATALAYERSLIDE = '[Map] ToggleShowDataLayerSlide'
|
||||||
export const SETVIEWSTATE = '[Map] SetViewState'
|
export const SETVIEWSTATE = '[Map] SetViewState'
|
||||||
export const CLEARFEATURES = '[Map] ClearFeatures';
|
export const CLEARFEATURES = '[Map] ClearFeatures';
|
||||||
export const SETPANELEXTRAWIDE = '[Map] SetPanelExtraWide';
|
|
||||||
|
|
||||||
export class Clear implements Action {
|
export class Clear implements Action {
|
||||||
readonly type = CLEAR;
|
readonly type = CLEAR;
|
||||||
@@ -342,11 +342,6 @@ export class ClearFeatures implements Action {
|
|||||||
constructor() {}
|
constructor() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class SetPanelExtraWide implements Action {
|
|
||||||
readonly type = SETPANELEXTRAWIDE;
|
|
||||||
constructor(public panelExtraWide:boolean) {}
|
|
||||||
}
|
|
||||||
|
|
||||||
export type Actions = SetMapState
|
export type Actions = SetMapState
|
||||||
| Init
|
| Init
|
||||||
| Clear
|
| Clear
|
||||||
@@ -394,6 +389,5 @@ export type Actions = SetMapState
|
|||||||
| SetPeriod
|
| SetPeriod
|
||||||
| ToggleShowDataLayerSlide
|
| ToggleShowDataLayerSlide
|
||||||
| SetViewState
|
| SetViewState
|
||||||
| ClearFeatures
|
| ClearFeatures;
|
||||||
| SetPanelExtraWide;
|
|
||||||
|
|
||||||
|
@@ -3,7 +3,7 @@ import { CommonModule } from '@angular/common';
|
|||||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||||
|
|
||||||
//external modules
|
//external modules
|
||||||
import { AngularOpenlayersModule } from 'ng-openlayers';
|
import { AngularOpenlayersModule } from 'ngx-openlayers';
|
||||||
import { StoreModule, ActionReducer, MetaReducer } from '@ngrx/store';
|
import { StoreModule, ActionReducer, MetaReducer } from '@ngrx/store';
|
||||||
import { EffectsModule } from '@ngrx/effects';
|
import { EffectsModule } from '@ngrx/effects';
|
||||||
import { NgbModule } from "@ng-bootstrap/ng-bootstrap";
|
import { NgbModule } from "@ng-bootstrap/ng-bootstrap";
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import { Component, Input, OnDestroy, OnInit, EventEmitter, Output, Inject } from '@angular/core';
|
import { Component, Input, OnDestroy, OnInit, EventEmitter, Output, Inject } from '@angular/core';
|
||||||
import { MapComponent } from 'ng-openlayers';
|
import { MapComponent } from 'ngx-openlayers';
|
||||||
|
|
||||||
import * as proj from 'ol/proj';
|
import * as proj from 'ol/proj';
|
||||||
import {Point,Geometry} from 'ol/geom';
|
import {Point,Geometry} from 'ol/geom';
|
||||||
|
@@ -33,7 +33,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.stop2 {
|
.stop2 {
|
||||||
stop-color:var(--bs-primary);
|
stop-color: var(--bs-primary);
|
||||||
stop-opacity: 0;
|
stop-opacity: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import { Component, OnInit, Input, ViewChild, ElementRef, OnChanges, SimpleChanges ,Host} from '@angular/core';
|
import { Component, OnInit, Input, ViewChild, ElementRef, OnChanges, SimpleChanges ,Host} from '@angular/core';
|
||||||
import { MapComponent } from 'ng-openlayers';
|
import { MapComponent } from 'ngx-openlayers';
|
||||||
import Overlay from 'ol/Overlay';
|
import Overlay from 'ol/Overlay';
|
||||||
import { fromLonLat, toLonLat } from 'ol/proj';
|
import { fromLonLat, toLonLat } from 'ol/proj';
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import { Component, Host, Input, Output, EventEmitter,OnDestroy, OnInit, OnChanges, SimpleChanges, forwardRef } from '@angular/core';
|
import { Component, Host, Input, Output, EventEmitter,OnDestroy, OnInit, OnChanges, SimpleChanges, forwardRef } from '@angular/core';
|
||||||
import { LayerGroupComponent, MapComponent } from 'ng-openlayers';
|
import { LayerGroupComponent, MapComponent } from 'ngx-openlayers';
|
||||||
import { ItemService,IItem,AppConfig } from '@farmmaps/common';
|
import { ItemService,IItem,AppConfig } from '@farmmaps/common';
|
||||||
import { IItemLayer, ITemporalItemLayer} from '../../../models/item.layer';
|
import { IItemLayer, ITemporalItemLayer} from '../../../models/item.layer';
|
||||||
import { ILayerData} from '../../../models/layer.data';
|
import { ILayerData} from '../../../models/layer.data';
|
||||||
@@ -19,7 +19,6 @@ import VectorTileLayer from 'ol/layer/VectorTile';
|
|||||||
import {GeoJSON,MVT} from 'ol/format';
|
import {GeoJSON,MVT} from 'ol/format';
|
||||||
import { Geometry } from 'ol/geom';
|
import { Geometry } from 'ol/geom';
|
||||||
import BaseLayer from 'ol/layer/Base';
|
import BaseLayer from 'ol/layer/Base';
|
||||||
import Feature from 'ol/Feature';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'fm-map-item-layers',
|
selector: 'fm-map-item-layers',
|
||||||
@@ -181,9 +180,9 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange
|
|||||||
const source = new VectorSource({
|
const source = new VectorSource({
|
||||||
strategy: loadingstrategy.bbox,
|
strategy: loadingstrategy.bbox,
|
||||||
loader: function (extent: Extent, resolution: number, projection: Projection) {
|
loader: function (extent: Extent, resolution: number, projection: Projection) {
|
||||||
const source = this as VectorSource<Feature<Geometry>>;
|
const source = this as VectorSource<Geometry>;
|
||||||
__this.itemService.getItemFeatures(item.code, extent, projection.getCode(), layerIndex).subscribe(function (data) {
|
__this.itemService.getItemFeatures(item.code, extent, projection.getCode(), layerIndex).subscribe(function (data) {
|
||||||
const features = format.readFeatures(data).filter(feature => feature instanceof Feature) as Feature[];
|
const features = format.readFeatures(data);
|
||||||
for (const f of features) {
|
for (const f of features) {
|
||||||
if (f.get("code")) {
|
if (f.get("code")) {
|
||||||
f.setId(f.get("code"));
|
f.setId(f.get("code"));
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import { Component, Host, Input, Output, EventEmitter, OnInit, OnChanges, SimpleChanges, forwardRef, Inject, InjectionToken, OnDestroy, LOCALE_ID } from '@angular/core';
|
import { Component, Host, Input, Output, EventEmitter, OnInit, OnChanges, SimpleChanges, forwardRef, Inject, InjectionToken, OnDestroy, LOCALE_ID } from '@angular/core';
|
||||||
import { LayerVectorComponent, SourceVectorComponent, MapComponent } from 'ng-openlayers';
|
import { LayerVectorComponent, SourceVectorComponent, MapComponent } from 'ngx-openlayers';
|
||||||
import { ItemService, ItemTypeService, IItem, IItemType, FolderService } from '@farmmaps/common';
|
import { ItemService, ItemTypeService, IItem, IItemType, FolderService } from '@farmmaps/common';
|
||||||
|
|
||||||
import { Feature } from 'ol';
|
import { Feature } from 'ol';
|
||||||
@@ -29,7 +29,7 @@ import { formatNumber } from '@angular/common';
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class ItemVectorSourceComponent extends SourceVectorComponent implements OnInit, OnDestroy, OnChanges {
|
export class ItemVectorSourceComponent extends SourceVectorComponent implements OnInit, OnDestroy, OnChanges {
|
||||||
instance: Vector<Feature<Geometry>>;
|
instance: Vector<Geometry>;
|
||||||
private _format: GeoJSON;
|
private _format: GeoJSON;
|
||||||
private _select: Select;
|
private _select: Select;
|
||||||
private _hoverSelect: Select;
|
private _hoverSelect: Select;
|
||||||
@@ -83,7 +83,6 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements
|
|||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.sub = this.folderService.getFolder('my_settings').subscribe(
|
this.sub = this.folderService.getFolder('my_settings').subscribe(
|
||||||
userSettingsRoot => {
|
userSettingsRoot => {
|
||||||
if (userSettingsRoot == undefined) return;
|
|
||||||
this.itemService.getChildItemList(userSettingsRoot.code, 'vnd.farmmaps.itemtype.settings.general').subscribe(
|
this.itemService.getChildItemList(userSettingsRoot.code, 'vnd.farmmaps.itemtype.settings.general').subscribe(
|
||||||
items => {
|
items => {
|
||||||
if (items && items.length > 0 && items[0].data?.displayMapFeatureSettings) {
|
if (items && items.length > 0 && items[0].data?.displayMapFeatureSettings) {
|
||||||
|
@@ -3,7 +3,7 @@ import { IItemLayer } from '../../../models/item.layer';
|
|||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import * as mapReducers from '../../../reducers/map.reducer';
|
import * as mapReducers from '../../../reducers/map.reducer';
|
||||||
import * as mapActions from '../../../actions/map.actions';
|
import * as mapActions from '../../../actions/map.actions';
|
||||||
import { MapComponent } from 'ng-openlayers';
|
import { MapComponent } from 'ngx-openlayers';
|
||||||
import { ILayervalue } from '../../../models/layer.value';
|
import { ILayervalue } from '../../../models/layer.value';
|
||||||
import { Observable, interval, Subject } from 'rxjs';
|
import { Observable, interval, Subject } from 'rxjs';
|
||||||
import { debounce, throttle } from 'rxjs/operators';
|
import { debounce, throttle } from 'rxjs/operators';
|
||||||
|
@@ -1,9 +1,8 @@
|
|||||||
import { Component, OnDestroy, OnInit, Input, OnChanges, SimpleChanges } from '@angular/core';
|
import { Component, OnDestroy, OnInit, Input, OnChanges, SimpleChanges } from '@angular/core';
|
||||||
import { LayerVectorComponent, MapComponent } from 'ng-openlayers';
|
import { LayerVectorComponent, MapComponent } from 'ngx-openlayers';
|
||||||
import RenderType from 'ol/layer/Vector';
|
import RenderType from 'ol/layer/Vector';
|
||||||
import { Vector as VectorSource } from 'ol/source';
|
import { Vector as VectorSource } from 'ol/source';
|
||||||
import { Geometry } from 'ol/geom';
|
import { Geometry } from 'ol/geom';
|
||||||
import Feature from 'ol/Feature';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'fm-map-aol-layer-vector-image',
|
selector: 'fm-map-aol-layer-vector-image',
|
||||||
@@ -15,7 +14,7 @@ export class LayerVectorImageComponent extends LayerVectorComponent implements O
|
|||||||
//public source: Vector;
|
//public source: Vector;
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
renderMode: RenderType<VectorSource<Feature<Geometry>>> | string = "image";
|
renderMode: RenderType<VectorSource<Geometry>> | string = "image";
|
||||||
|
|
||||||
constructor(map: MapComponent) {
|
constructor(map: MapComponent) {
|
||||||
super(map);
|
super(map);
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import { Component, OnInit, Input, Host, OnChanges, SimpleChanges,ChangeDetectorRef } from '@angular/core';
|
import { Component, OnInit, Input, Host, OnChanges, SimpleChanges,ChangeDetectorRef } from '@angular/core';
|
||||||
import { MapComponent } from 'ng-openlayers';
|
import { MapComponent } from 'ngx-openlayers';
|
||||||
import {IMapState} from '../../../models/map.state'
|
import {IMapState} from '../../../models/map.state'
|
||||||
import {View} from 'ol';
|
import {View} from 'ol';
|
||||||
import { fromLonLat } from 'ol/proj';
|
import { fromLonLat } from 'ol/proj';
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
#north {
|
#north {
|
||||||
display: none;
|
display: none;
|
||||||
fill:var(--bs-black);
|
fill: var(--bs-black);
|
||||||
}
|
}
|
||||||
|
|
||||||
#top-l {
|
#top-l {
|
||||||
@@ -31,23 +31,23 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
div.compass:hover #top-l {
|
div.compass:hover #top-l {
|
||||||
fill:var(--bs-white);
|
fill: var(--bs-white);
|
||||||
}
|
}
|
||||||
|
|
||||||
div.compass:hover #top-r {
|
div.compass:hover #top-r {
|
||||||
fill:var(--bs-gray-300);
|
fill: var(--bs-gray-300);
|
||||||
}
|
}
|
||||||
|
|
||||||
div.compass:hover #bottom-l {
|
div.compass:hover #bottom-l {
|
||||||
fill:var(--bs-gray-300);
|
fill: var(--bs-gray-300);
|
||||||
}
|
}
|
||||||
|
|
||||||
div.compass:hover #bottom-r {
|
div.compass:hover #bottom-r {
|
||||||
fill:var(--bs-white);
|
fill: var(--bs-white);
|
||||||
}
|
}
|
||||||
|
|
||||||
div.compass:hover #north {
|
div.compass:hover #north {
|
||||||
fill:var(--bs-white);
|
fill: var(--bs-white);
|
||||||
}
|
}
|
||||||
|
|
||||||
.compass-n {
|
.compass-n {
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import { Component, Host, Input, OnInit, ChangeDetectorRef } from '@angular/core';
|
import { Component, Host, Input, OnInit, ChangeDetectorRef } from '@angular/core';
|
||||||
import { ViewComponent, MapComponent } from 'ng-openlayers';
|
import { ViewComponent, MapComponent } from 'ngx-openlayers';
|
||||||
|
|
||||||
import {View} from 'ol';
|
import {View} from 'ol';
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import { Component, Host, Input, OnInit, OnChanges, SimpleChanges, forwardRef } from '@angular/core';
|
import { Component, Host, Input, OnInit, OnChanges, SimpleChanges, forwardRef } from '@angular/core';
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
import { ViewComponent, MapComponent } from 'ng-openlayers';
|
import { ViewComponent, MapComponent } from 'ngx-openlayers';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@@ -4,7 +4,7 @@ fm-map-feature-list-feature-container {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.row {
|
.row {
|
||||||
border-bottom: 1px solid var(--bs-gray-500);
|
border-bottom: 1px solid var(--bs-gray-500);;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
padding-left:1.5rem;
|
padding-left:1.5rem;
|
||||||
}
|
}
|
||||||
@@ -14,7 +14,7 @@ fm-map-feature-list-feature-container {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.cropfields {
|
.cropfields {
|
||||||
border-top: 1px solid var(--bs-gray-500);
|
border-top: 1px solid var(--bs-gray-500);;
|
||||||
margin-left: -1.25rem;
|
margin-left: -1.25rem;
|
||||||
margin-right: -1.25rem;
|
margin-right: -1.25rem;
|
||||||
}
|
}
|
||||||
|
@@ -4,7 +4,7 @@ fm-map-feature-list-feature-container {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.row {
|
.row {
|
||||||
border-bottom: 1px solid var(--bs-gray-500);
|
border-bottom: 1px solid var(--bs-gray-500);;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
padding-left:1.5rem;
|
padding-left:1.5rem;
|
||||||
}
|
}
|
||||||
@@ -14,7 +14,7 @@ fm-map-feature-list-feature-container {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.farms {
|
.farms {
|
||||||
border-top: 1px solid var(--bs-gray-500);
|
border-top: 1px solid var(--bs-gray-500);;
|
||||||
margin-left: -1.25rem;
|
margin-left: -1.25rem;
|
||||||
margin-right: -1.25rem;
|
margin-right: -1.25rem;
|
||||||
}
|
}
|
||||||
|
@@ -4,7 +4,7 @@ fm-map-feature-list-feature-container {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.row {
|
.row {
|
||||||
border-bottom: 1px solid var(--bs-gray-500);
|
border-bottom: 1px solid var(--bs-gray-500);;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { Directive, ViewContainerRef,TemplateRef,OnInit,Input, OnChanges } from '@angular/core';
|
import { Directive, ViewContainerRef,TemplateRef,OnInit,Input, OnChanges } from '@angular/core';
|
||||||
import { Layer } from 'ol/layer';
|
import { Layer } from 'ol/layer';
|
||||||
import { Source } from 'ol/source';
|
import { Source } from 'ol/source';
|
||||||
import { MapComponent } from 'ng-openlayers';
|
import { MapComponent } from 'ngx-openlayers';
|
||||||
|
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: '[fmMapIfZoomToShow]',
|
selector: '[fmMapIfZoomToShow]',
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
.widget {
|
.widget {
|
||||||
position:relative;
|
position:relative;
|
||||||
border: 1px solid var(--bs-gray-500);
|
border: 1px solid var(--bs-gray-500);;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
display:inline-block;
|
display:inline-block;
|
||||||
width:50%;
|
width:50%;
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
.widget {
|
.widget {
|
||||||
position:relative;
|
position:relative;
|
||||||
border: 1px solid var(--bs-gray-500);
|
border: 1px solid var(--bs-gray-500);;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
display:inline-block;
|
display:inline-block;
|
||||||
width:50%;
|
width:50%;
|
||||||
|
@@ -21,7 +21,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.layers {
|
.layers {
|
||||||
color:var(--bs-secondary);
|
color: var(--bs-secondary);;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
bottom: -1em;
|
bottom: -1em;
|
||||||
|
@@ -10,7 +10,6 @@
|
|||||||
panelVisible:panelVisible$|async,
|
panelVisible:panelVisible$|async,
|
||||||
openedModalName:openedModalName$|async,
|
openedModalName:openedModalName$|async,
|
||||||
panelCollapsed:panelCollapsed$|async,
|
panelCollapsed:panelCollapsed$|async,
|
||||||
panelExtraWide:panelExtraWide$|async,
|
|
||||||
searchMinified:searchMinified$|async,
|
searchMinified:searchMinified$|async,
|
||||||
selectedItem:selectedItem$|async,
|
selectedItem:selectedItem$|async,
|
||||||
parentItem:parentItem$|async,
|
parentItem:parentItem$|async,
|
||||||
@@ -65,7 +64,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="side-panel-container">
|
<div class="side-panel-container">
|
||||||
|
|
||||||
<fm-side-panel [resizeable]="true" (onResize)="handlePanelResize($event)" [visible]="state.panelVisible && noContent" [collapsed]="state.panelCollapsed" [collapsable]="false" [extrawide]="state.panelExtraWide">
|
<fm-side-panel [resizeable]="true" (onResize)="handlePanelResize($event)" [visible]="state.panelVisible && noContent" [collapsed]="state.panelCollapsed" [collapsable]="false">
|
||||||
<div class="panel-wrapper" *ngIf="noContent">
|
<div class="panel-wrapper" *ngIf="noContent">
|
||||||
<div class="panel-top bg-secondary" *ngIf="!(state.searchMinified)">
|
<div class="panel-top bg-secondary" *ngIf="!(state.searchMinified)">
|
||||||
</div>
|
</div>
|
||||||
@@ -85,7 +84,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</fm-side-panel>
|
</fm-side-panel>
|
||||||
<fm-side-panel [resizeable]="true" [visible]="!noContent" [extrawide]="state.panelExtraWide">
|
<fm-side-panel [resizeable]="true" [visible]="!noContent">
|
||||||
<router-outlet (activate)="handleSidepaneloutletActivate($event)" (deactivate)="handleSidepaneloutletDeactivate($event)"></router-outlet>
|
<router-outlet (activate)="handleSidepaneloutletActivate($event)" (deactivate)="handleSidepaneloutletDeactivate($event)"></router-outlet>
|
||||||
</fm-side-panel>
|
</fm-side-panel>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -66,7 +66,6 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
|
|||||||
public parentCode$: Observable<string> =this.store.select(mapReducers.selectGetParentCode);
|
public parentCode$: Observable<string> =this.store.select(mapReducers.selectGetParentCode);
|
||||||
public panelVisible$: Observable<boolean> = this.store.select(mapReducers.selectGetPanelVisible);
|
public panelVisible$: Observable<boolean> = this.store.select(mapReducers.selectGetPanelVisible);
|
||||||
public panelCollapsed$: Observable<boolean> = this.store.select(mapReducers.selectGetPanelCollapsed);
|
public panelCollapsed$: Observable<boolean> = this.store.select(mapReducers.selectGetPanelCollapsed);
|
||||||
public panelExtraWide$: Observable<boolean> = this.store.select(mapReducers.selectGetPanelExtraWide);
|
|
||||||
public selectedFeature$: Observable<Feature<Geometry>> = this.store.select(mapReducers.selectGetSelectedFeature);
|
public selectedFeature$: Observable<Feature<Geometry>> = this.store.select(mapReducers.selectGetSelectedFeature);
|
||||||
public clickedFeature: Subject<Feature<Geometry>> = new Subject<Feature<Geometry>>();
|
public clickedFeature: Subject<Feature<Geometry>> = new Subject<Feature<Geometry>>();
|
||||||
public selectedItem$: Observable<IItem> = this.store.select(mapReducers.selectGetSelectedItem);
|
public selectedItem$: Observable<IItem> = this.store.select(mapReducers.selectGetSelectedItem);
|
||||||
@@ -209,18 +208,12 @@ export class MapComponent implements OnInit, OnDestroy,AfterViewInit {
|
|||||||
if(component && component.hasOwnProperty('clickedFeature')) {
|
if(component && component.hasOwnProperty('clickedFeature')) {
|
||||||
(component as IClickedFeature).clickedFeature = this.clickedFeature;
|
(component as IClickedFeature).clickedFeature = this.clickedFeature;
|
||||||
}
|
}
|
||||||
if(component && component.hasOwnProperty('extrawide')) {
|
|
||||||
this.store.dispatch(new mapActions.SetPanelExtraWide(true));
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
handleSidepaneloutletDeactivate(component:any) {
|
handleSidepaneloutletDeactivate(component:any) {
|
||||||
if(component && component.hasOwnProperty('clickedFeature')) {
|
if(component && component.hasOwnProperty('clickedFeature')) {
|
||||||
(component as IClickedFeature).clickedFeature = null;
|
(component as IClickedFeature).clickedFeature = null;
|
||||||
}
|
}
|
||||||
if(component && component.hasOwnProperty('extrawide')) {
|
|
||||||
this.store.dispatch(new mapActions.SetPanelExtraWide(false));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
handlePrerender(event:any) {
|
handlePrerender(event:any) {
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
.row {
|
.row {
|
||||||
border-bottom: 1px solid var(--bs-gray-500);
|
border-bottom: 1px solid var(--bs-gray-500);;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -41,7 +41,7 @@ export const {
|
|||||||
selectRouteParam, // factory function to select a route param
|
selectRouteParam, // factory function to select a route param
|
||||||
selectRouteData, // select the current route data
|
selectRouteData, // select the current route data
|
||||||
selectUrl, // select the current url
|
selectUrl, // select the current url
|
||||||
} = fromRouter.getRouterSelectors(getRouterState);
|
} = fromRouter.getSelectors(getRouterState);
|
||||||
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
@@ -133,7 +133,7 @@ export class MapEffects {
|
|||||||
f.id = f.properties["code"];
|
f.id = f.properties["code"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return of(new mapActions.StartSearchSuccess(this._geojsonFormat.readFeatures(features).filter(feature => feature instanceof Feature) as Feature[], a.queryState));
|
return of(new mapActions.StartSearchSuccess(this._geojsonFormat.readFeatures(features), a.queryState));
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
catchError(error => of(new commonActions.Fail(error))));
|
catchError(error => of(new commonActions.Fail(error))));
|
||||||
@@ -218,7 +218,7 @@ export class MapEffects {
|
|||||||
if (!this.overrideSelectedItemLayer) {
|
if (!this.overrideSelectedItemLayer) {
|
||||||
return this.itemService$.getFeature(action.item.code, "EPSG:3857").pipe(
|
return this.itemService$.getFeature(action.item.code, "EPSG:3857").pipe(
|
||||||
map((feature: any) => {
|
map((feature: any) => {
|
||||||
const f = this._geojsonFormat.readFeature(feature) as Feature;
|
const f = this._geojsonFormat.readFeature(feature);
|
||||||
f.setId(action.item.code);
|
f.setId(action.item.code);
|
||||||
return new mapActions.AddFeatureSuccess(f);
|
return new mapActions.AddFeatureSuccess(f);
|
||||||
}),
|
}),
|
||||||
|
@@ -49,7 +49,6 @@ export interface State {
|
|||||||
features: Array<Feature<Geometry>>,
|
features: Array<Feature<Geometry>>,
|
||||||
panelVisible: boolean,
|
panelVisible: boolean,
|
||||||
panelCollapsed: boolean,
|
panelCollapsed: boolean,
|
||||||
panelExtraWide: boolean,
|
|
||||||
selectedFeature: Feature<Geometry>,
|
selectedFeature: Feature<Geometry>,
|
||||||
selectedItem:IItem,
|
selectedItem:IItem,
|
||||||
parentItem:IItem,
|
parentItem:IItem,
|
||||||
@@ -95,7 +94,6 @@ export const initialState: State = {
|
|||||||
features: [],
|
features: [],
|
||||||
panelVisible: false,
|
panelVisible: false,
|
||||||
panelCollapsed: false,
|
panelCollapsed: false,
|
||||||
panelExtraWide: false,
|
|
||||||
selectedFeature: null,
|
selectedFeature: null,
|
||||||
selectedItem: null,
|
selectedItem: null,
|
||||||
parentItem: null,
|
parentItem: null,
|
||||||
@@ -574,10 +572,6 @@ export function reducer(state = initialState, action: mapActions.Actions | commo
|
|||||||
}
|
}
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
case mapActions.SETPANELEXTRAWIDE:{
|
|
||||||
const a= action as mapActions.SetPanelExtraWide;
|
|
||||||
return tassign(state,{panelExtraWide:a.panelExtraWide});
|
|
||||||
}
|
|
||||||
default: {
|
default: {
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
@@ -589,7 +583,6 @@ export const getParentCode = (state: State) => state.parentCode;
|
|||||||
export const getFeatures = (state: State) => state.features;
|
export const getFeatures = (state: State) => state.features;
|
||||||
export const getPanelVisible = (state: State) => state.panelVisible;
|
export const getPanelVisible = (state: State) => state.panelVisible;
|
||||||
export const getPanelCollapsed = (state: State) => state.panelCollapsed;
|
export const getPanelCollapsed = (state: State) => state.panelCollapsed;
|
||||||
export const getPanelExtraWide = (state: State) => state.panelExtraWide;
|
|
||||||
export const getSelectedFeature = (state: State) => state.selectedFeature;
|
export const getSelectedFeature = (state: State) => state.selectedFeature;
|
||||||
export const getSelectedItem = (state: State) => state.selectedItem;
|
export const getSelectedItem = (state: State) => state.selectedItem;
|
||||||
export const getParentItem = (state: State) => state.parentItem;
|
export const getParentItem = (state: State) => state.parentItem;
|
||||||
@@ -625,7 +618,6 @@ export const selectGetParentCode = createSelector(selectMapState, getParentCode)
|
|||||||
export const selectGetFeatures = createSelector(selectMapState, getFeatures);
|
export const selectGetFeatures = createSelector(selectMapState, getFeatures);
|
||||||
export const selectGetPanelVisible = createSelector(selectMapState, getPanelVisible);
|
export const selectGetPanelVisible = createSelector(selectMapState, getPanelVisible);
|
||||||
export const selectGetPanelCollapsed = createSelector(selectMapState, getPanelCollapsed);
|
export const selectGetPanelCollapsed = createSelector(selectMapState, getPanelCollapsed);
|
||||||
export const selectGetPanelExtraWide = createSelector(selectMapState, getPanelExtraWide);
|
|
||||||
export const selectGetSelectedFeature = createSelector(selectMapState, getSelectedFeature);
|
export const selectGetSelectedFeature = createSelector(selectMapState, getSelectedFeature);
|
||||||
export const selectGetSelectedItem = createSelector(selectMapState, getSelectedItem);
|
export const selectGetSelectedItem = createSelector(selectMapState, getSelectedItem);
|
||||||
export const selectGetParentItem = createSelector(selectMapState, getParentItem);
|
export const selectGetParentItem = createSelector(selectMapState, getParentItem);
|
||||||
|
@@ -10,27 +10,18 @@
|
|||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"importHelpers": true,
|
"importHelpers": true,
|
||||||
"esModuleInterop": true,
|
|
||||||
"types": [],
|
"types": [],
|
||||||
"lib": [
|
"lib": [
|
||||||
"dom",
|
"dom",
|
||||||
"es2018"
|
"es2018"
|
||||||
],
|
]
|
||||||
"paths": {
|
|
||||||
"@angular/*": [
|
|
||||||
|
|
||||||
"node_modules/@angular/*"
|
|
||||||
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"angularCompilerOptions": {
|
"angularCompilerOptions": {
|
||||||
"skipTemplateCodegen": true,
|
"skipTemplateCodegen": true,
|
||||||
"strictMetadataEmit": true,
|
"strictMetadataEmit": true,
|
||||||
"fullTemplateTypeCheck": true,
|
"fullTemplateTypeCheck": true,
|
||||||
"strictInjectionParameters": true,
|
"strictInjectionParameters": true,
|
||||||
"enableResourceInlining": true,
|
"enableResourceInlining": true
|
||||||
"compilationMode": "partial"
|
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"src/test.ts",
|
"src/test.ts",
|
||||||
|
@@ -22,7 +22,8 @@
|
|||||||
"node_modules/@angular/*"
|
"node_modules/@angular/*"
|
||||||
|
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
"preserveSymlinks": true,
|
||||||
},
|
},
|
||||||
"angularCompilerOptions": {
|
"angularCompilerOptions": {
|
||||||
"skipTemplateCodegen": true,
|
"skipTemplateCodegen": true,
|
||||||
@@ -30,7 +31,8 @@
|
|||||||
"fullTemplateTypeCheck": true,
|
"fullTemplateTypeCheck": true,
|
||||||
"strictInjectionParameters": true,
|
"strictInjectionParameters": true,
|
||||||
"enableResourceInlining": true,
|
"enableResourceInlining": true,
|
||||||
"compilationMode": "partial"
|
"compilationMode": "partial",
|
||||||
|
"preserveSymlinks": true,
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"src/test.ts",
|
"src/test.ts",
|
||||||
|
6
projects/common-map3d/package-lock.json
generated
6
projects/common-map3d/package-lock.json
generated
@@ -11,10 +11,10 @@
|
|||||||
"tslib": "^2.0.0"
|
"tslib": "^2.0.0"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@angular/common": "^17.3.3",
|
"@angular/common": ">=16.0.0",
|
||||||
"@angular/core": "^17.3.3",
|
"@angular/core": ">=16.0.0",
|
||||||
"cesium": ">=1.82.1",
|
"cesium": ">=1.82.1",
|
||||||
"ng-openlayers": "17.1.3",
|
"ngx-openlayers": "4.2.0-prerelease.2414",
|
||||||
"ol-cesium": ">=2.13.0"
|
"ol-cesium": ">=2.13.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@@ -5,9 +5,9 @@
|
|||||||
"registry": "https://repository.akkerweb.nl/repository/npm-hosted/"
|
"registry": "https://repository.akkerweb.nl/repository/npm-hosted/"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@angular/common": "^17.3.3",
|
"@angular/common": ">=16.0.0",
|
||||||
"@angular/core": "^17.3.3",
|
"@angular/core": ">=16.0.0",
|
||||||
"ng-openlayers": "17.1.3",
|
"ngx-openlayers": "4.2.0-prerelease.2414",
|
||||||
"cesium": ">=1.82.1",
|
"cesium": ">=1.82.1",
|
||||||
"ol-cesium": ">=2.13.0"
|
"ol-cesium": ">=2.13.0"
|
||||||
},
|
},
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import { Component, OnInit,Input,Host } from '@angular/core';
|
import { Component, OnInit,Input,Host } from '@angular/core';
|
||||||
import { Interaction} from 'ol/interaction';
|
import { Interaction} from 'ol/interaction';
|
||||||
import { MapComponent } from 'ng-openlayers';
|
import { MapComponent } from 'ngx-openlayers';
|
||||||
import OLCesium from 'olcs/OLCesium';
|
import OLCesium from 'olcs/OLCesium';
|
||||||
import RasterSynchronizer from 'olcs/RasterSynchronizer';
|
import RasterSynchronizer from 'olcs/RasterSynchronizer';
|
||||||
import VectorSynchronizer from 'olcs/VectorSynchronizer';
|
import VectorSynchronizer from 'olcs/VectorSynchronizer';
|
||||||
|
@@ -11,27 +11,18 @@
|
|||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"importHelpers": true,
|
"importHelpers": true,
|
||||||
"esModuleInterop": true,
|
|
||||||
"types": [],
|
"types": [],
|
||||||
"lib": [
|
"lib": [
|
||||||
"dom",
|
"dom",
|
||||||
"es2018"
|
"es2018"
|
||||||
],
|
]
|
||||||
"paths": {
|
|
||||||
"@angular/*": [
|
|
||||||
|
|
||||||
"node_modules/@angular/*"
|
|
||||||
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"angularCompilerOptions": {
|
"angularCompilerOptions": {
|
||||||
"skipTemplateCodegen": true,
|
"skipTemplateCodegen": true,
|
||||||
"strictMetadataEmit": true,
|
"strictMetadataEmit": true,
|
||||||
"fullTemplateTypeCheck": true,
|
"fullTemplateTypeCheck": true,
|
||||||
"strictInjectionParameters": true,
|
"strictInjectionParameters": true,
|
||||||
"enableResourceInlining": true,
|
"enableResourceInlining": true
|
||||||
"compilationMode": "partial"
|
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"src/test.ts",
|
"src/test.ts",
|
||||||
|
32
projects/common/package-lock.json
generated
32
projects/common/package-lock.json
generated
@@ -8,22 +8,22 @@
|
|||||||
"name": "@farmmaps/common",
|
"name": "@farmmaps/common",
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@angular/common": "^17.3.3",
|
"@angular/common": ">=16.0.0",
|
||||||
"@angular/core": "^17.3.3",
|
"@angular/core": ">=16.0.0",
|
||||||
"@angular/forms": "^17.3.3",
|
"@angular/forms": ">=16.0.0",
|
||||||
"@microsoft/signalr": "^3.1.16",
|
"@microsoft/signalr": ">=3.1.3",
|
||||||
"@ng-bootstrap/ng-bootstrap": "^16.0.0",
|
"@ng-bootstrap/ng-bootstrap": ">=16.0.0",
|
||||||
"@ngrx/effects": "^17",
|
"@ngrx/effects": ">=16.0.0",
|
||||||
"@ngrx/router-store": "^17",
|
"@ngrx/router-store": ">=16.0.0",
|
||||||
"@ngrx/store": "^17",
|
"@ngrx/store": ">=16.0.0",
|
||||||
"angular-oauth2-oidc": "^13",
|
"angular-oauth2-oidc": ">=13.0.0",
|
||||||
"bootstrap": "^5.2.0",
|
"bootstrap": ">=4.4.1",
|
||||||
"moment": "^2.29.4",
|
"moment": ">=2.27.0",
|
||||||
"ngx-avatars": "1.7.0",
|
"ngx-avatars": "^1.6.1",
|
||||||
"ngx-clipboard": "16.0.0",
|
"ngx-clipboard": "^15.0.1",
|
||||||
"ngx-image-cropper": "^7.2.1",
|
"ngx-image-cropper": "^6.0.0",
|
||||||
"ngx-uploadx": "^6.2.0",
|
"ngx-uploadx": ">=5.1.0",
|
||||||
"tassign": "^1.0.0"
|
"tassign": ">=1.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -5,21 +5,21 @@
|
|||||||
"registry": "https://repository.akkerweb.nl/repository/npm-hosted/"
|
"registry": "https://repository.akkerweb.nl/repository/npm-hosted/"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@ng-bootstrap/ng-bootstrap": "^16.0.0",
|
"@ng-bootstrap/ng-bootstrap": ">=16.0.0",
|
||||||
"@angular/common": "^17.3.3",
|
"@angular/common": ">=16.0.0",
|
||||||
"@angular/core": "^17.3.3",
|
"@angular/core": ">=16.0.0",
|
||||||
"@angular/forms": "^17.3.3",
|
"@angular/forms": ">=16.0.0",
|
||||||
"@ngrx/effects": "^17",
|
"@ngrx/effects": ">=16.0.0",
|
||||||
"@ngrx/router-store": "^17",
|
"@ngrx/router-store": ">=16.0.0",
|
||||||
"@ngrx/store": "^17",
|
"@ngrx/store": ">=16.0.0",
|
||||||
"tassign": "^1.0.0",
|
"tassign": ">=1.0.0",
|
||||||
"bootstrap": "^5.2.0",
|
"bootstrap": ">=4.4.1",
|
||||||
"@microsoft/signalr": "^3.1.16",
|
"@microsoft/signalr": ">=3.1.3",
|
||||||
"ngx-uploadx": "^6.2.0",
|
"ngx-uploadx": ">=5.1.0",
|
||||||
"angular-oauth2-oidc": "^13",
|
"angular-oauth2-oidc": ">=13.0.0",
|
||||||
"moment": "^2.29.4",
|
"moment": ">=2.27.0",
|
||||||
"ngx-avatars": "1.7.0",
|
"ngx-avatars": "^1.6.1",
|
||||||
"ngx-image-cropper": "^7.2.1",
|
"ngx-image-cropper": "^6.0.0",
|
||||||
"ngx-clipboard": "16.0.0"
|
"ngx-clipboard": "^15.0.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -7,7 +7,6 @@ import {NavBarGuard} from './services/nav-bar-guard.service';
|
|||||||
import {FullScreenGuard} from './services/full-screen-guard.service';
|
import {FullScreenGuard} from './services/full-screen-guard.service';
|
||||||
import {SessionClearedComponent} from './components/session-cleared/session-cleared.component';
|
import {SessionClearedComponent} from './components/session-cleared/session-cleared.component';
|
||||||
import {NotFoundComponent} from './components/not-found/not-found.component';
|
import {NotFoundComponent} from './components/not-found/not-found.component';
|
||||||
import { ProductionGuard } from './services/production-guard.service';
|
|
||||||
|
|
||||||
|
|
||||||
const routes = [
|
const routes = [
|
||||||
@@ -22,7 +21,7 @@ const routes = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '**', component: NotFoundComponent,
|
path: '**', component: NotFoundComponent,
|
||||||
canActivate: [NavBarGuard, ProductionGuard]
|
canActivate: [NavBarGuard]
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@@ -18,7 +18,6 @@ import { EventService } from './services/event.service';
|
|||||||
import { TypeaheadService } from './services/typeahead.service';
|
import { TypeaheadService } from './services/typeahead.service';
|
||||||
import { UserService } from './services/user.service';
|
import { UserService } from './services/user.service';
|
||||||
import { ImageService } from './services/image.service';
|
import { ImageService } from './services/image.service';
|
||||||
import { DownloadService } from './services/download.service';
|
|
||||||
import { GeolocatorService } from './services/geolocator.service';
|
import { GeolocatorService } from './services/geolocator.service';
|
||||||
import { WeatherService} from './services/weather.service';
|
import { WeatherService} from './services/weather.service';
|
||||||
import { AppConfig } from './shared/app.config';
|
import { AppConfig } from './shared/app.config';
|
||||||
@@ -49,7 +48,6 @@ export {
|
|||||||
TypeaheadService,
|
TypeaheadService,
|
||||||
UserService,
|
UserService,
|
||||||
ImageService,
|
ImageService,
|
||||||
DownloadService,
|
|
||||||
GeolocatorService,
|
GeolocatorService,
|
||||||
WeatherService,
|
WeatherService,
|
||||||
AppConfig,
|
AppConfig,
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
<div class="side-panel hidden" [ngClass]="{'hidden':!visible,'collapsed':collapsed,'resizeable':(resizeable && mobile),'resizing':resizing,'left':left,'extrawide':extrawide}" [ngStyle]="{'top':top}">
|
<div class="side-panel hidden" [ngClass]="{'hidden':!visible,'collapsed':collapsed,'resizeable':(resizeable && mobile),'resizing':resizing,'left':left}" [ngStyle]="{'top':top}">
|
||||||
<div *ngIf="collapsable" class="arrow rounded-end p-2" (click)="handleToggleClick($event)">
|
<div *ngIf="collapsable" class="arrow rounded-end p-2" (click)="handleToggleClick($event)">
|
||||||
<i class="fal fa-chevron-left" aria-hidden="true"></i>
|
<i class="fal fa-chevron-left" aria-hidden="true"></i>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.side-panel.collapsed {
|
.side-panel.collapsed {
|
||||||
left:-44rem;
|
left:-22rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.arrow {
|
.arrow {
|
||||||
@@ -76,6 +76,7 @@ div.resizegrip > span {
|
|||||||
|
|
||||||
.resizeable .resizegrip {
|
.resizeable .resizegrip {
|
||||||
display:block;
|
display:block;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.resizeable .content {
|
.resizeable .content {
|
||||||
@@ -93,17 +94,10 @@ div.resizegrip > span {
|
|||||||
|
|
||||||
.side-panel.hidden {
|
.side-panel.hidden {
|
||||||
width: 22rem;
|
width: 22rem;
|
||||||
left:-22rem;
|
left:-24rem;
|
||||||
height:100%;
|
height:100%;
|
||||||
top: 0px;
|
top: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.side-panel.extrawide {
|
|
||||||
top:0px;
|
|
||||||
width: 44rem;
|
|
||||||
height:100%;
|
|
||||||
left:0px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { Component, Input,Output,ViewChild,EventEmitter, ElementRef,OnChanges,SimpleChanges,HostListener,ChangeDetectorRef, ViewEncapsulation } from '@angular/core';
|
import { Component, Input,Output,ViewChild,EventEmitter, ElementRef,OnChanges,SimpleChanges,HostListener,ChangeDetectorRef } from '@angular/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'fm-side-panel',
|
selector: 'fm-side-panel',
|
||||||
@@ -13,7 +13,6 @@ export class SidePanelComponent implements OnChanges {
|
|||||||
@Input() public collapsable: boolean;
|
@Input() public collapsable: boolean;
|
||||||
@Input() public resizeable = false;
|
@Input() public resizeable = false;
|
||||||
@Input() public left = false;
|
@Input() public left = false;
|
||||||
@Input() public extrawide: boolean;
|
|
||||||
@Output() onResize: EventEmitter<number> = new EventEmitter<number>();
|
@Output() onResize: EventEmitter<number> = new EventEmitter<number>();
|
||||||
@ViewChild("resizeGrip") elementView: ElementRef;
|
@ViewChild("resizeGrip") elementView: ElementRef;
|
||||||
public mobile = true;
|
public mobile = true;
|
||||||
@@ -42,7 +41,7 @@ export class SidePanelComponent implements OnChanges {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
this.parentHeight = this.element.nativeElement.offsetParent?.clientHeight;
|
this.parentHeight = this.element.nativeElement.offsetParent.clientHeight;
|
||||||
this.setTop();
|
this.setTop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -5,9 +5,6 @@
|
|||||||
<div class="card" *ngIf="user">
|
<div class="card" *ngIf="user">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="username">{{user.name}}</div>
|
<div class="username">{{user.name}}</div>
|
||||||
<div *ngIf="getProvider(); let provider">
|
|
||||||
<small><span i18n>Provider</span><span> {{provider}}</span></small>
|
|
||||||
</div>
|
|
||||||
<div><a href="#" (click)="logout($event)" i18n>logout</a></div>
|
<div><a href="#" (click)="logout($event)" i18n>logout</a></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -20,14 +20,11 @@ export class UserMenuComponent implements OnInit {
|
|||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
}
|
}
|
||||||
|
|
||||||
getProvider():string | null {
|
getLetter():string {
|
||||||
const ownedClaims = this.oauthService.getIdentityClaims();
|
if (this.user && this.user.firstName && this.user.lastName)
|
||||||
if(ownedClaims) {
|
return this.user.firstName.substr(0,1).toUpperCase() +
|
||||||
if (ownedClaims["idp"] != "local") {
|
this.user.lastName.substr(0,1).toUpperCase();
|
||||||
return ownedClaims["idp"];
|
return this.user && this.user.name ? this.user.name.substr(0,1).toUpperCase():"";
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logout(event:MouseEvent) {
|
logout(event:MouseEvent) {
|
||||||
|
@@ -64,8 +64,6 @@ export function reducer(state = initialState, action: appCommonActions.Actions )
|
|||||||
code:a.user.code,
|
code:a.user.code,
|
||||||
email:claims["email"]!== undefined ? claims["email"] : a.user.name,
|
email:claims["email"]!== undefined ? claims["email"] : a.user.name,
|
||||||
name:claims["name"]!== undefined?claims["name"] : a.user.email,
|
name:claims["name"]!== undefined?claims["name"] : a.user.email,
|
||||||
lastName:a.user.lastName,
|
|
||||||
firstName:a.user.firstName,
|
|
||||||
claims:claims,
|
claims:claims,
|
||||||
searchable: false
|
searchable: false
|
||||||
};
|
};
|
||||||
|
@@ -1,29 +0,0 @@
|
|||||||
import { Injectable } from '@angular/core';
|
|
||||||
import { Observable, of } from 'rxjs';
|
|
||||||
import { IItem } from '../models/item';
|
|
||||||
import { HttpClient } from "@angular/common/http";
|
|
||||||
import { AppConfig } from "../shared/app.config";
|
|
||||||
import {ItemTypeService} from './itemtype.service';
|
|
||||||
|
|
||||||
@Injectable({
|
|
||||||
providedIn: 'root',
|
|
||||||
})
|
|
||||||
export class DownloadService {
|
|
||||||
constructor(public httpClient: HttpClient, public appConfig: AppConfig,private itemTypeService:ItemTypeService) {
|
|
||||||
}
|
|
||||||
|
|
||||||
ApiEndpoint() {
|
|
||||||
return this.appConfig.getConfig("apiEndPoint");
|
|
||||||
}
|
|
||||||
|
|
||||||
getData(itemCode: string): Observable<any> {
|
|
||||||
return this.httpClient.get<any>(`${this.ApiEndpoint()}/api/v1/items/${itemCode}/data`);
|
|
||||||
}
|
|
||||||
|
|
||||||
getData2(item: IItem): Observable<any> {
|
|
||||||
if (item.size > 0) {
|
|
||||||
return this.httpClient.get<any>(`${this.ApiEndpoint()}/api/v1/items/${item.code}/data`)
|
|
||||||
}
|
|
||||||
return of({});
|
|
||||||
}
|
|
||||||
}
|
|
@@ -152,13 +152,6 @@ export class ItemService {
|
|||||||
return this.httpClient.put<IItem>(`${this.ApiEndpoint()}/api/v1/items/${item.code}`,item);
|
return this.httpClient.put<IItem>(`${this.ApiEndpoint()}/api/v1/items/${item.code}`,item);
|
||||||
}
|
}
|
||||||
|
|
||||||
putItemFile(item: IItem, jsonObject: any): Observable<IItem> {
|
|
||||||
const formData = new FormData();
|
|
||||||
const file = new File([JSON.stringify(jsonObject, undefined, '\t')], 'data.dat', {type: 'application/json'});
|
|
||||||
formData.append('file', file);
|
|
||||||
return this.httpClient.put<any>(`${this.ApiEndpoint()}/api/v1/items/${item.code}/data`, formData);
|
|
||||||
}
|
|
||||||
|
|
||||||
deleteItem(code: string): Observable<any> {
|
deleteItem(code: string): Observable<any> {
|
||||||
return this.httpClient.delete<any>(`${this.ApiEndpoint()}/api/v1/items/${code}`);
|
return this.httpClient.delete<any>(`${this.ApiEndpoint()}/api/v1/items/${code}`);
|
||||||
}
|
}
|
||||||
@@ -203,4 +196,5 @@ export class ItemService {
|
|||||||
getBreadcrumbs(itemCode: string): Observable<IListItem[]> {
|
getBreadcrumbs(itemCode: string): Observable<IListItem[]> {
|
||||||
return this.httpClient.get<any>(`${this.ApiEndpoint()}/api/v1/items/${itemCode}/breadcrumbs`);
|
return this.httpClient.get<any>(`${this.ApiEndpoint()}/api/v1/items/${itemCode}/breadcrumbs`);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -27,7 +27,7 @@ export class ItemTypeService {
|
|||||||
|
|
||||||
getExtraAttributes(itemType: string) {
|
getExtraAttributes(itemType: string) {
|
||||||
let extraAttributes = null;
|
let extraAttributes = null;
|
||||||
if (this.itemTypes[itemType] && this.itemTypes[itemType].extraAttributes) extraAttributes = this.itemTypes[itemType].extraAttributes;
|
if (this.itemTypes[itemType]) extraAttributes = this.itemTypes[itemType].extraAttributes;
|
||||||
return extraAttributes;
|
return extraAttributes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,10 +0,0 @@
|
|||||||
import { Injectable, isDevMode } from '@angular/core';
|
|
||||||
|
|
||||||
@Injectable({
|
|
||||||
providedIn: 'root',
|
|
||||||
})
|
|
||||||
export class ProductionGuard {
|
|
||||||
canActivate(): boolean {
|
|
||||||
return !isDevMode();
|
|
||||||
}
|
|
||||||
}
|
|
@@ -29,8 +29,7 @@
|
|||||||
"strictMetadataEmit": true,
|
"strictMetadataEmit": true,
|
||||||
"fullTemplateTypeCheck": true,
|
"fullTemplateTypeCheck": true,
|
||||||
"strictInjectionParameters": true,
|
"strictInjectionParameters": true,
|
||||||
"enableResourceInlining": true,
|
"enableResourceInlining": true
|
||||||
"compilationMode": "partial"
|
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"src/test.ts",
|
"src/test.ts",
|
||||||
|
56
projects/ngx-openlayers/.eslintrc.json
Normal file
56
projects/ngx-openlayers/.eslintrc.json
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
{
|
||||||
|
"extends": "../../.eslintrc.json",
|
||||||
|
"ignorePatterns": [
|
||||||
|
"!**/*"
|
||||||
|
],
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": [
|
||||||
|
"*.ts"
|
||||||
|
],
|
||||||
|
"parserOptions": {
|
||||||
|
"project": [
|
||||||
|
"projects/ngx-openlayers/tsconfig.lib.json",
|
||||||
|
"projects/ngx-openlayers/tsconfig.spec.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",
|
||||||
|
"no-underscore-dangle": "off"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": [
|
||||||
|
"*.html"
|
||||||
|
],
|
||||||
|
"rules": {}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
10
projects/ngx-openlayers/ng-package.json
Normal file
10
projects/ngx-openlayers/ng-package.json
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
|
||||||
|
"dest": "../../dist/ngx-openlayers",
|
||||||
|
"assets": [
|
||||||
|
"ngcc.config.js"
|
||||||
|
],
|
||||||
|
"lib": {
|
||||||
|
"entryFile": "src/public-api.ts"
|
||||||
|
}
|
||||||
|
}
|
3
projects/ngx-openlayers/ngcc.config.js
Normal file
3
projects/ngx-openlayers/ngcc.config.js
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
module.exports = {
|
||||||
|
ignorableDeepImportMatchers: [/ol\//]
|
||||||
|
};
|
17
projects/ngx-openlayers/package-lock.json
generated
Normal file
17
projects/ngx-openlayers/package-lock.json
generated
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"name": "ngx-openlayers",
|
||||||
|
"version": "2.0.0",
|
||||||
|
"lockfileVersion": 3,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {
|
||||||
|
"": {
|
||||||
|
"name": "ngx-openlayers",
|
||||||
|
"version": "2.0.0",
|
||||||
|
"peerDependencies": {
|
||||||
|
"@angular/common": ">=14.x.x",
|
||||||
|
"@angular/core": ">=14.x.x",
|
||||||
|
"ol": "^6.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
12
projects/ngx-openlayers/package.json
Normal file
12
projects/ngx-openlayers/package.json
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"name": "ngx-openlayers",
|
||||||
|
"version": "2.0.0",
|
||||||
|
"publishConfig": {
|
||||||
|
"registry": "https://repository.akkerweb.nl/repository/npm-hosted/"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@angular/common": ">=14.x.x",
|
||||||
|
"@angular/core": ">=14.x.x",
|
||||||
|
"ol": "^6.0.0"
|
||||||
|
}
|
||||||
|
}
|
18
projects/ngx-openlayers/src/lib/attribution.component.ts
Normal file
18
projects/ngx-openlayers/src/lib/attribution.component.ts
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
import { Component, ElementRef, OnInit } from '@angular/core';
|
||||||
|
import { Attribution } from 'ol/control';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'aol-attribution',
|
||||||
|
template: '<ng-content></ng-content>',
|
||||||
|
})
|
||||||
|
export class AttributionComponent implements OnInit {
|
||||||
|
instance: Attribution;
|
||||||
|
html: string;
|
||||||
|
|
||||||
|
constructor(private elementRef: ElementRef) {}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.html = this.elementRef.nativeElement.innerHTML;
|
||||||
|
this.instance = new Attribution(this);
|
||||||
|
}
|
||||||
|
}
|
26
projects/ngx-openlayers/src/lib/attributions.component.ts
Normal file
26
projects/ngx-openlayers/src/lib/attributions.component.ts
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
import { AfterViewInit, Component, ContentChildren, Host, QueryList } from '@angular/core';
|
||||||
|
import { Attribution } from 'ol/control';
|
||||||
|
import { AttributionComponent } from './attribution.component';
|
||||||
|
import { SourceComponent } from './sources/source.component';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'aol-attributions',
|
||||||
|
template: '<ng-content></ng-content>',
|
||||||
|
})
|
||||||
|
export class AttributionsComponent implements AfterViewInit {
|
||||||
|
@ContentChildren(AttributionComponent)
|
||||||
|
attributions: QueryList<AttributionComponent>;
|
||||||
|
|
||||||
|
instance: Array<Attribution>;
|
||||||
|
|
||||||
|
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.instance);
|
||||||
|
// console.log('setting attributions:', this.instance);
|
||||||
|
this.source.instance.setAttributions(this.instance);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,89 @@
|
|||||||
|
import { Component, Input, OnChanges, OnInit, Optional, SimpleChanges } from '@angular/core';
|
||||||
|
import { Coordinate } from 'ol/coordinate';
|
||||||
|
import { transform } from 'ol/proj';
|
||||||
|
import { GeometryLinestringComponent } from './geom/geometrylinestring.component';
|
||||||
|
import { GeometryMultiLinestringComponent } from './geom/geometrymultilinestring.component';
|
||||||
|
import { GeometryMultiPointComponent } from './geom/geometrymultipoint.component';
|
||||||
|
import { GeometryMultiPolygonComponent } from './geom/geometrymultipolygon.component';
|
||||||
|
import { GeometryPolygonComponent } from './geom/geometrypolygon.component';
|
||||||
|
import { MapComponent } from './map.component';
|
||||||
|
|
||||||
|
@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);
|
||||||
|
}
|
||||||
|
}
|
9
projects/ngx-openlayers/src/lib/content.component.ts
Normal file
9
projects/ngx-openlayers/src/lib/content.component.ts
Normal 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) {}
|
||||||
|
}
|
@@ -0,0 +1,30 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
componentType = 'control';
|
||||||
|
instance: Attribution;
|
||||||
|
target: Element;
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,33 @@
|
|||||||
|
import { Component, ContentChild, OnDestroy, OnInit } from '@angular/core';
|
||||||
|
import { Control } from 'ol/control';
|
||||||
|
import { ContentComponent } from '../content.component';
|
||||||
|
import { MapComponent } from '../map.component';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'aol-control',
|
||||||
|
template: ` <ng-content></ng-content> `,
|
||||||
|
})
|
||||||
|
export class ControlComponent implements OnInit, OnDestroy {
|
||||||
|
@ContentChild(ContentComponent, { static: true })
|
||||||
|
content: ContentComponent;
|
||||||
|
|
||||||
|
componentType = 'control';
|
||||||
|
instance: Control;
|
||||||
|
element: Element;
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,42 @@
|
|||||||
|
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
|
||||||
|
import { Collection } from 'ol';
|
||||||
|
import { Control, defaults } from 'ol/control';
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
}
|
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,33 @@
|
|||||||
|
import { Component, ElementRef, Input, OnDestroy, OnInit } from '@angular/core';
|
||||||
|
import MousePosition from 'ol/control/MousePosition';
|
||||||
|
import { CoordinateFormat } from 'ol/coordinate';
|
||||||
|
import { ProjectionLike } from 'ol/proj';
|
||||||
|
import { MapComponent } from '../map.component';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'aol-control-mouseposition',
|
||||||
|
template: ``,
|
||||||
|
})
|
||||||
|
export class ControlMousePositionComponent implements OnInit, OnDestroy {
|
||||||
|
@Input()
|
||||||
|
coordinateFormat: CoordinateFormat;
|
||||||
|
@Input()
|
||||||
|
projection: ProjectionLike;
|
||||||
|
target: Element;
|
||||||
|
|
||||||
|
instance: MousePosition;
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,53 @@
|
|||||||
|
import { Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
|
||||||
|
import { View } from 'ol';
|
||||||
|
import { OverviewMap } from 'ol/control';
|
||||||
|
import { Layer } from 'ol/layer';
|
||||||
|
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: Element;
|
||||||
|
@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);
|
||||||
|
}
|
||||||
|
}
|
36
projects/ngx-openlayers/src/lib/controls/rotate.component.ts
Normal file
36
projects/ngx-openlayers/src/lib/controls/rotate.component.ts
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,28 @@
|
|||||||
|
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
|
||||||
|
import { ScaleLine } from 'ol/control';
|
||||||
|
import { MapComponent } from '../map.component';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'aol-control-scaleline',
|
||||||
|
template: ` <ng-content></ng-content> `,
|
||||||
|
})
|
||||||
|
export class ControlScaleLineComponent implements OnInit, OnDestroy {
|
||||||
|
@Input()
|
||||||
|
units: string;
|
||||||
|
|
||||||
|
instance: ScaleLine;
|
||||||
|
|
||||||
|
constructor(private map: MapComponent) {
|
||||||
|
// console.log('instancing aol-control-scaleline');
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.instance = new ScaleLine(this);
|
||||||
|
this.map.instance.addControl(this.instance);
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnDestroy() {
|
||||||
|
// console.log('removing aol-control-scaleline');
|
||||||
|
this.map.instance.removeControl(this.instance);
|
||||||
|
}
|
||||||
|
}
|
38
projects/ngx-openlayers/src/lib/controls/zoom.component.ts
Normal file
38
projects/ngx-openlayers/src/lib/controls/zoom.component.ts
Normal 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 | Node;
|
||||||
|
@Input()
|
||||||
|
zoomOutLabel: string | Node;
|
||||||
|
@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);
|
||||||
|
}
|
||||||
|
}
|
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,35 @@
|
|||||||
|
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
|
||||||
|
import { ZoomToExtent } from 'ol/control';
|
||||||
|
import { Extent } from 'ol/extent';
|
||||||
|
import { MapComponent } from '../map.component';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'aol-control-zoomtoextent',
|
||||||
|
template: ` <ng-content></ng-content> `,
|
||||||
|
})
|
||||||
|
export class ControlZoomToExtentComponent implements OnInit, OnDestroy {
|
||||||
|
@Input()
|
||||||
|
className: string;
|
||||||
|
@Input()
|
||||||
|
label: string | Node;
|
||||||
|
@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);
|
||||||
|
}
|
||||||
|
}
|
80
projects/ngx-openlayers/src/lib/coordinate.component.ts
Normal file
80
projects/ngx-openlayers/src/lib/coordinate.component.ts
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
import { Component, Input, OnChanges, OnInit, Optional, SimpleChanges } from '@angular/core';
|
||||||
|
import { transform } from 'ol/proj';
|
||||||
|
import { GeometryCircleComponent } from './geom/geometrycircle.component';
|
||||||
|
import { GeometryPointComponent } from './geom/geometrypoint.component';
|
||||||
|
import { MapComponent } from './map.component';
|
||||||
|
import { OverlayComponent } from './overlay.component';
|
||||||
|
import { ViewComponent } from './view.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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
35
projects/ngx-openlayers/src/lib/feature.component.ts
Normal file
35
projects/ngx-openlayers/src/lib/feature.component.ts
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
import { Component, Input, OnChanges, OnDestroy, OnInit, 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;
|
||||||
|
|
||||||
|
componentType = 'feature';
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,6 @@
|
|||||||
|
import Feature from 'ol/format/Feature';
|
||||||
|
|
||||||
|
export class FormatComponent {
|
||||||
|
public instance: Feature;
|
||||||
|
public componentType = 'format';
|
||||||
|
}
|
30
projects/ngx-openlayers/src/lib/formats/mvt.component.ts
Normal file
30
projects/ngx-openlayers/src/lib/formats/mvt.component.ts
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
import { Component, forwardRef, Input } from '@angular/core';
|
||||||
|
import { MVT } from 'ol/format';
|
||||||
|
import { Geometry } from 'ol/geom';
|
||||||
|
import GeometryType from 'ol/geom/GeometryType';
|
||||||
|
import { FormatComponent } from './format.component';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'aol-format-mvt',
|
||||||
|
template: '',
|
||||||
|
providers: [{ provide: FormatComponent, useExisting: forwardRef(() => FormatMVTComponent) }],
|
||||||
|
})
|
||||||
|
export class FormatMVTComponent extends FormatComponent {
|
||||||
|
@Input()
|
||||||
|
featureClass:
|
||||||
|
| ((geom: Geometry | { [k: string]: any }) => any)
|
||||||
|
| ((geom: GeometryType, arg2: number[], arg3: number[] | number[][], arg4: { [k: string]: any }) => any);
|
||||||
|
@Input()
|
||||||
|
geometryName: string;
|
||||||
|
@Input()
|
||||||
|
layerName: string;
|
||||||
|
@Input()
|
||||||
|
layers: string[];
|
||||||
|
|
||||||
|
instance: MVT;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
this.instance = new MVT(this);
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,28 @@
|
|||||||
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
|
import { Circle } from 'ol/geom';
|
||||||
|
import { FeatureComponent } from '../feature.component';
|
||||||
|
import { MapComponent } from '../map.component';
|
||||||
|
import { SimpleGeometryComponent } from './simplegeometry.component';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'aol-geometry-circle',
|
||||||
|
template: ` <ng-content></ng-content> `,
|
||||||
|
})
|
||||||
|
export class GeometryCircleComponent extends SimpleGeometryComponent implements OnInit {
|
||||||
|
componentType = 'geometry-circle';
|
||||||
|
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]);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Input()
|
||||||
|
get radius(): number {
|
||||||
|
return this.instance.getRadius();
|
||||||
|
}
|
||||||
|
set radius(radius: number) {
|
||||||
|
this.instance.setRadius(radius);
|
||||||
|
}
|
||||||
|
}
|
@@ -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();
|
||||||
|
}
|
||||||
|
}
|
@@ -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();
|
||||||
|
}
|
||||||
|
}
|
@@ -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();
|
||||||
|
}
|
||||||
|
}
|
@@ -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();
|
||||||
|
}
|
||||||
|
}
|
@@ -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();
|
||||||
|
}
|
||||||
|
}
|
@@ -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();
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,18 @@
|
|||||||
|
import { Directive, Input, OnInit } from '@angular/core';
|
||||||
|
import SimpleGeometry from 'ol/geom/SimpleGeometry';
|
||||||
|
import { FeatureComponent } from '../feature.component';
|
||||||
|
import { MapComponent } from '../map.component';
|
||||||
|
|
||||||
|
@Directive()
|
||||||
|
export abstract class SimpleGeometryComponent implements OnInit {
|
||||||
|
@Input() srid: string;
|
||||||
|
|
||||||
|
instance: SimpleGeometry;
|
||||||
|
componentType = 'simple-geometry';
|
||||||
|
|
||||||
|
constructor(protected map: MapComponent, protected host: FeatureComponent) {}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.host.instance.setGeometry(this.instance);
|
||||||
|
}
|
||||||
|
}
|
57
projects/ngx-openlayers/src/lib/graticule.component.ts
Normal file
57
projects/ngx-openlayers/src/lib/graticule.component.ts
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
import { AfterContentInit, Component, Input, OnChanges, OnDestroy, SimpleChanges } 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;
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,23 @@
|
|||||||
|
import { Component, 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 {
|
||||||
|
instance: Collection<Interaction>;
|
||||||
|
|
||||||
|
constructor(private map: MapComponent) {}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.instance = defaults();
|
||||||
|
this.instance.forEach((i) => this.map.instance.addInteraction(i));
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnDestroy() {
|
||||||
|
this.instance.forEach((i) => this.map.instance.removeInteraction(i));
|
||||||
|
}
|
||||||
|
}
|
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,31 @@
|
|||||||
|
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
|
||||||
|
import Feature from 'ol/format/Feature';
|
||||||
|
import { DragAndDrop } from 'ol/interaction';
|
||||||
|
import { ProjectionLike } from 'ol/proj';
|
||||||
|
import { MapComponent } from '../map.component';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'aol-interaction-draganddrop',
|
||||||
|
template: '',
|
||||||
|
})
|
||||||
|
export class DragAndDropInteractionComponent implements OnInit, OnDestroy {
|
||||||
|
@Input()
|
||||||
|
formatConstructors: ((n: Feature) => any)[];
|
||||||
|
@Input()
|
||||||
|
projection: ProjectionLike;
|
||||||
|
@Input()
|
||||||
|
target: Element;
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,31 @@
|
|||||||
|
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
|
||||||
|
import { Condition } from 'ol/events/condition';
|
||||||
|
import { DragBox } from 'ol/interaction';
|
||||||
|
import { EndCondition } from 'ol/interaction/DragBox';
|
||||||
|
import { MapComponent } from '../map.component';
|
||||||
|
|
||||||
|
@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);
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,29 @@
|
|||||||
|
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
|
||||||
|
import Kinetic from 'ol/Kinetic';
|
||||||
|
import { Condition } from 'ol/events/condition';
|
||||||
|
import { DragPan } from 'ol/interaction';
|
||||||
|
import { MapComponent } from '../map.component';
|
||||||
|
|
||||||
|
@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);
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,28 @@
|
|||||||
|
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
|
||||||
|
import { Condition } from 'ol/events/condition';
|
||||||
|
import { DragRotate } from 'ol/interaction';
|
||||||
|
import { MapComponent } from '../map.component';
|
||||||
|
|
||||||
|
@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);
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,28 @@
|
|||||||
|
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
|
||||||
|
import { Condition } from 'ol/events/condition';
|
||||||
|
import { DragRotateAndZoom } from 'ol/interaction';
|
||||||
|
import { MapComponent } from '../map.component';
|
||||||
|
|
||||||
|
@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);
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,32 @@
|
|||||||
|
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
|
||||||
|
import { Condition } from 'ol/events/condition';
|
||||||
|
import { DragZoom } from 'ol/interaction';
|
||||||
|
import { MapComponent } from '../map.component';
|
||||||
|
|
||||||
|
@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);
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,76 @@
|
|||||||
|
import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core';
|
||||||
|
import { Collection, Feature } from 'ol';
|
||||||
|
import { Condition } from 'ol/events/condition';
|
||||||
|
import GeometryType from 'ol/geom/GeometryType';
|
||||||
|
import { Draw } from 'ol/interaction';
|
||||||
|
import { DrawEvent, GeometryFunction } from 'ol/interaction/Draw';
|
||||||
|
import { Vector } from 'ol/source';
|
||||||
|
import { Style } from 'ol/style';
|
||||||
|
import { StyleFunction } from 'ol/style/Style';
|
||||||
|
import { MapComponent } from '../map.component';
|
||||||
|
|
||||||
|
@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: GeometryType;
|
||||||
|
@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<DrawEvent>();
|
||||||
|
@Output()
|
||||||
|
drawEnd = new EventEmitter<DrawEvent>();
|
||||||
|
@Output()
|
||||||
|
drawStart = new EventEmitter<DrawEvent>();
|
||||||
|
@Output()
|
||||||
|
propertyChange = new EventEmitter<DrawEvent>();
|
||||||
|
|
||||||
|
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: DrawEvent) => this.olChangeActive.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('propertychange', (event: DrawEvent) => this.propertyChange.emit(event));
|
||||||
|
this.map.instance.addInteraction(this.instance);
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnDestroy() {
|
||||||
|
this.map.instance.removeInteraction(this.instance);
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,59 @@
|
|||||||
|
import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core';
|
||||||
|
import { Collection, Feature } from 'ol';
|
||||||
|
import { Condition } from 'ol/events/condition';
|
||||||
|
import { Modify } from 'ol/interaction';
|
||||||
|
import { ModifyEvent } from 'ol/interaction/Modify';
|
||||||
|
import { Vector } from 'ol/source';
|
||||||
|
import { Style } from 'ol/style';
|
||||||
|
import { StyleFunction } from 'ol/style/Style';
|
||||||
|
import { MapComponent } from '../map.component';
|
||||||
|
|
||||||
|
@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()
|
||||||
|
modifyEnd = new EventEmitter<ModifyEvent>();
|
||||||
|
@Output()
|
||||||
|
modifyStart = new EventEmitter<ModifyEvent>();
|
||||||
|
@Output()
|
||||||
|
olChange = new EventEmitter<ModifyEvent>();
|
||||||
|
@Output()
|
||||||
|
olChangeActive = new EventEmitter<ModifyEvent>();
|
||||||
|
@Output()
|
||||||
|
propertyChange = new EventEmitter<ModifyEvent>();
|
||||||
|
|
||||||
|
instance: Modify;
|
||||||
|
|
||||||
|
constructor(private map: MapComponent) {}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.instance = new Modify(this);
|
||||||
|
this.instance.on('change', (event: ModifyEvent) => this.olChange.emit(event));
|
||||||
|
this.instance.on('change:active', (event: ModifyEvent) => this.olChangeActive.emit(event));
|
||||||
|
this.instance.on('propertychange', (event: ModifyEvent) => this.propertyChange.emit(event));
|
||||||
|
this.instance.on('modifyend', (event: ModifyEvent) => this.modifyEnd.emit(event));
|
||||||
|
this.instance.on('modifystart', (event: ModifyEvent) => this.modifyStart.emit(event));
|
||||||
|
this.map.instance.addInteraction(this.instance);
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnDestroy() {
|
||||||
|
this.map.instance.removeInteraction(this.instance);
|
||||||
|
}
|
||||||
|
}
|
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,27 @@
|
|||||||
|
import { Component, Input, OnDestroy, OnInit } 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);
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,61 @@
|
|||||||
|
import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core';
|
||||||
|
import { Collection, Feature } from 'ol';
|
||||||
|
import { Condition } from 'ol/events/condition';
|
||||||
|
import { Select } from 'ol/interaction';
|
||||||
|
import { FilterFunction, SelectEvent } from 'ol/interaction/Select';
|
||||||
|
import { Layer } from 'ol/layer';
|
||||||
|
import { Style } from 'ol/style';
|
||||||
|
import { StyleFunction } from 'ol/style/Style';
|
||||||
|
import { MapComponent } from '../map.component';
|
||||||
|
|
||||||
|
@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()
|
||||||
|
olSelect = new EventEmitter<SelectEvent>();
|
||||||
|
@Output()
|
||||||
|
propertyChange = 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('select', (event: SelectEvent) => this.olSelect.emit(event));
|
||||||
|
this.instance.on('propertychange', (event: SelectEvent) => this.propertyChange.emit(event));
|
||||||
|
|
||||||
|
this.map.instance.addInteraction(this.instance);
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnDestroy() {
|
||||||
|
this.map.instance.removeInteraction(this.instance);
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,56 @@
|
|||||||
|
import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core';
|
||||||
|
import { Collection, Feature } from 'ol';
|
||||||
|
import { Translate } from 'ol/interaction';
|
||||||
|
import { TranslateEvent } from 'ol/interaction/Translate';
|
||||||
|
import { Layer } from 'ol/layer';
|
||||||
|
import { MapComponent } from '../map.component';
|
||||||
|
|
||||||
|
@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: EventEmitter<TranslateEvent>;
|
||||||
|
@Output()
|
||||||
|
propertyChange: EventEmitter<TranslateEvent>;
|
||||||
|
@Output()
|
||||||
|
translateEnd: EventEmitter<TranslateEvent>;
|
||||||
|
@Output()
|
||||||
|
translateStart: EventEmitter<TranslateEvent>;
|
||||||
|
@Output()
|
||||||
|
translating: EventEmitter<TranslateEvent>;
|
||||||
|
|
||||||
|
instance: Translate;
|
||||||
|
|
||||||
|
constructor(private map: MapComponent) {
|
||||||
|
this.olChange = new EventEmitter<TranslateEvent>();
|
||||||
|
this.propertyChange = new EventEmitter<TranslateEvent>();
|
||||||
|
this.translateEnd = new EventEmitter<TranslateEvent>();
|
||||||
|
this.translateStart = new EventEmitter<TranslateEvent>();
|
||||||
|
this.translating = new EventEmitter<TranslateEvent>();
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.instance = new Translate(this);
|
||||||
|
|
||||||
|
this.instance.on('change', (event: TranslateEvent) => this.olChange.emit(event));
|
||||||
|
this.instance.on('propertychange', (event: TranslateEvent) => 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);
|
||||||
|
}
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user