From e007bcf9facc12306f1737a4588fe7a9ac525057 Mon Sep 17 00:00:00 2001 From: Arno Kaimbacher Date: Tue, 20 Apr 2021 16:17:45 +0200 Subject: [PATCH] - bug: correct borehole profiles - npm updates - beginning with typescript: BoreholePopup.ts --- package-lock.json | 170 +++++++++------------ src/js/controls/BoreholeControl.js | 8 +- src/js/controls/BoreholePopup.css | 54 ++++--- src/js/controls/BoreholePopup.ts | 87 +++++------ src/js/controls/{Control.js => Control.ts} | 26 ++-- src/js/core/BarChart.js | 25 ++- src/js/core/BaseEditor.js | 66 ++++++-- src/js/core/utilities.js | 22 +++ src/js/tools/BoreholeTool.js | 1 - 9 files changed, 233 insertions(+), 226 deletions(-) rename src/js/controls/{Control.js => Control.ts} (76%) diff --git a/package-lock.json b/package-lock.json index fa1c776..50457c9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1422,9 +1422,9 @@ } }, "node_modules/@types/estree": { - "version": "0.0.46", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.46.tgz", - "integrity": "sha512-laIjwTQaD+5DukBZaygQ79K1Z0jb1bPEMRrkXSLjtCcZm+abyp5YbrqpSLzD42FwWW6gK/aS4NYpJ804nG2brg==", + "version": "0.0.47", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.47.tgz", + "integrity": "sha512-c5ciR06jK8u9BstrmJyO97m+klJrrhCf9u3rLu3DEAJBirxRqSCvDQoYKmxuYwQI5SZChAWu+tq9oVlGRuzPAg==", "dev": true }, "node_modules/@types/glob": { @@ -1452,9 +1452,9 @@ "peer": true }, "node_modules/@types/node": { - "version": "14.14.39", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.39.tgz", - "integrity": "sha512-Qipn7rfTxGEDqZiezH+wxqWYR8vcXq5LRpZrETD19Gs4o8LbklbmqotSUsMU+s5G3PJwMRDfNEYoxrcBwIxOuw==", + "version": "14.14.41", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.41.tgz", + "integrity": "sha512-dueRKfaJL4RTtSa7bWeTK1M+VH+Gns73oCgzvYfHZywRCoPSd8EkXBL0mZ9unPTveBn+D9phZBaxuzpwjWkW0g==", "dev": true }, "node_modules/@types/normalize-package-data": { @@ -2063,9 +2063,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001208", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001208.tgz", - "integrity": "sha512-OE5UE4+nBOro8Dyvv0lfx+SRtfVIOM9uhKqFmJeUbGriqhhStgp1A0OyBpgy3OUF8AhYCT+PVwPC1gMl2ZcQMA==", + "version": "1.0.30001214", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001214.tgz", + "integrity": "sha512-O2/SCpuaU3eASWVaesQirZv1MSjUNOvmugaD8zNSJqw6Vv5SGwoOpA9LJs3pNPfM745nxqPvfZY3MQKY4AKHYg==", "dev": true }, "node_modules/caseless": { @@ -2368,12 +2368,12 @@ } }, "node_modules/core-js-compat": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.10.1.tgz", - "integrity": "sha512-ZHQTdTPkqvw2CeHiZC970NNJcnwzT6YIueDMASKt+p3WbZsLXOcoD392SkcWhkC0wBBHhlfhqGKKsNCQUozYtg==", + "version": "3.10.2", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.10.2.tgz", + "integrity": "sha512-IGHnpuaM1N++gLSPI1F1wu3WXICPxSyj/Q++clcwsIOnUVp5uKUIPl/+6h0TQ112KU3fMiSxqJuM+OrCyKj5+A==", "dev": true, "dependencies": { - "browserslist": "^4.16.3", + "browserslist": "^4.16.4", "semver": "7.0.0" }, "funding": { @@ -2423,23 +2423,22 @@ } }, "node_modules/css-loader": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-5.2.1.tgz", - "integrity": "sha512-YCyRzlt/jgG1xanXZDG/DHqAueOtXFHeusP9TS478oP1J++JSKOyEgGW1GHVoCj/rkS+GWOlBwqQJBr9yajQ9w==", + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-5.2.4.tgz", + "integrity": "sha512-OFYGyINCKkdQsTrSYxzGSFnGS4gNjcXkKkQgWxK138jgnPt+lepxdjSZNc8sHAl5vP3DhsJUxufWIjOwI8PMMw==", "dev": true, "dependencies": { "camelcase": "^6.2.0", - "cssesc": "^3.0.0", "icss-utils": "^5.1.0", "loader-utils": "^2.0.0", - "postcss": "^8.2.8", + "postcss": "^8.2.10", "postcss-modules-extract-imports": "^3.0.0", "postcss-modules-local-by-default": "^4.0.0", "postcss-modules-scope": "^3.0.0", "postcss-modules-values": "^4.0.0", "postcss-value-parser": "^4.1.0", "schema-utils": "^3.0.0", - "semver": "^7.3.4" + "semver": "^7.3.5" }, "engines": { "node": ">= 10.13.0" @@ -2555,9 +2554,9 @@ } }, "node_modules/date-fns": { - "version": "2.21.0", - "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.21.0.tgz", - "integrity": "sha512-lbAFpaKz7QuVxm6m1rmioh4BB2gmLx1r1JMYXU2A/ufT5ly4zEG7HYH4fvS/QfbdyC5rkYyiS30mYz4Q7XCO+w==", + "version": "2.21.1", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.21.1.tgz", + "integrity": "sha512-m1WR0xGiC6j6jNFAyW4Nvh4WxAi4JF4w9jRJwSI8nBmNcyZXPcP9VUQG+6gHQXAmqaGEKDKhOqAtENDC941UkA==", "dev": true, "engines": { "node": ">=0.11" @@ -2683,9 +2682,9 @@ } }, "node_modules/enhanced-resolve": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.7.0.tgz", - "integrity": "sha512-6njwt/NsZFUKhM6j9U8hzVyD4E4r0x7NQzhTCbcWOJ0IQjNSAoalWmb0AE51Wn+fwan5qVESWi7t2ToBxs9vrw==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.8.0.tgz", + "integrity": "sha512-Sl3KRpJA8OpprrtaIswVki3cWPiPKxXuFxJXBp+zNb6s6VwNWwFRUdtmzd2ReUut8n+sCPx7QCtQ7w5wfJhSgQ==", "dev": true, "dependencies": { "graceful-fs": "^4.2.4", @@ -3468,12 +3467,6 @@ "node": ">=0.10.0" } }, - "node_modules/indexes-of": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz", - "integrity": "sha1-8w9xbI4r00bHtn0985FVZqfAVgc=", - "dev": true - }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -4015,9 +4008,9 @@ } }, "node_modules/mini-css-extract-plugin": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-1.4.1.tgz", - "integrity": "sha512-COAGbpAsU0ioFzj+/RRfO5Qv177L1Z/XAx2EmCF33b8GDDqKygMffBTws2lit8iaPdrbKEY5P+zsseBUCREZWQ==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-1.5.0.tgz", + "integrity": "sha512-SIbuLMv6jsk1FnLIU5OUG/+VMGUprEjM1+o2trOAx8i5KOKMrhyezb1dJ4Ugsykb8Jgq8/w5NEopy6escV9G7g==", "dev": true, "dependencies": { "loader-utils": "^2.0.0", @@ -4660,14 +4653,12 @@ } }, "node_modules/postcss-selector-parser": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.4.tgz", - "integrity": "sha512-gjMeXBempyInaBqpp8gODmwZ52WaYsVOsfr4L4lDQ7n3ncD6mEyySiDtgzCT+NYC0mmeOLvtsF8iaEf0YT6dBw==", + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.5.tgz", + "integrity": "sha512-aFYPoYmXbZ1V6HZaSvat08M97A8HqO6Pjz+PiNpw/DhuRrC72XWAdp3hL6wusDCN31sSmcZyMGa2hZEuX+Xfhg==", "dev": true, "dependencies": { "cssesc": "^3.0.0", - "indexes-of": "^1.0.1", - "uniq": "^1.0.1", "util-deprecate": "^1.0.2" }, "engines": { @@ -6122,12 +6113,6 @@ "node": ">=4" } }, - "node_modules/uniq": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", - "integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=", - "dev": true - }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -6262,20 +6247,20 @@ } }, "node_modules/webpack": { - "version": "5.33.2", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.33.2.tgz", - "integrity": "sha512-X4b7F1sYBmJx8mlh2B7mV5szEkE0jYNJ2y3akgAP0ERi0vLCG1VvdsIxt8lFd4st6SUy0lf7W0CCQS566MBpJg==", + "version": "5.34.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.34.0.tgz", + "integrity": "sha512-+WiFMgaZqhu7zKN64LQ7z0Ml4WWI+9RwG6zmS0wJDQXiCeg3hpN8fYFNJ+6WlosDT55yVxTfK7XHUAOVR4rLyA==", "dev": true, "dependencies": { "@types/eslint-scope": "^3.7.0", - "@types/estree": "^0.0.46", + "@types/estree": "^0.0.47", "@webassemblyjs/ast": "1.11.0", "@webassemblyjs/wasm-edit": "1.11.0", "@webassemblyjs/wasm-parser": "1.11.0", "acorn": "^8.0.4", "browserslist": "^4.14.5", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.7.0", + "enhanced-resolve": "^5.8.0", "es-module-lexer": "^0.4.0", "eslint-scope": "^5.1.1", "events": "^3.2.0", @@ -7812,9 +7797,9 @@ } }, "@types/estree": { - "version": "0.0.46", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.46.tgz", - "integrity": "sha512-laIjwTQaD+5DukBZaygQ79K1Z0jb1bPEMRrkXSLjtCcZm+abyp5YbrqpSLzD42FwWW6gK/aS4NYpJ804nG2brg==", + "version": "0.0.47", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.47.tgz", + "integrity": "sha512-c5ciR06jK8u9BstrmJyO97m+klJrrhCf9u3rLu3DEAJBirxRqSCvDQoYKmxuYwQI5SZChAWu+tq9oVlGRuzPAg==", "dev": true }, "@types/glob": { @@ -7842,9 +7827,9 @@ "peer": true }, "@types/node": { - "version": "14.14.39", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.39.tgz", - "integrity": "sha512-Qipn7rfTxGEDqZiezH+wxqWYR8vcXq5LRpZrETD19Gs4o8LbklbmqotSUsMU+s5G3PJwMRDfNEYoxrcBwIxOuw==", + "version": "14.14.41", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.41.tgz", + "integrity": "sha512-dueRKfaJL4RTtSa7bWeTK1M+VH+Gns73oCgzvYfHZywRCoPSd8EkXBL0mZ9unPTveBn+D9phZBaxuzpwjWkW0g==", "dev": true }, "@types/normalize-package-data": { @@ -8346,9 +8331,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001208", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001208.tgz", - "integrity": "sha512-OE5UE4+nBOro8Dyvv0lfx+SRtfVIOM9uhKqFmJeUbGriqhhStgp1A0OyBpgy3OUF8AhYCT+PVwPC1gMl2ZcQMA==", + "version": "1.0.30001214", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001214.tgz", + "integrity": "sha512-O2/SCpuaU3eASWVaesQirZv1MSjUNOvmugaD8zNSJqw6Vv5SGwoOpA9LJs3pNPfM745nxqPvfZY3MQKY4AKHYg==", "dev": true }, "caseless": { @@ -8594,12 +8579,12 @@ } }, "core-js-compat": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.10.1.tgz", - "integrity": "sha512-ZHQTdTPkqvw2CeHiZC970NNJcnwzT6YIueDMASKt+p3WbZsLXOcoD392SkcWhkC0wBBHhlfhqGKKsNCQUozYtg==", + "version": "3.10.2", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.10.2.tgz", + "integrity": "sha512-IGHnpuaM1N++gLSPI1F1wu3WXICPxSyj/Q++clcwsIOnUVp5uKUIPl/+6h0TQ112KU3fMiSxqJuM+OrCyKj5+A==", "dev": true, "requires": { - "browserslist": "^4.16.3", + "browserslist": "^4.16.4", "semver": "7.0.0" }, "dependencies": { @@ -8649,23 +8634,22 @@ } }, "css-loader": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-5.2.1.tgz", - "integrity": "sha512-YCyRzlt/jgG1xanXZDG/DHqAueOtXFHeusP9TS478oP1J++JSKOyEgGW1GHVoCj/rkS+GWOlBwqQJBr9yajQ9w==", + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-5.2.4.tgz", + "integrity": "sha512-OFYGyINCKkdQsTrSYxzGSFnGS4gNjcXkKkQgWxK138jgnPt+lepxdjSZNc8sHAl5vP3DhsJUxufWIjOwI8PMMw==", "dev": true, "requires": { "camelcase": "^6.2.0", - "cssesc": "^3.0.0", "icss-utils": "^5.1.0", "loader-utils": "^2.0.0", - "postcss": "^8.2.8", + "postcss": "^8.2.10", "postcss-modules-extract-imports": "^3.0.0", "postcss-modules-local-by-default": "^4.0.0", "postcss-modules-scope": "^3.0.0", "postcss-modules-values": "^4.0.0", "postcss-value-parser": "^4.1.0", "schema-utils": "^3.0.0", - "semver": "^7.3.4" + "semver": "^7.3.5" }, "dependencies": { "loader-utils": { @@ -8736,9 +8720,9 @@ } }, "date-fns": { - "version": "2.21.0", - "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.21.0.tgz", - "integrity": "sha512-lbAFpaKz7QuVxm6m1rmioh4BB2gmLx1r1JMYXU2A/ufT5ly4zEG7HYH4fvS/QfbdyC5rkYyiS30mYz4Q7XCO+w==", + "version": "2.21.1", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.21.1.tgz", + "integrity": "sha512-m1WR0xGiC6j6jNFAyW4Nvh4WxAi4JF4w9jRJwSI8nBmNcyZXPcP9VUQG+6gHQXAmqaGEKDKhOqAtENDC941UkA==", "dev": true }, "debug": { @@ -8828,9 +8812,9 @@ "dev": true }, "enhanced-resolve": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.7.0.tgz", - "integrity": "sha512-6njwt/NsZFUKhM6j9U8hzVyD4E4r0x7NQzhTCbcWOJ0IQjNSAoalWmb0AE51Wn+fwan5qVESWi7t2ToBxs9vrw==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.8.0.tgz", + "integrity": "sha512-Sl3KRpJA8OpprrtaIswVki3cWPiPKxXuFxJXBp+zNb6s6VwNWwFRUdtmzd2ReUut8n+sCPx7QCtQ7w5wfJhSgQ==", "dev": true, "requires": { "graceful-fs": "^4.2.4", @@ -9433,12 +9417,6 @@ "repeating": "^2.0.0" } }, - "indexes-of": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz", - "integrity": "sha1-8w9xbI4r00bHtn0985FVZqfAVgc=", - "dev": true - }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -9869,9 +9847,9 @@ "dev": true }, "mini-css-extract-plugin": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-1.4.1.tgz", - "integrity": "sha512-COAGbpAsU0ioFzj+/RRfO5Qv177L1Z/XAx2EmCF33b8GDDqKygMffBTws2lit8iaPdrbKEY5P+zsseBUCREZWQ==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-1.5.0.tgz", + "integrity": "sha512-SIbuLMv6jsk1FnLIU5OUG/+VMGUprEjM1+o2trOAx8i5KOKMrhyezb1dJ4Ugsykb8Jgq8/w5NEopy6escV9G7g==", "dev": true, "requires": { "loader-utils": "^2.0.0", @@ -10344,14 +10322,12 @@ } }, "postcss-selector-parser": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.4.tgz", - "integrity": "sha512-gjMeXBempyInaBqpp8gODmwZ52WaYsVOsfr4L4lDQ7n3ncD6mEyySiDtgzCT+NYC0mmeOLvtsF8iaEf0YT6dBw==", + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.5.tgz", + "integrity": "sha512-aFYPoYmXbZ1V6HZaSvat08M97A8HqO6Pjz+PiNpw/DhuRrC72XWAdp3hL6wusDCN31sSmcZyMGa2hZEuX+Xfhg==", "dev": true, "requires": { "cssesc": "^3.0.0", - "indexes-of": "^1.0.1", - "uniq": "^1.0.1", "util-deprecate": "^1.0.2" } }, @@ -11477,12 +11453,6 @@ "integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==", "dev": true }, - "uniq": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", - "integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=", - "dev": true - }, "uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -11583,20 +11553,20 @@ } }, "webpack": { - "version": "5.33.2", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.33.2.tgz", - "integrity": "sha512-X4b7F1sYBmJx8mlh2B7mV5szEkE0jYNJ2y3akgAP0ERi0vLCG1VvdsIxt8lFd4st6SUy0lf7W0CCQS566MBpJg==", + "version": "5.34.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.34.0.tgz", + "integrity": "sha512-+WiFMgaZqhu7zKN64LQ7z0Ml4WWI+9RwG6zmS0wJDQXiCeg3hpN8fYFNJ+6WlosDT55yVxTfK7XHUAOVR4rLyA==", "dev": true, "requires": { "@types/eslint-scope": "^3.7.0", - "@types/estree": "^0.0.46", + "@types/estree": "^0.0.47", "@webassemblyjs/ast": "1.11.0", "@webassemblyjs/wasm-edit": "1.11.0", "@webassemblyjs/wasm-parser": "1.11.0", "acorn": "^8.0.4", "browserslist": "^4.14.5", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.7.0", + "enhanced-resolve": "^5.8.0", "es-module-lexer": "^0.4.0", "eslint-scope": "^5.1.1", "events": "^3.2.0", diff --git a/src/js/controls/BoreholeControl.js b/src/js/controls/BoreholeControl.js index 34a5c2c..9dcfc27 100644 --- a/src/js/controls/BoreholeControl.js +++ b/src/js/controls/BoreholeControl.js @@ -1,6 +1,5 @@ import { Control } from "./Control"; import * as dom from '../core/domUtil'; -import * as util from '../core/utilities'; import * as domEvent from '../core/domEvent'; import { BoreholeTool } from '../tools/BoreholeTool'; @@ -11,7 +10,8 @@ export class BoreholeControl extends Control { options = { position: 'topright', }; - onAdd (map) { + + onAdd(map) { this.map = map; // var b = this._nls = util.mixin({}, N.widgets.boreholetool); @@ -24,8 +24,8 @@ export class BoreholeControl extends Control { //this.addUnit(inputDiv, 'mi', 'mi', 'miles'); ////this.addUnit(inputDiv, 'nm', 'NM', 'nautical miles'); let toggle = dom.createDom('a', { "class": "gba-maptool-toggle", href: "#", title: "b.title" }, this._container); - - domEvent.disableClickPropagation(this._container); + + domEvent.disableClickPropagation(this._container); domEvent // .on(toggle, 'click', domEvent.stop) // .on(toggle, 'click', domEvent.preventDefault) diff --git a/src/js/controls/BoreholePopup.css b/src/js/controls/BoreholePopup.css index 55bf13c..0ca99c5 100644 --- a/src/js/controls/BoreholePopup.css +++ b/src/js/controls/BoreholePopup.css @@ -1,10 +1,11 @@ .gba-borehole-popup { cursor: pointer; + color: green; } /* .gba-borehole-popup .maximize.hidden { display: none; -} +}*/ .gba-borehole-popup .maximize { color: rgb(220, 220, 220); @@ -18,28 +19,17 @@ text-align: center; float: left; cursor: pointer; -} */ +} /*side-menu zumachen*/ -.gba-borehole-menu .close { - color: rgb(220, 220, 220); - background: gray; - border: 1px solid #000000; - border-radius: 4px; - font-size: 16px; - font-weight: bold; +.gba-borehole-menu .gba-close-link { width: 20px; height: 20px; text-align: center; float: right; cursor: pointer; } -/* .gba-close-icon { - background-repeat: no-repeat; - background-position: -52px -9px; - display: inline; - padding: 0 10px; -} */ + .toolbox { list-style-image: none; list-style-position: inside; @@ -55,19 +45,19 @@ .gba-borehole-menu .body { clear: both; height: calc(100% - 46px); + border: 1px solid #777; + /* padding: 5px; */ +} +.gba-borehole-menu .body .header { + text-align: center; + border-bottom: 1px solid #000000; } -.gba-borehole-menu { - /* position: absolute; - top: 0; - left: 0; - padding: 0 20px 2px 20px; - border-right: 1px solid #ddd; - border-left: 1px solid #ddd; */ +.gba-borehole-menu { overflow-y: auto; z-index: 1000; background-color: #fff; - opacity: 0.93; + opacity: 0.93; } .gba-borehole-menu::-webkit-scrollbar { @@ -81,6 +71,14 @@ background: #777; } +/* .chartCanvas { + border-top: 1px solid #000000; +} */ + +.chartContainer { + border-top: 1px solid #000000; +} + .chartTable { margin-left: 20px; border-width: 0; @@ -97,8 +95,14 @@ .chartTable td { vertical-align: central; text-align: center; - padding: 0; - overflow: visible; + padding: 0; +} + +.layerNameColumn { + white-space: nowrap; + overflow: hidden; + text-overflow:ellipsis; + max-width: 85%; } .chartTable td img { diff --git a/src/js/controls/BoreholePopup.ts b/src/js/controls/BoreholePopup.ts index 25fbefc..4ec5779 100644 --- a/src/js/controls/BoreholePopup.ts +++ b/src/js/controls/BoreholePopup.ts @@ -7,7 +7,7 @@ import { BarChart } from '../core/BarChart'; import './BoreholePopup.css'; interface BoreholePopupOptions { - position?: string + position: string width?: string height?: string parentDiv?: string @@ -19,31 +19,25 @@ export class BoreholePopup extends Control { options: BoreholePopupOptions = { position: 'topleft', width: '300px', - height: '100%', + height: '100%', parentDiv: null }; - // private class fields: + //#region private class fields: private _innerHTML; private _clearButton; private _body; private _contentPane; - private _contenLable; - _container; - private _mainMap; - private _scene; - private _hasContent; + private _contentLabel; private _menu; private _isShowing; - barChart; + private _barChart; + //#endregion constructor(options) { super(); this._innerHTML = "Es wurde noch keine Bohrloch ausgewählt!"; util.setOptions(this, options); - //this._startPosition = -(parseInt(this.options.width, 10)); - //this._isLeftPosition = true; - this._hasContent = false; } // happens after added to map @@ -53,7 +47,6 @@ export class BoreholePopup extends Control { //logger.warning('HomeButton::map required', true); return; } - this._mainMap = map; let container; // var b = this._nls = util.mixin({}, N.widgets.boreholepopup); // let container = this._container = dom.createDom("div", { "class": "gba-borehole-popup" }); @@ -66,30 +59,38 @@ export class BoreholePopup extends Control { container = this._container = dom.createDom("div", { "class": "gba-borehole-popup" }, dom.byId("webgl")); } - //button: - // this._maxButton = dom.createDom('div', { - // "class": "maximize", innerHTML: ">", title: "b.NLS_maximize" - // }, this._container); + + + let className = "gba-borehole-menu"; this._menu = dom.createDom('div', { "class": className }, container); //dom.byId("webgl")); - this._menu.style.width = this.options.width; + // this._menu.style.width = this.options.width; // this._menu.style.height = this.options.height; this._menu.style.left = 0;// '-' + this.options.width; this._menu.style.top = 0; + + this._body = dom.createDom('div', { "class": "body" }, this._menu); - this._contenLable = dom.createDom('lable', { innerHTML: "Virtual borehole profile
(Heights in m)" }, + //button: + this._clearButton = dom.createDom('div', { + "class": "gba-close-link", innerHTML: "", title: "b.NLS_maximize" + }, this._body); + // dom.createDom('span', { title: "b.NLS_close", innerHTML: "Close" }, this._clearButton); + + this._contentLabel = dom.createDom('div', { class: "header", innerHTML: "" }, this._body); + + /* place holder for borehole profile after Identify */ this._contentPane = dom.createDom('div', { "class": "gba-menu-contents" }, this._body); this._contentPane.innerHTML = this._innerHTML; this._contentPane.style.clear = 'both'; // close button - let toolboxList = dom.createDom('ul', { "class": "toolbox" }, this._menu); - this._clearButton = dom.createDom('button', { "class": "gba-close-link button is-dark" }, toolboxList); - // dom.createDom('i', { "class": "gba-close-icon" }, this._clearButton); - dom.createDom('span', { title: "b.NLS_close", innerHTML: "Close" }, this._clearButton); + // let toolboxList = dom.createDom('ul', { "class": "toolbox" }, this._menu); + // this._clearButton = dom.createDom('button', { "class": "gba-close-link button is-dark" }, toolboxList); + // dom.createDom('span', { title: "b.NLS_close", innerHTML: "Close" }, this._clearButton); // events: // don't let double clicks and mousedown get to the map @@ -123,7 +124,7 @@ export class BoreholePopup extends Control { //} } - _setContent(innerHTML) { + setContent(innerHTML) { if (innerHTML instanceof HTMLElement) { this._contentPane.innerHTML = ""; this._contentPane.appendChild(innerHTML); @@ -132,39 +133,33 @@ export class BoreholePopup extends Control { this._contentPane.innerHTML = innerHTML; } this._contentPane.style.display = "block"; - //this._contentPane.innerHTML = innerHTML; - //this._contentPane.style.display = "block"; } setChartContent(data) { this._contentPane.innerHTML = ""; let valTextColor = "ffffff"; - this.barChart = new BarChart("d17100", + this._barChart = new BarChart("d17100", 320, valTextColor, 'full', 300); - this.barChart.draw(data); - this._contentPane.appendChild(this.barChart._container); + this._barChart.draw(data); + this._contentPane.appendChild(this._barChart._container); - let table = this.barChart.getStatTable(data); + let table = this._barChart.getStatTable(data); this._contentPane.appendChild(table); - this._hasContent = true; } - _close(e) { - + private _close(e) { this._clearContent(); this._toggleVisibility(false); this.emit("closed"); } - _clearContent() { - // $(this._contentPane).html(''); + private _clearContent() { this._contentPane.innerHTML = ''; - this._hasContent = false; } - _toggleVisibility(visible) { + private _toggleVisibility(visible) { this._setVisibility(visible); this._isShowing = visible; @@ -184,20 +179,8 @@ export class BoreholePopup extends Control { } } - _setVisibility(addOrRemove) { - // $(this._menu).css("visibility", addOrRemove ? "visible" : "hidden"); + private _setVisibility(addOrRemove) { this._menu.style.visibility = addOrRemove ? "visible" : "hidden"; - - // var maxButtonVisible = false; - // //if add, max Button not visible - // if (addOrRemove == true) { - // maxButtonVisible = !addOrRemove; - // } - // //if remove , then max Button only visible if popup has content - // else if (addOrRemove == false) { - // maxButtonVisible = this._hasContent; - // } - // // this._maxButton.style.visibility = maxButtonVisible ? "visible" : "hidden"; } onRemove() { @@ -209,11 +192,9 @@ export class BoreholePopup extends Control { // f.remove(); //} domEvent.off(this._clearButton, 'click', this._close); - // domEvent.off(this._maxButton, 'click', this.show, this); - //this.map.off('mouse-pan', this.hide, this); //C.destroy(this.domNode); //this.getContainer().parentNode.removeChild(this.getContainer()); - this._innerHTML = this._hasContent = this._menu = this._body = this._contenLable = this._contentPane = this._clearButton = null; + this._innerHTML = this._menu = this._body = this._contentLabel = this._contentPane = this._clearButton = null; } } \ No newline at end of file diff --git a/src/js/controls/Control.js b/src/js/controls/Control.ts similarity index 76% rename from src/js/controls/Control.js rename to src/js/controls/Control.ts index 24517f9..8ede139 100644 --- a/src/js/controls/Control.js +++ b/src/js/controls/Control.ts @@ -1,26 +1,21 @@ -// import { Class } from '../core/Class'; import * as util from '../core/utilities'; -// import * as dom from '../core/domUtil'; import { EventEmitter } from '../core/EventEmitter'; - -// export var Control = Class.extend({ -class Control extends EventEmitter { +abstract class Control extends EventEmitter { // @section // @aka Control options - options = { - // position: 'topright', + abstract options = { + position: 'topright', }; - _map; - _container; + protected _map; + protected _container; - constructor(defaults) { + constructor(defaults?) { super(); if (!(this instanceof Control)) { throw new TypeError("Control constructor cannot be called as a function."); - } - // this.options = defaults; + } // properties util.setOptions(this, defaults); } @@ -32,10 +27,10 @@ class Control extends EventEmitter { getContainer() { return this._container; } - - // abstract onRemove(map) : void; - // abstract onAdd(map) : HTMLElement; + abstract onRemove(map): void; + + abstract onAdd(map) : HTMLElement; addTo(map) { this._map = map; @@ -57,7 +52,6 @@ class Control extends EventEmitter { return this; } - removeFrom(map) { var pos = this.getPosition(), diff --git a/src/js/core/BarChart.js b/src/js/core/BarChart.js index f25ea2e..501679d 100644 --- a/src/js/core/BarChart.js +++ b/src/js/core/BarChart.js @@ -127,7 +127,7 @@ export class BarChart { let minValue = Math.min.apply(Math, arr.map(o => o.min)); this.minValue = Math.round(minValue); // let smallestValue = Math.min.apply(Math, arr.map(o => o.dist)); - let totalHeight = this.totalHeight = this.maxValue - this.minValue; //6000; + let totalHeight = this.totalHeight = this.maxValue - this.minValue; //6000; //// Draw grey bar background //ctx.fillStyle = "lightgray"; @@ -184,7 +184,7 @@ export class BarChart { // Use try / catch to stop IE 8 from going to error town try { if (arr[i].name !== "Basement") { - ctx.fillText("thickness " + arr[i].name + ": " + Math.round(arr[i].dist),//.toFixed(2), + ctx.fillText(arr[i].name + ": " + Math.round(arr[i].dist) + " m", //.toFixed(2), //i * this.width / numOfBars + (this.width / numOfBars) / 2, x + 30, y + (barHeight / 2) + 4.5); @@ -207,7 +207,7 @@ export class BarChart { ctx.lineTo(20, this.startPointY - maxBarHeight); let startPoint = this.startPointY; - let stepSize = this.totalHeight/arr.length; + let stepSize = this.totalHeight / 10; // arr.length; let item = this.minValue; do { let dist = (maxBarHeight / this.totalHeight) * stepSize; @@ -218,7 +218,7 @@ export class BarChart { startPoint = startPoint - dist; item += stepSize; // console.log(item); - } while (item < this.maxValue + 1); + } while (item < this.maxValue + 1); //ctx.lineTo(70, 100); ctx.stroke(); @@ -226,7 +226,8 @@ export class BarChart { } getStatTable(arr) { - let statTable = dom.createDom("table", { "class": "chartTable" }); + let chartContainer = dom.createDom("div", { class: "chartContainer"}); + let statTable = dom.createDom("table", { "class": "chartTable" }, chartContainer); let _headerRow = dom.createDom("tr", { style: "width:100px;" }, statTable); let _profileHeaderColumn = dom.createDom("th", {}, _headerRow); let _lableHeaderColumn = dom.createDom("th", {}, _headerRow); @@ -262,9 +263,11 @@ export class BarChart { }, _profileColumn); let _lableColumn = dom.createDom("td", {}, _tr); - let lable = dom.createDom("div", { - innerHTML: arr[i].name, - style: "width:75px;" + let lable = arr[i].name.replace("_"," "); + dom.createDom("div", { + innerHTML: lable, + // style: "width:75px;", + class: "layerNameColumn" }, _lableColumn); let _minColumn = dom.createDom("td", {}, _tr); @@ -290,7 +293,7 @@ export class BarChart { }, _maxColumn); } - return statTable; + return chartContainer; } _zfill(num, len) { @@ -322,10 +325,6 @@ export class BarChart { if (this.hasLabel) { this.labelobj.visible = false; } - //// Hides HTML Label if set - uses jquery for DOM manipulation - //if ( this.hasHTMLLabel ) { - // this.hasHTMLLabel.hide(); - //} } } \ No newline at end of file diff --git a/src/js/core/BaseEditor.js b/src/js/core/BaseEditor.js index 61c76b7..2f158a3 100644 --- a/src/js/core/BaseEditor.js +++ b/src/js/core/BaseEditor.js @@ -101,14 +101,14 @@ export class BaseEditor { if (e._cancelled) return; //if (!this.isConnected()) { // this.connect(e); - //} + //} let eventX = (e.clientX !== undefined) ? e.clientX : (e.touches && e.touches[0].clientX); let eventY = (e.clientY !== undefined) ? e.clientY : (e.touches && e.touches[0].clientY); let dxfIdentifyParams = {}; - dxfIdentifyParams.clientX = eventX; - dxfIdentifyParams.clientY = eventY; - dxfIdentifyParams.width = this.map.container.clientWidth; - dxfIdentifyParams.height = this.map.container.clientHeight; + dxfIdentifyParams.clientX = eventX; //351 + dxfIdentifyParams.clientY = eventY; //554; + dxfIdentifyParams.width = this.map.container.clientWidth; //712; + dxfIdentifyParams.height = this.map.container.clientHeight; //715; let deferred = this.mapTool.drillTask.execute(dxfIdentifyParams); deferred.then(this.handleQueryResults.bind(this)); @@ -119,6 +119,39 @@ export class BaseEditor { let results = arguments; let features = results[0].features; let aufschlag = results[0].aufschlag; + // features.sort(function (point1, point2) { + // // Sort by votes + // // If the first item has a hwigher number, move it up + // // If the first item has a lower number, move it down + // if (point1.distance > point2.distance) return -1; + // if (point1.distance < point2.distance) return 1; + + // }); + // features.sort(function (point1, point2) { + // // Sort by votes + // // If the first item has a higher number, move it up + // // If the first item has a lower number, move it down + // if (point1.layerId > point2.layerId) return 1; + // if (point1.layerId < point2.layerId) return -1; + + // }); + // let newFeatures = []; + let featuresCopy = Array.from(features); + for (let i = 0; i < features.length; i ++) { + let p1 = features[i]; + let p2; + if (features[i+2] != null){ + if (util.round(features[i+1].distance, 4) == util.round(features[i+2].distance, 4)){ + if (features[i+2].layerId == p1.layerId) { + p2 = features[i+2]; + util.swap(features, i + 1, i +2); + + } + } + } + // newFeatures.push(p1, p2); + } + // set the borhole marker if (!this.isConnected()) { this.connect(aufschlag); @@ -129,7 +162,7 @@ export class BaseEditor { // calculate heights vor bar chart let data = []; - for (let j = features.length - 1; j >= 0; j--) { + for (let j = features.length - 2; j >= 0; j--) { let feature = features[j]; let point = feature.point; // // clicked coordinates: skalierung wieder wegrechnen: @@ -140,6 +173,10 @@ export class BaseEditor { let layer = this.map._layers[layerId]; let nextPoint; if (j !== features.length - 1) { + let previousFeature = features[j + 1]; + // if (feature.distance == previousFeature.distance) { + // continue; + // } let previousPoint = { x: features[j + 1].point.x, y: features[j + 1].point.y, z: features[j + 1].point.z }; // let previousPt = this.map.dataservice.toMapCoordinates(previousPoint.x, previousPoint.y, previousPoint.z); @@ -149,14 +186,14 @@ export class BaseEditor { //var dist = parseInt((300 / 6000) * realHeight); if (Math.round(realHeight) > 0) { - data.push({ - dist: realHeight,//dist, - max: point.z, - min: previousPoint.z, - color: layer.color, - name: layer.name - }); - //app.barChart.addBar(dist, layer.materialParameter[0].color, layer.name); + data.push({ + dist: realHeight,//dist, + max: point.z, + min: previousPoint.z, + color: layer.color, + name: layer.name + }); + //app.barChart.addBar(dist, layer.materialParameter[0].color, layer.name); } } } @@ -166,6 +203,7 @@ export class BaseEditor { } + connect(e) { // On touch, the latlng has not been updated because there is // no mousemove. diff --git a/src/js/core/utilities.js b/src/js/core/utilities.js index 4de49d6..9c09d58 100644 --- a/src/js/core/utilities.js +++ b/src/js/core/utilities.js @@ -126,6 +126,28 @@ export async function getMetadata(serviceUrl) { // return await response.json(); } +export function swap(arr, i1, i2) { + // keep in a provisional the value of the first index + let aux = arr[i1]; + // insert the value of the second index in the place of the first index + arr[i1] = arr[i2]; + // By doing this I lose the original value but I have it stored in aux by + // so I just need to match the second index to aux to complete + arr[i2] = aux; + return arr; +} + +export function round(wert, dez) { + wert = parseFloat(wert); + if (!wert) return 0; + dez = parseInt(dez); + if (!dez) dez = 0; + + var umrechnungsfaktor = Math.pow(10, dez); + + return Math.round(wert * umrechnungsfaktor) / umrechnungsfaktor; +} + // @function create(proto: Object, properties?: Object): Object // Compatibility polyfill for [Object.create](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/create) export var create = Object.create || (function () { diff --git a/src/js/tools/BoreholeTool.js b/src/js/tools/BoreholeTool.js index 6611457..0b697f8 100644 --- a/src/js/tools/BoreholeTool.js +++ b/src/js/tools/BoreholeTool.js @@ -1,6 +1,5 @@ import { EventEmitter } from '../core/EventEmitter'; import { MeshLambertMaterial } from 'three/src/materials/MeshLambertMaterial'; -import * as domEvent from '../core/domEvent'; import { MarkerLayer } from '../layer/MarkerLayer'; import * as dom from '../core/domUtil'; import * as util from '../core/utilities';