Compare commits
No commits in common. "7696ddd8d2cd5e67edb0ae0b149c84a52a35176a" and "835851350c5bdc2c569acf8594794bd7f0c59e94" have entirely different histories.
7696ddd8d2
...
835851350c
@ -13,16 +13,13 @@ pipeline {
|
|||||||
npm install
|
npm install
|
||||||
cd ../common-map
|
cd ../common-map
|
||||||
npm install
|
npm install
|
||||||
cd ../common-map3d
|
|
||||||
npm install
|
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('build'){
|
stage('build'){
|
||||||
steps {
|
steps {
|
||||||
sh '''ng build common
|
sh '''ng build common
|
||||||
ng build common-map
|
ng build common-map'''
|
||||||
ng build common-map3d'''
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('npm publish'){
|
stage('npm publish'){
|
||||||
@ -32,9 +29,6 @@ pipeline {
|
|||||||
npm publish
|
npm publish
|
||||||
cd ../common-map
|
cd ../common-map
|
||||||
npm version ${PACKAGE_VERSION}
|
npm version ${PACKAGE_VERSION}
|
||||||
npm publish
|
|
||||||
cd ../common-map3d
|
|
||||||
npm version ${PACKAGE_VERSION}
|
|
||||||
npm publish'''
|
npm publish'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
56
angular.json
56
angular.json
@ -11,11 +11,8 @@
|
|||||||
"schematics": {},
|
"schematics": {},
|
||||||
"architect": {
|
"architect": {
|
||||||
"build": {
|
"build": {
|
||||||
"builder": "@angular-builders/custom-webpack:browser",
|
"builder": "@angular-devkit/build-angular:browser",
|
||||||
"options": {
|
"options": {
|
||||||
"customWebpackConfig": {
|
|
||||||
"path": "./custom-webpack.config.js"
|
|
||||||
},
|
|
||||||
"aot": true,
|
"aot": true,
|
||||||
"outputPath": "dist/farmmaps-lib-app",
|
"outputPath": "dist/farmmaps-lib-app",
|
||||||
"index": "src/index.html",
|
"index": "src/index.html",
|
||||||
@ -38,20 +35,13 @@
|
|||||||
"input": "src/assets",
|
"input": "src/assets",
|
||||||
"output": "/"
|
"output": "/"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"glob": "**/*",
|
|
||||||
"input": "node_modules/cesium/Build/Cesium",
|
|
||||||
"output": "/assets/cesium"
|
|
||||||
},
|
|
||||||
"src/configuration.json"
|
"src/configuration.json"
|
||||||
],
|
],
|
||||||
"styles": [
|
"styles": [
|
||||||
"src/styles.css",
|
"src/styles.css",
|
||||||
"node_modules/bootstrap/dist/css/bootstrap.min.css",
|
"node_modules/bootstrap/dist/css/bootstrap.min.css",
|
||||||
"node_modules/font-awesome/css/font-awesome.min.css",
|
"node_modules/font-awesome/css/font-awesome.min.css",
|
||||||
"fonts/FMIconFont/style.css",
|
"fonts/FMIconFont/style.css"
|
||||||
"node_modules/cesium/Build/Cesium/Widgets/widgets.css",
|
|
||||||
"node_modules/ol/ol.css"
|
|
||||||
],
|
],
|
||||||
"scripts": []
|
"scripts": []
|
||||||
},
|
},
|
||||||
@ -87,7 +77,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"serve": {
|
"serve": {
|
||||||
"builder": "@angular-builders/custom-webpack:dev-server",
|
"builder": "@angular-devkit/build-angular:dev-server",
|
||||||
"options": {
|
"options": {
|
||||||
"browserTarget": "farmmaps-lib-app:build"
|
"browserTarget": "farmmaps-lib-app:build"
|
||||||
},
|
},
|
||||||
@ -241,46 +231,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"common-map3d": {
|
|
||||||
"projectType": "library",
|
|
||||||
"root": "projects/common-map3d",
|
|
||||||
"sourceRoot": "projects/common-map3d/src",
|
|
||||||
"prefix": "fm-map3d",
|
|
||||||
"architect": {
|
|
||||||
"build": {
|
|
||||||
"builder": "@angular-devkit/build-angular:ng-packagr",
|
|
||||||
"options": {
|
|
||||||
"tsConfig": "projects/common-map3d/tsconfig.lib.json",
|
|
||||||
"project": "projects/common-map3d/ng-package.json"
|
|
||||||
},
|
|
||||||
"configurations": {
|
|
||||||
"production": {
|
|
||||||
"tsConfig": "projects/common-map3d/tsconfig.lib.prod.json"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"test": {
|
|
||||||
"builder": "@angular-devkit/build-angular:karma",
|
|
||||||
"options": {
|
|
||||||
"main": "projects/common-map3d/src/test.ts",
|
|
||||||
"tsConfig": "projects/common-map3d/tsconfig.spec.json",
|
|
||||||
"karmaConfig": "projects/common-map3d/karma.conf.js"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"lint": {
|
|
||||||
"builder": "@angular-devkit/build-angular:tslint",
|
|
||||||
"options": {
|
|
||||||
"tsConfig": [
|
|
||||||
"projects/common-map3d/tsconfig.lib.json",
|
|
||||||
"projects/common-map3d/tsconfig.spec.json"
|
|
||||||
],
|
|
||||||
"exclude": [
|
|
||||||
"**/node_modules/**"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"defaultProject": "farmmaps-lib-app"
|
"defaultProject": "farmmaps-lib-app"
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
node: {
|
|
||||||
// Resolve node module use of fs
|
|
||||||
fs: "empty",
|
|
||||||
Buffer: false,
|
|
||||||
http: "empty",
|
|
||||||
https: "empty",
|
|
||||||
zlib: "empty"
|
|
||||||
}
|
|
||||||
};
|
|
61
package-lock.json
generated
61
package-lock.json
generated
@ -4,35 +4,6 @@
|
|||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular-builders/custom-webpack": {
|
|
||||||
"version": "10.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@angular-builders/custom-webpack/-/custom-webpack-10.0.1.tgz",
|
|
||||||
"integrity": "sha512-YDy5zEKVwXdoXLjmbsY6kGaEbmunQxaPipxrwLUc9hIjRLU2WcrX9vopf1R9Pgj4POad73IPBNGu+ibqNRFIEQ==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"@angular-devkit/architect": ">=0.1000.0 < 0.1100.0",
|
|
||||||
"@angular-devkit/build-angular": ">=0.1000.0 < 0.1100.0",
|
|
||||||
"@angular-devkit/core": "^10.0.0",
|
|
||||||
"lodash": "^4.17.15",
|
|
||||||
"ts-node": "^9.0.0",
|
|
||||||
"webpack-merge": "^4.2.2"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"ts-node": {
|
|
||||||
"version": "9.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/ts-node/-/ts-node-9.0.0.tgz",
|
|
||||||
"integrity": "sha512-/TqB4SnererCDR/vb4S/QvSZvzQMJN8daAslg7MeaiHvD8rDZsSfXmNeNumyZZzMned72Xoq/isQljYSt8Ynfg==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"arg": "^4.1.0",
|
|
||||||
"diff": "^4.0.1",
|
|
||||||
"make-error": "^1.1.1",
|
|
||||||
"source-map-support": "^0.5.17",
|
|
||||||
"yn": "3.1.1"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"@angular-devkit/architect": {
|
"@angular-devkit/architect": {
|
||||||
"version": "0.1001.3",
|
"version": "0.1001.3",
|
||||||
"resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.1001.3.tgz",
|
"resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.1001.3.tgz",
|
||||||
@ -1715,9 +1686,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@farmmaps/common-map": {
|
"@farmmaps/common-map": {
|
||||||
"version": "0.0.1-prerelease.426",
|
"version": "0.0.1-prerelease.420",
|
||||||
"resolved": "https://repository.akkerweb.nl/repository/npm-group/@farmmaps/common-map/-/common-map-0.0.1-prerelease.426.tgz",
|
"resolved": "https://repository.akkerweb.nl/repository/npm-group/@farmmaps/common-map/-/common-map-0.0.1-prerelease.420.tgz",
|
||||||
"integrity": "sha512-wt1GB0UY9GVfzOvhuKmsDeMXR7hvV4rJmIIAB8f8yYkM/5vja8sY9VqFXidNvbW4Kp6KHgkzByCOG4qtcyDLdw==",
|
"integrity": "sha512-91vy6x4M0ms/lk8Zc8I0uaAk2IG15UG1SXYDvuxgoQZHpQxaGQhALvKkf1mY8V27pwwx6dVDYs8X9VuTRIy9rw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"tslib": "^2.0.0"
|
"tslib": "^2.0.0"
|
||||||
}
|
}
|
||||||
@ -3255,11 +3226,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz",
|
"resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz",
|
||||||
"integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw="
|
"integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw="
|
||||||
},
|
},
|
||||||
"cesium": {
|
|
||||||
"version": "1.73.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/cesium/-/cesium-1.73.0.tgz",
|
|
||||||
"integrity": "sha512-HqvxPbCEsE1Szdm5qPIrBNjHG2cJ9Xk5uYMELmG0GuBL/sYaQ/0IMton43LUBY4E/wblRivNo1Vz7tIQweraFw=="
|
|
||||||
},
|
|
||||||
"chalk": {
|
"chalk": {
|
||||||
"version": "2.4.2",
|
"version": "2.4.2",
|
||||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
|
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
|
||||||
@ -8222,9 +8188,19 @@
|
|||||||
"integrity": "sha512-6YHXtdXkGH3w0NQoaUgNYAcrj064Lv5RTO284ha/hvpNTrh55yQz2cVh0VvwBk3MjyY2tdmLH4SuCJDszYdYiw=="
|
"integrity": "sha512-6YHXtdXkGH3w0NQoaUgNYAcrj064Lv5RTO284ha/hvpNTrh55yQz2cVh0VvwBk3MjyY2tdmLH4SuCJDszYdYiw=="
|
||||||
},
|
},
|
||||||
"ngx-openlayers": {
|
"ngx-openlayers": {
|
||||||
"version": "1.0.0-next.16",
|
"version": "1.0.0-next.13",
|
||||||
"resolved": "https://registry.npmjs.org/ngx-openlayers/-/ngx-openlayers-1.0.0-next.16.tgz",
|
"resolved": "https://registry.npmjs.org/ngx-openlayers/-/ngx-openlayers-1.0.0-next.13.tgz",
|
||||||
"integrity": "sha512-GzNCyjj72AHEcmf8oT6SDSZLYBwKBJwRebMv1SgPdY4gsoQ/dbpqY7nmjX8k8kuQoVQQxt7UyIak3tcNYbOKVQ=="
|
"integrity": "sha512-6y724s5JV6n1oxEhryxP3wcbwzpierj9RLiMLXInfKOG3l5IO1AtPNkeK9+mKctVDUVm5URIfzzZH02Ld+bvSQ==",
|
||||||
|
"requires": {
|
||||||
|
"tslib": "^1.9.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"tslib": {
|
||||||
|
"version": "1.13.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz",
|
||||||
|
"integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q=="
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"ngx-uploadx": {
|
"ngx-uploadx": {
|
||||||
"version": "3.5.2",
|
"version": "3.5.2",
|
||||||
@ -8722,11 +8698,6 @@
|
|||||||
"rbush": "^3.0.1"
|
"rbush": "^3.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ol-cesium": {
|
|
||||||
"version": "2.11.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/ol-cesium/-/ol-cesium-2.11.3.tgz",
|
|
||||||
"integrity": "sha512-rdjk2BjNgSQF1i6wV2FfmGATAdnaLQ5d7DMIhIBoxRVpUYvOOp7swptIQZLDXQMVzqkVJUoY7AKFLEFLbUV+TQ=="
|
|
||||||
},
|
|
||||||
"on-finished": {
|
"on-finished": {
|
||||||
"version": "2.3.0",
|
"version": "2.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
|
||||||
|
@ -28,15 +28,13 @@
|
|||||||
"@ngrx/store": "^10.0",
|
"@ngrx/store": "^10.0",
|
||||||
"angular-oauth2-oidc": "^10.0.3",
|
"angular-oauth2-oidc": "^10.0.3",
|
||||||
"bootstrap": "^4.4.1",
|
"bootstrap": "^4.4.1",
|
||||||
"cesium": "^1.73.0",
|
|
||||||
"core-js": "^2.6.11",
|
"core-js": "^2.6.11",
|
||||||
"font-awesome": "^4.7.0",
|
"font-awesome": "^4.7.0",
|
||||||
"ngrx-store-localstorage": "^10.0",
|
"ngrx-store-localstorage": "^10.0",
|
||||||
"ngx-bootstrap": "^5.6.1",
|
"ngx-bootstrap": "^5.6.1",
|
||||||
"ngx-openlayers": "1.0.0-next.16",
|
"ngx-openlayers": "1.0.0-next.13",
|
||||||
"ngx-uploadx": "^3.5.1",
|
"ngx-uploadx": "^3.5.1",
|
||||||
"ol": "6.1.1",
|
"ol": "6.1.1",
|
||||||
"ol-cesium": "^2.11.3",
|
|
||||||
"resumablejs": "^1.1.0",
|
"resumablejs": "^1.1.0",
|
||||||
"rxjs": "^6.5.4",
|
"rxjs": "^6.5.4",
|
||||||
"tassign": "^1.0.0",
|
"tassign": "^1.0.0",
|
||||||
@ -50,7 +48,6 @@
|
|||||||
"@angular/cli": "^10.1.3",
|
"@angular/cli": "^10.1.3",
|
||||||
"@angular/compiler-cli": "~10.1.3",
|
"@angular/compiler-cli": "~10.1.3",
|
||||||
"@angular/language-service": "~10.1.3",
|
"@angular/language-service": "~10.1.3",
|
||||||
"@angular-builders/custom-webpack": "~10.0.1",
|
|
||||||
"@types/jasmine": "~2.8.8",
|
"@types/jasmine": "~2.8.8",
|
||||||
"@types/jasminewd2": "~2.0.3",
|
"@types/jasminewd2": "~2.0.3",
|
||||||
"@types/node": "^12.11.1",
|
"@types/node": "^12.11.1",
|
||||||
|
@ -14,8 +14,8 @@
|
|||||||
"@ngrx/router-store": "^10.0",
|
"@ngrx/router-store": "^10.0",
|
||||||
"@ngrx/store": "^10.0",
|
"@ngrx/store": "^10.0",
|
||||||
"tassign": "^1.0.0",
|
"tassign": "^1.0.0",
|
||||||
"@farmmaps/common": ">=0.0.1-prerelease.420 <0.0.1",
|
"@farmmaps/common": ">=0.0.1-prerelease.411 <0.0.1",
|
||||||
"ngx-openlayers": "1.0.0-next.16",
|
"ngx-openlayers": "1.0.0-next.13",
|
||||||
"ol": "6.1.1"
|
"ol": "6.1.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,7 @@ import { IPeriodState } from './models/period.state';
|
|||||||
|
|
||||||
// components
|
// components
|
||||||
import { GpsLocation} from './components/aol/gps-location/gps-location.component';
|
import { GpsLocation} from './components/aol/gps-location/gps-location.component';
|
||||||
|
//import {Switch2D3DComponent } from './components/aol/switch2d3d/switch2d3d.component';
|
||||||
import {FeatureListFeatureCropfieldComponent } from './components/feature-list-feature-cropfield/feature-list-feature-cropfield.component';
|
import {FeatureListFeatureCropfieldComponent } from './components/feature-list-feature-cropfield/feature-list-feature-cropfield.component';
|
||||||
import { FeatureListFeatureCroppingschemeComponent} from './components/feature-list-feature-croppingscheme/feature-list-feature-croppingscheme.component';
|
import { FeatureListFeatureCroppingschemeComponent} from './components/feature-list-feature-croppingscheme/feature-list-feature-croppingscheme.component';
|
||||||
import { ItemWidgetListComponent} from './components/item-widget-list/item-widget-list.component';
|
import { ItemWidgetListComponent} from './components/item-widget-list/item-widget-list.component';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Component, OnInit, Input, ViewChild, ElementRef, OnChanges, SimpleChanges ,Host} from '@angular/core';
|
import { Component, OnInit, Input, ViewChild, ElementRef, OnChanges, SimpleChanges } from '@angular/core';
|
||||||
import { MapComponent } from 'ngx-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';
|
||||||
@ -23,10 +23,9 @@ export class GpsLocation implements OnInit,OnChanges{
|
|||||||
public path: string = "";
|
public path: string = "";
|
||||||
public rotate: string = "";
|
public rotate: string = "";
|
||||||
private resolution: number = 0;
|
private resolution: number = 0;
|
||||||
initialized:boolean = false;
|
|
||||||
@ViewChild('location', { static: true }) locationElement: ElementRef;
|
@ViewChild('location', { static: true }) locationElement: ElementRef;
|
||||||
|
|
||||||
constructor(@Host() private map: MapComponent) {
|
constructor(private map: MapComponent) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,13 +54,12 @@ export class GpsLocation implements OnInit,OnChanges{
|
|||||||
this.resolution = evt.target.get('resolution');
|
this.resolution = evt.target.get('resolution');
|
||||||
this.recalcLocationTolerance();
|
this.recalcLocationTolerance();
|
||||||
});
|
});
|
||||||
this.initialized = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnChanges(changes: SimpleChanges) {
|
ngOnChanges(changes: SimpleChanges) {
|
||||||
if (changes.position && this.instance) {
|
if (changes.position && this.instance) {
|
||||||
var p = changes.position.currentValue as Position;
|
var p = changes.position.currentValue as Position;
|
||||||
if(p && this.initialized) {
|
if(p) {
|
||||||
this.instance.setPosition(fromLonLat([p.coords.longitude, p.coords.latitude]));
|
this.instance.setPosition(fromLonLat([p.coords.longitude, p.coords.latitude]));
|
||||||
this.locationTolerance = p.coords.accuracy;
|
this.locationTolerance = p.coords.accuracy;
|
||||||
this.recalcLocationTolerance();
|
this.recalcLocationTolerance();
|
||||||
|
@ -99,14 +99,17 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange
|
|||||||
var l = (data && data.layers && data.layers.length > 0) ? data.layers[0] : null;
|
var l = (data && data.layers && data.layers.length > 0) ? data.layers[0] : null;
|
||||||
if (l && l.rendering && l.rendering.renderoutputType == "Tiles") {
|
if (l && l.rendering && l.rendering.renderoutputType == "Tiles") {
|
||||||
var rt = l.rendering as IRenderoutputTiles;
|
var rt = l.rendering as IRenderoutputTiles;
|
||||||
let source = new XYZ({crossOrigin: 'use-credentials', maxZoom: rt.maxzoom, minZoom: rt.minzoom, url: `${this._apiEndPoint}/api/v1/items/${item.code}/tiles/${layerIndex}/{z}/{x}/{y}.png?v=${Date.parse(item.updated)}` });
|
let source = new XYZ({ maxZoom: rt.maxzoom, minZoom: rt.minzoom, url: `${this._apiEndPoint}/api/v1/items/${item.code}/tiles/${layerIndex}/{z}/{x}/{y}.png?v=${Date.parse(item.updated)}` });
|
||||||
layer = new Tile({ source: source });
|
layer = new Tile({ source: source });
|
||||||
}
|
}
|
||||||
if (l && l.rendering && l.rendering.renderoutputType == "Image") {
|
if (l && l.rendering && l.rendering.renderoutputType == "Image") {
|
||||||
var ri = l.rendering as IRenderoutputImage;
|
var ri = l.rendering as IRenderoutputImage;
|
||||||
// convert to EPSG:4326 asworkaround for cesium
|
let projection = new Projection({
|
||||||
var projectedExtent = proj.transformExtent( ri.extent, 'EPSG:3857','EPSG:4326');
|
code: 'image',
|
||||||
let source = new ImageStatic({ imageExtent:projectedExtent,projection:'EPSG:4326', crossOrigin: 'use-credentials', url: `${this._apiEndPoint}/api/v1/items/${item.code}/mapimage/${layerIndex}?v=${Date.parse(item.updated)}` });
|
units: 'pixels',
|
||||||
|
extent: ri.extent
|
||||||
|
});
|
||||||
|
let source = new ImageStatic({ imageExtent: ri.extent, projection: projection, url: `${this._apiEndPoint}/api/v1/items/${item.code}/mapimage/${layerIndex}?v=${Date.parse(item.updated)}` });
|
||||||
layer = new Image({ source: source });
|
layer = new Image({ source: source });
|
||||||
}
|
}
|
||||||
return layer;
|
return layer;
|
||||||
|
@ -0,0 +1,40 @@
|
|||||||
|
// import { Component, OnInit,Input } from '@angular/core';
|
||||||
|
//import { MapComponent } from 'ngx-openlayers';
|
||||||
|
//import OLCesium from 'olcs/OLCesium.js';
|
||||||
|
|
||||||
|
|
||||||
|
// @Component({
|
||||||
|
// selector: 'fm-map-switch2d3d',
|
||||||
|
// template: '<div (click)="handleClick($event)" class="rounded-circle twotreed">{{label}}</div>',
|
||||||
|
// styles: [`.twotreed {
|
||||||
|
// width:2.5em;
|
||||||
|
// height:2.5em;
|
||||||
|
// background-color: white;
|
||||||
|
// text-align:center;
|
||||||
|
// line-height:2.5em;
|
||||||
|
// font-weight:bold;
|
||||||
|
// cursor:default;}`]
|
||||||
|
|
||||||
|
// })
|
||||||
|
// export class Switch2D3DComponent {
|
||||||
|
|
||||||
|
// @Input() enable:boolean;
|
||||||
|
// public label: string = "3D";
|
||||||
|
// private ol3d: OLCesium;
|
||||||
|
|
||||||
|
|
||||||
|
// constructor(private map: MapComponent) {
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
// ngOnInit() {
|
||||||
|
// this.ol3d = new OLCesium({ map: this.map.instance }); // ol2dMap is the ol.Map instance
|
||||||
|
// }
|
||||||
|
|
||||||
|
// handleClick(event) {
|
||||||
|
// this.enable = !this.enable;
|
||||||
|
// if (this.enable)
|
||||||
|
// this.ol3d.setEnabled(this.enable);
|
||||||
|
// this.label = this.enable?"2D":"3D";
|
||||||
|
// }
|
||||||
|
// }
|
@ -37,9 +37,9 @@
|
|||||||
<aol-layer-vector>
|
<aol-layer-vector>
|
||||||
<fm-map-item-source-vector [styles]="state.styles" [features]="state.features" (onFeaturesSelected)="handleFeatureClick($event)" (onFeatureHover)="handleFeatureHover($event)" [selectedFeature]="state.selectedFeature" [selectedItem]="state.selectedItem"></fm-map-item-source-vector>
|
<fm-map-item-source-vector [styles]="state.styles" [features]="state.features" (onFeaturesSelected)="handleFeatureClick($event)" (onFeatureHover)="handleFeatureHover($event)" [selectedFeature]="state.selectedFeature" [selectedItem]="state.selectedItem"></fm-map-item-source-vector>
|
||||||
</aol-layer-vector>
|
</aol-layer-vector>
|
||||||
<!-- <fm-map-gps-location [position]="state.position" [headingTolerance]="20" [showHeading]="true" [heading]="state.compassHeading"></fm-map-gps-location> -->
|
<fm-map-gps-location [position]="state.position" [headingTolerance]="20" [showHeading]="true" [heading]="state.compassHeading"></fm-map-gps-location>
|
||||||
<div class="control-container">
|
<div class="control-container">
|
||||||
<router-outlet name="map-controls"></router-outlet>
|
<!-- <switch2d3d></switch2d3d>-->
|
||||||
<fm-map-layer-switcher></fm-map-layer-switcher>
|
<fm-map-layer-switcher></fm-map-layer-switcher>
|
||||||
<fm-map-pan-to-location [position]="state.position" [mapState]="state.mapState" [animate]="true"></fm-map-pan-to-location>
|
<fm-map-pan-to-location [position]="state.position" [mapState]="state.mapState" [animate]="true"></fm-map-pan-to-location>
|
||||||
<fm-map-rotation-reset></fm-map-rotation-reset>
|
<fm-map-rotation-reset></fm-map-rotation-reset>
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
# CommonMap3d
|
|
||||||
|
|
||||||
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 10.1.3.
|
|
||||||
|
|
||||||
## Code scaffolding
|
|
||||||
|
|
||||||
Run `ng generate component component-name --project common-map3d` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project common-map3d`.
|
|
||||||
> Note: Don't forget to add `--project common-map3d` or else it will be added to the default project in your `angular.json` file.
|
|
||||||
|
|
||||||
## Build
|
|
||||||
|
|
||||||
Run `ng build common-map3d` to build the project. The build artifacts will be stored in the `dist/` directory.
|
|
||||||
|
|
||||||
## Publishing
|
|
||||||
|
|
||||||
After building your library with `ng build common-map3d`, go to the dist folder `cd dist/common-map3d` and run `npm publish`.
|
|
||||||
|
|
||||||
## Running unit tests
|
|
||||||
|
|
||||||
Run `ng test common-map3d` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
|
||||||
|
|
||||||
## Further help
|
|
||||||
|
|
||||||
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
|
|
@ -1,32 +0,0 @@
|
|||||||
// Karma configuration file, see link for more information
|
|
||||||
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
|
||||||
|
|
||||||
module.exports = function (config) {
|
|
||||||
config.set({
|
|
||||||
basePath: '',
|
|
||||||
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
|
||||||
plugins: [
|
|
||||||
require('karma-jasmine'),
|
|
||||||
require('karma-chrome-launcher'),
|
|
||||||
require('karma-jasmine-html-reporter'),
|
|
||||||
require('karma-coverage-istanbul-reporter'),
|
|
||||||
require('@angular-devkit/build-angular/plugins/karma')
|
|
||||||
],
|
|
||||||
client: {
|
|
||||||
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
|
||||||
},
|
|
||||||
coverageIstanbulReporter: {
|
|
||||||
dir: require('path').join(__dirname, '../../coverage/common-map3d'),
|
|
||||||
reports: ['html', 'lcovonly', 'text-summary'],
|
|
||||||
fixWebpackSourcePaths: true
|
|
||||||
},
|
|
||||||
reporters: ['progress', 'kjhtml'],
|
|
||||||
port: 9876,
|
|
||||||
colors: true,
|
|
||||||
logLevel: config.LOG_INFO,
|
|
||||||
autoWatch: true,
|
|
||||||
browsers: ['Chrome'],
|
|
||||||
singleRun: false,
|
|
||||||
restartOnFileChange: true
|
|
||||||
});
|
|
||||||
};
|
|
@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
|
|
||||||
"dest": "../../dist/common-map3d",
|
|
||||||
"lib": {
|
|
||||||
"entryFile": "src/public-api.ts"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "common-map3d",
|
|
||||||
"version": "0.0.1",
|
|
||||||
"peerDependencies": {
|
|
||||||
"@angular/common": "^10.1.3",
|
|
||||||
"@angular/core": "^10.1.3",
|
|
||||||
"ngx-openlayers": "1.0.0-next.16",
|
|
||||||
"cesium": "^1.73.0",
|
|
||||||
"ol-cesium": "^2.11.3"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"tslib": "^2.0.0"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,11 +0,0 @@
|
|||||||
import { NgModule } from '@angular/core';
|
|
||||||
import { Switch2D3DComponent } from './components/olcs/switch2d3d/switch2d3d.component';
|
|
||||||
|
|
||||||
|
|
||||||
@NgModule({
|
|
||||||
declarations: [Switch2D3DComponent],
|
|
||||||
imports: [
|
|
||||||
],
|
|
||||||
exports: [Switch2D3DComponent]
|
|
||||||
})
|
|
||||||
export class CommonMap3dModule { }
|
|
@ -1,16 +0,0 @@
|
|||||||
import { TestBed } from '@angular/core/testing';
|
|
||||||
|
|
||||||
import { CommonMap3dService } from './common-map3d.service';
|
|
||||||
|
|
||||||
describe('CommonMap3dService', () => {
|
|
||||||
let service: CommonMap3dService;
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
TestBed.configureTestingModule({});
|
|
||||||
service = TestBed.inject(CommonMap3dService);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should be created', () => {
|
|
||||||
expect(service).toBeTruthy();
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,9 +0,0 @@
|
|||||||
import { Injectable } from '@angular/core';
|
|
||||||
|
|
||||||
@Injectable({
|
|
||||||
providedIn: 'root'
|
|
||||||
})
|
|
||||||
export class CommonMap3dService {
|
|
||||||
|
|
||||||
constructor() { }
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
@import "~bootstrap/scss/bootstrap.scss";
|
|
||||||
|
|
||||||
.twotreed {
|
|
||||||
display:block;
|
|
||||||
width:2.5em;
|
|
||||||
height:2.5em;
|
|
||||||
background-color: $body-bg;
|
|
||||||
background-size: contain;
|
|
||||||
margin-top:0.5em;
|
|
||||||
text-align: center;
|
|
||||||
line-height: 2.5em;
|
|
||||||
border-radius: 1.75em;
|
|
||||||
padding: 0;
|
|
||||||
color: $secondary;
|
|
||||||
}
|
|
@ -1,49 +0,0 @@
|
|||||||
import { Component, OnInit,Input,Host } from '@angular/core';
|
|
||||||
import { MapComponent } from 'ngx-openlayers';
|
|
||||||
import OLCesium from 'ol-cesium';
|
|
||||||
|
|
||||||
declare var olcs: any;
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'fm-map3d-switch2d3d',
|
|
||||||
template: '<div (click)="handleClick($event)" class="btn btn-outline-secondary twotreed">{{label}}</div>',
|
|
||||||
styleUrls: ['./switch2d3d.component.scss']
|
|
||||||
})
|
|
||||||
export class Switch2D3DComponent {
|
|
||||||
|
|
||||||
@Input() enable:boolean;
|
|
||||||
public label: string = "3D";
|
|
||||||
private ol3d: OLCesium;
|
|
||||||
private synchronizers:any[];
|
|
||||||
|
|
||||||
|
|
||||||
constructor(@Host() private map: MapComponent) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnInit() {
|
|
||||||
|
|
||||||
this.ol3d = new OLCesium({ map: this.map.instance, createSynchronizers: (map,scene) => {
|
|
||||||
this.synchronizers = [
|
|
||||||
new olcs.RasterSynchronizer(map,scene),
|
|
||||||
new olcs.VectorSynchronizer(map,scene)
|
|
||||||
];
|
|
||||||
return this.synchronizers;
|
|
||||||
}, stopOpenLayersEventsPropagation:true});
|
|
||||||
}
|
|
||||||
|
|
||||||
synchronize() {
|
|
||||||
this.synchronizers.forEach((synchronizer) => {
|
|
||||||
synchronizer.synchronize();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
handleClick(event) {
|
|
||||||
this.enable = !this.enable;
|
|
||||||
if(this.enable) {
|
|
||||||
this.synchronize();
|
|
||||||
}
|
|
||||||
this.ol3d.setEnabled(this.enable);
|
|
||||||
this.label = this.enable?"2D":"3D";
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,7 +0,0 @@
|
|||||||
/*
|
|
||||||
* Public API Surface of common-map3d
|
|
||||||
*/
|
|
||||||
|
|
||||||
export * from './fm-map3d/common-map3d.service';
|
|
||||||
export * from './fm-map3d/components/olcs/switch2d3d/switch2d3d.component';
|
|
||||||
export * from './fm-map3d/common-map3d.module';
|
|
@ -1,26 +0,0 @@
|
|||||||
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
|
||||||
|
|
||||||
import 'zone.js/dist/zone';
|
|
||||||
import 'zone.js/dist/zone-testing';
|
|
||||||
import { getTestBed } from '@angular/core/testing';
|
|
||||||
import {
|
|
||||||
BrowserDynamicTestingModule,
|
|
||||||
platformBrowserDynamicTesting
|
|
||||||
} from '@angular/platform-browser-dynamic/testing';
|
|
||||||
|
|
||||||
declare const require: {
|
|
||||||
context(path: string, deep?: boolean, filter?: RegExp): {
|
|
||||||
keys(): string[];
|
|
||||||
<T>(id: string): T;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
// First, initialize the Angular testing environment.
|
|
||||||
getTestBed().initTestEnvironment(
|
|
||||||
BrowserDynamicTestingModule,
|
|
||||||
platformBrowserDynamicTesting()
|
|
||||||
);
|
|
||||||
// Then we find all the tests.
|
|
||||||
const context = require.context('./', true, /\.spec\.ts$/);
|
|
||||||
// And load the modules.
|
|
||||||
context.keys().map(context);
|
|
@ -1,25 +0,0 @@
|
|||||||
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
||||||
{
|
|
||||||
"extends": "../../tsconfig.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"outDir": "../../out-tsc/lib",
|
|
||||||
"target": "es2015",
|
|
||||||
"declaration": true,
|
|
||||||
"declarationMap": true,
|
|
||||||
"inlineSources": true,
|
|
||||||
"types": [],
|
|
||||||
"lib": [
|
|
||||||
"dom",
|
|
||||||
"es2018"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"angularCompilerOptions": {
|
|
||||||
"skipTemplateCodegen": true,
|
|
||||||
"strictMetadataEmit": true,
|
|
||||||
"enableResourceInlining": true
|
|
||||||
},
|
|
||||||
"exclude": [
|
|
||||||
"src/test.ts",
|
|
||||||
"**/*.spec.ts"
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
||||||
{
|
|
||||||
"extends": "./tsconfig.lib.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"declarationMap": false
|
|
||||||
},
|
|
||||||
"angularCompilerOptions": {
|
|
||||||
"enableIvy": false
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../../tsconfig.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"outDir": "../../out-tsc/spec",
|
|
||||||
"types": [
|
|
||||||
"jasmine",
|
|
||||||
"node"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"files": [
|
|
||||||
"src/test.ts"
|
|
||||||
],
|
|
||||||
"include": [
|
|
||||||
"**/*.spec.ts",
|
|
||||||
"**/*.d.ts"
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../../tslint.json",
|
|
||||||
"rules": {
|
|
||||||
"directive-selector": [
|
|
||||||
true,
|
|
||||||
"attribute",
|
|
||||||
"lib",
|
|
||||||
"camelCase"
|
|
||||||
],
|
|
||||||
"component-selector": [
|
|
||||||
true,
|
|
||||||
"element",
|
|
||||||
"lib",
|
|
||||||
"kebab-case"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,19 +1,12 @@
|
|||||||
import * as Cesium from 'cesium';
|
|
||||||
|
|
||||||
import { enableProdMode } from '@angular/core';
|
import { enableProdMode } from '@angular/core';
|
||||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||||
|
|
||||||
import { AppModule } from './app/app.module';
|
import { AppModule } from './app/app.module';
|
||||||
import { environment } from './environments/environment';
|
import { environment } from './environments/environment';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (environment.production) {
|
if (environment.production) {
|
||||||
enableProdMode();
|
enableProdMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
window['CESIUM_BASE_URL'] = '/assets/cesium/';
|
|
||||||
window['Cesium'] = Cesium;
|
|
||||||
|
|
||||||
platformBrowserDynamic().bootstrapModule(AppModule)
|
platformBrowserDynamic().bootstrapModule(AppModule)
|
||||||
.catch(err => console.error(err));
|
.catch(err => console.error(err));
|
||||||
|
@ -26,10 +26,6 @@
|
|||||||
],
|
],
|
||||||
"common-map/*": [
|
"common-map/*": [
|
||||||
"dist/common-map/*"
|
"dist/common-map/*"
|
||||||
],
|
|
||||||
"common-map3d": [
|
|
||||||
"dist/common-map3d/common-map3d",
|
|
||||||
"dist/common-map3d"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user