- new BoreholeTool: BoreholeControl.css, BoreholeControl.js, BaseEditor.js, MarkerLayer

- changes in: Picking.js, domUtil.js, Map.js, Layer.js (for popup), main.js, index.html (third data tab)
- npm updates
This commit is contained in:
Arno Kaimbacher 2021-03-23 12:26:43 +01:00
parent a09db46a03
commit 37d7973071
12 changed files with 830 additions and 150 deletions

View File

@ -122,7 +122,7 @@
<li class="metadata-link is-active" name="#one">
<a>
<span class="icon is-small">
<i class="fas fa-image" aria-hidden="true"></i>
<i class="fas fa-hammer" aria-hidden="true"></i>
</span>
<span>Geology</span>
</a>
@ -135,6 +135,14 @@
<span>Analysis</span>
</a>
</li>
<li class="data-link" name="#three">
<a>
<span class="icon is-small">
<i class="fas fa-database" aria-hidden="true"></i>
</span>
<span>Data</span>
</a>
</li>
</ul>
<div class="tab-content">
@ -163,6 +171,11 @@
</div>
</div>
<div class="tab-pane content-data" id="three">
<div class="panel-section">
...coming soon
</div>
</div>
</div>
</div>

305
package-lock.json generated
View File

@ -50,9 +50,9 @@
}
},
"node_modules/@babel/compat-data": {
"version": "7.13.11",
"resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.13.11.tgz",
"integrity": "sha512-BwKEkO+2a67DcFeS3RLl0Z3Gs2OvdXewuWjc1Hfokhb5eQWP9YRYH1/+VrVZvql2CfjOiNGqSAFOYt4lsqTHzg==",
"version": "7.13.12",
"resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.13.12.tgz",
"integrity": "sha512-3eJJ841uKxeV8dcN/2yGEUy+RfgQspPEgQat85umsE1rotuquQ2AbIub4S6j7c50a2d+4myc+zSlnXeIHrOnhQ==",
"dev": true
},
"node_modules/@babel/core": {
@ -219,38 +219,37 @@
}
},
"node_modules/@babel/helper-member-expression-to-functions": {
"version": "7.13.0",
"resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.0.tgz",
"integrity": "sha512-yvRf8Ivk62JwisqV1rFRMxiSMDGnN6KH1/mDMmIrij4jztpQNRoHqqMG3U6apYbGRPJpgPalhva9Yd06HlUxJQ==",
"version": "7.13.12",
"resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz",
"integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==",
"dev": true,
"dependencies": {
"@babel/types": "^7.13.0"
"@babel/types": "^7.13.12"
}
},
"node_modules/@babel/helper-module-imports": {
"version": "7.12.13",
"resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.13.tgz",
"integrity": "sha512-NGmfvRp9Rqxy0uHSSVP+SRIW1q31a7Ji10cLBcqSDUngGentY4FRiHOFZFE1CLU5eiL0oE8reH7Tg1y99TDM/g==",
"version": "7.13.12",
"resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz",
"integrity": "sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA==",
"dev": true,
"dependencies": {
"@babel/types": "^7.12.13"
"@babel/types": "^7.13.12"
}
},
"node_modules/@babel/helper-module-transforms": {
"version": "7.13.0",
"resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.13.0.tgz",
"integrity": "sha512-Ls8/VBwH577+pw7Ku1QkUWIyRRNHpYlts7+qSqBBFCW3I8QteB9DxfcZ5YJpOwH6Ihe/wn8ch7fMGOP1OhEIvw==",
"version": "7.13.12",
"resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.13.12.tgz",
"integrity": "sha512-7zVQqMO3V+K4JOOj40kxiCrMf6xlQAkewBB0eu2b03OO/Q21ZutOzjpfD79A5gtE/2OWi1nv625MrDlGlkbknQ==",
"dev": true,
"dependencies": {
"@babel/helper-module-imports": "^7.12.13",
"@babel/helper-replace-supers": "^7.13.0",
"@babel/helper-simple-access": "^7.12.13",
"@babel/helper-module-imports": "^7.13.12",
"@babel/helper-replace-supers": "^7.13.12",
"@babel/helper-simple-access": "^7.13.12",
"@babel/helper-split-export-declaration": "^7.12.13",
"@babel/helper-validator-identifier": "^7.12.11",
"@babel/template": "^7.12.13",
"@babel/traverse": "^7.13.0",
"@babel/types": "^7.13.0",
"lodash": "^4.17.19"
"@babel/types": "^7.13.12"
}
},
"node_modules/@babel/helper-optimise-call-expression": {
@ -280,24 +279,24 @@
}
},
"node_modules/@babel/helper-replace-supers": {
"version": "7.13.0",
"resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.0.tgz",
"integrity": "sha512-Segd5me1+Pz+rmN/NFBOplMbZG3SqRJOBlY+mA0SxAv6rjj7zJqr1AVr3SfzUVTLCv7ZLU5FycOM/SBGuLPbZw==",
"version": "7.13.12",
"resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz",
"integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==",
"dev": true,
"dependencies": {
"@babel/helper-member-expression-to-functions": "^7.13.0",
"@babel/helper-member-expression-to-functions": "^7.13.12",
"@babel/helper-optimise-call-expression": "^7.12.13",
"@babel/traverse": "^7.13.0",
"@babel/types": "^7.13.0"
"@babel/types": "^7.13.12"
}
},
"node_modules/@babel/helper-simple-access": {
"version": "7.12.13",
"resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.12.13.tgz",
"integrity": "sha512-0ski5dyYIHEfwpWGx5GPWhH35j342JaflmCeQmsPWcrOQDtCN6C1zKAVRFVbK53lPW2c9TsuLLSUDf0tIGJ5hA==",
"version": "7.13.12",
"resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.13.12.tgz",
"integrity": "sha512-7FEjbrx5SL9cWvXioDbnlYTppcZGuCY6ow3/D5vMggb2Ywgu4dMrpTJX0JdQAIcRRUElOIxF3yEooa9gUb9ZbA==",
"dev": true,
"dependencies": {
"@babel/types": "^7.12.13"
"@babel/types": "^7.13.12"
}
},
"node_modules/@babel/helper-skip-transparent-expression-wrappers": {
@ -365,9 +364,9 @@
}
},
"node_modules/@babel/parser": {
"version": "7.13.11",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.13.11.tgz",
"integrity": "sha512-PhuoqeHoO9fc4ffMEVk4qb/w/s2iOSWohvbHxLtxui0eBg3Lg5gN1U8wp1V1u61hOWkPQJJyJzGH6Y+grwkq8Q==",
"version": "7.13.12",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.13.12.tgz",
"integrity": "sha512-4T7Pb244rxH24yR116LAuJ+adxXXnHhZaLJjegJVKSdoNCe4x1eDBaud5YIcQFcqzsaD5BHvJw5BQ0AZapdCRw==",
"dev": true,
"bin": {
"parser": "bin/babel-parser.js"
@ -376,6 +375,20 @@
"node": ">=6.0.0"
}
},
"node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": {
"version": "7.13.12",
"resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.13.12.tgz",
"integrity": "sha512-d0u3zWKcoZf379fOeJdr1a5WPDny4aOFZ6hlfKivgK0LY7ZxNfoaHL2fWwdGtHyVvra38FC+HVYkO+byfSA8AQ==",
"dev": true,
"dependencies": {
"@babel/helper-plugin-utils": "^7.13.0",
"@babel/helper-skip-transparent-expression-wrappers": "^7.12.1",
"@babel/plugin-proposal-optional-chaining": "^7.13.12"
},
"peerDependencies": {
"@babel/core": "^7.13.0"
}
},
"node_modules/@babel/plugin-proposal-async-generator-functions": {
"version": "7.13.8",
"resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.13.8.tgz",
@ -525,9 +538,9 @@
}
},
"node_modules/@babel/plugin-proposal-optional-chaining": {
"version": "7.13.8",
"resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.13.8.tgz",
"integrity": "sha512-hpbBwbTgd7Cz1QryvwJZRo1U0k1q8uyBmeXOSQUjdg/A2TASkhR/rz7AyqZ/kS8kbpsNA80rOYbxySBJAqmhhQ==",
"version": "7.13.12",
"resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.13.12.tgz",
"integrity": "sha512-fcEdKOkIB7Tf4IxrgEVeFC4zeJSTr78no9wTdBuZZbqF64kzllU0ybo2zrzm7gUQfxGhBgq4E39oRs8Zx/RMYQ==",
"dev": true,
"dependencies": {
"@babel/helper-plugin-utils": "^7.13.0",
@ -1149,15 +1162,16 @@
}
},
"node_modules/@babel/preset-env": {
"version": "7.13.10",
"resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.13.10.tgz",
"integrity": "sha512-nOsTScuoRghRtUsRr/c69d042ysfPHcu+KOB4A9aAO9eJYqrkat+LF8G1yp1HD18QiwixT2CisZTr/0b3YZPXQ==",
"version": "7.13.12",
"resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.13.12.tgz",
"integrity": "sha512-JzElc6jk3Ko6zuZgBtjOd01pf9yYDEIH8BcqVuYIuOkzOwDesoa/Nz4gIo4lBG6K861KTV9TvIgmFuT6ytOaAA==",
"dev": true,
"dependencies": {
"@babel/compat-data": "^7.13.8",
"@babel/compat-data": "^7.13.12",
"@babel/helper-compilation-targets": "^7.13.10",
"@babel/helper-plugin-utils": "^7.13.0",
"@babel/helper-validator-option": "^7.12.17",
"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.13.12",
"@babel/plugin-proposal-async-generator-functions": "^7.13.8",
"@babel/plugin-proposal-class-properties": "^7.13.0",
"@babel/plugin-proposal-dynamic-import": "^7.13.8",
@ -1168,7 +1182,7 @@
"@babel/plugin-proposal-numeric-separator": "^7.12.13",
"@babel/plugin-proposal-object-rest-spread": "^7.13.8",
"@babel/plugin-proposal-optional-catch-binding": "^7.13.8",
"@babel/plugin-proposal-optional-chaining": "^7.13.8",
"@babel/plugin-proposal-optional-chaining": "^7.13.12",
"@babel/plugin-proposal-private-methods": "^7.13.0",
"@babel/plugin-proposal-unicode-property-regex": "^7.12.13",
"@babel/plugin-syntax-async-generators": "^7.8.4",
@ -1216,7 +1230,7 @@
"@babel/plugin-transform-unicode-escapes": "^7.12.13",
"@babel/plugin-transform-unicode-regex": "^7.12.13",
"@babel/preset-modules": "^0.1.4",
"@babel/types": "^7.13.0",
"@babel/types": "^7.13.12",
"babel-plugin-polyfill-corejs2": "^0.1.4",
"babel-plugin-polyfill-corejs3": "^0.1.3",
"babel-plugin-polyfill-regenerator": "^0.1.2",
@ -1281,9 +1295,9 @@
}
},
"node_modules/@babel/types": {
"version": "7.13.0",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.13.0.tgz",
"integrity": "sha512-hE+HE8rnG1Z6Wzo+MhaKE5lM5eMx71T4EHJgku2E3xIfaULhDcxiiRxUYgwX8qwP1BBSlag+TdGOt6JAidIZTA==",
"version": "7.13.12",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.13.12.tgz",
"integrity": "sha512-K4nY2xFN4QMvQwkQ+zmBDp6ANMbVNw6BbxWmYA4qNjhR9W+Lj/8ky5MEY2Me5r+B2c6/v6F53oMndG+f9s3IiA==",
"dev": true,
"dependencies": {
"@babel/helper-validator-identifier": "^7.12.11",
@ -2009,9 +2023,9 @@
}
},
"node_modules/caniuse-lite": {
"version": "1.0.30001202",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001202.tgz",
"integrity": "sha512-ZcijQNqrcF8JNLjzvEiXqX4JUYxoZa7Pvcsd9UD8Kz4TvhTonOSNRsK+qtvpVL4l6+T1Rh4LFtLfnNWg6BGWCQ==",
"version": "1.0.30001204",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001204.tgz",
"integrity": "sha512-JUdjWpcxfJ9IPamy2f5JaRDCaqJOxDzOSKtbdx4rH9VivMd1vIzoPumsJa9LoMIi4Fx2BV2KZOxWhNkBjaYivQ==",
"dev": true
},
"node_modules/caseless": {
@ -2434,9 +2448,9 @@
}
},
"node_modules/css-loader/node_modules/semver": {
"version": "7.3.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz",
"integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==",
"version": "7.3.5",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
"integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==",
"dev": true,
"dependencies": {
"lru-cache": "^6.0.0"
@ -2611,9 +2625,9 @@
}
},
"node_modules/electron-to-chromium": {
"version": "1.3.690",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.690.tgz",
"integrity": "sha512-zPbaSv1c8LUKqQ+scNxJKv01RYFkVVF1xli+b+3Ty8ONujHjAMg+t/COmdZqrtnS1gT+g4hbSodHillymt1Lww==",
"version": "1.3.695",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.695.tgz",
"integrity": "sha512-lz66RliUqLHU1Ojxx1A4QUxKydjiQ79Y4dZyPobs2Dmxj5aVL2TM3KoQ2Gs7HS703Bfny+ukI3KOxwAB0xceHQ==",
"dev": true
},
"node_modules/emoji-regex": {
@ -4132,9 +4146,9 @@
}
},
"node_modules/node-gyp/node_modules/semver": {
"version": "7.3.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz",
"integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==",
"version": "7.3.5",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
"integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==",
"dev": true,
"dependencies": {
"lru-cache": "^6.0.0"
@ -4678,9 +4692,9 @@
}
},
"node_modules/queue-microtask": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.2.tgz",
"integrity": "sha512-dB15eXv3p2jDlbOiNLyMabYg1/sXvppd8DP2J3EOCQ0AkuSXCW2tP7mnVouVLJKgUMY6yP0kcQDVpLCN13h4Xg==",
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
"integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==",
"dev": true,
"funding": [
{
@ -4891,9 +4905,9 @@
"dev": true
},
"node_modules/regjsparser": {
"version": "0.6.7",
"resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.7.tgz",
"integrity": "sha512-ib77G0uxsA2ovgiYbCVGx4Pv3PSttAx2vIwidqQzbL2U5S4Q+j00HdSAneSBuyVcMvEnTXMjiGgB+DlXozVhpQ==",
"version": "0.6.8",
"resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.8.tgz",
"integrity": "sha512-3weFrFQREJhJ2PW+iCGaG6TenyzNSZgsBKZ/oEf6Trme31COSeIWhHw9O6FPkuXktfx+b6Hf/5e6dKPHaROq2g==",
"dev": true,
"dependencies": {
"jsesc": "~0.5.0"
@ -5834,9 +5848,9 @@
}
},
"node_modules/terser": {
"version": "5.6.0",
"resolved": "https://registry.npmjs.org/terser/-/terser-5.6.0.tgz",
"integrity": "sha512-vyqLMoqadC1uR0vywqOZzriDYzgEkNJFK4q9GeyOBHIbiECHiWLKcWfbQWAUaPfxkjDhapSlZB9f7fkMrvkVjA==",
"version": "5.6.1",
"resolved": "https://registry.npmjs.org/terser/-/terser-5.6.1.tgz",
"integrity": "sha512-yv9YLFQQ+3ZqgWCUk+pvNJwgUTdlIxUk1WTN+RnaFJe2L7ipG2csPT0ra2XRm7Cs8cxN7QXmK1rFzEwYEQkzXw==",
"dev": true,
"dependencies": {
"commander": "^2.20.0",
@ -6211,9 +6225,9 @@
}
},
"node_modules/webpack": {
"version": "5.26.3",
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.26.3.tgz",
"integrity": "sha512-z/F2lt2N1fZqaud1B4SzjL3OW03eULThbBXQ2OX4LSrZX4N9k1A5d0Rje3zS2g887DTWyAV0KGqEf64ois2dhg==",
"version": "5.27.2",
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.27.2.tgz",
"integrity": "sha512-brNF3N/EdvMzkaZ/Xzb8sqPn5Si3iw6meqCnmNFtcnkorZsFZCBFMa2ElpIMjx6sKWYsnUpBO2dnX+7xgj+mjg==",
"dev": true,
"dependencies": {
"@types/eslint-scope": "^3.7.0",
@ -6305,9 +6319,9 @@
}
},
"node_modules/webpack-cli/node_modules/commander": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-7.1.0.tgz",
"integrity": "sha512-pRxBna3MJe6HKnBGsDyMv8ETbptw3axEdYHoqNh7gu5oDcew8fs0xnivZGm06Ogk8zGAJ9VX+OPEr2GXEQK4dg==",
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz",
"integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==",
"dev": true,
"engines": {
"node": ">= 10"
@ -6636,9 +6650,9 @@
}
},
"@babel/compat-data": {
"version": "7.13.11",
"resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.13.11.tgz",
"integrity": "sha512-BwKEkO+2a67DcFeS3RLl0Z3Gs2OvdXewuWjc1Hfokhb5eQWP9YRYH1/+VrVZvql2CfjOiNGqSAFOYt4lsqTHzg==",
"version": "7.13.12",
"resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.13.12.tgz",
"integrity": "sha512-3eJJ841uKxeV8dcN/2yGEUy+RfgQspPEgQat85umsE1rotuquQ2AbIub4S6j7c50a2d+4myc+zSlnXeIHrOnhQ==",
"dev": true
},
"@babel/core": {
@ -6786,38 +6800,37 @@
}
},
"@babel/helper-member-expression-to-functions": {
"version": "7.13.0",
"resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.0.tgz",
"integrity": "sha512-yvRf8Ivk62JwisqV1rFRMxiSMDGnN6KH1/mDMmIrij4jztpQNRoHqqMG3U6apYbGRPJpgPalhva9Yd06HlUxJQ==",
"version": "7.13.12",
"resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz",
"integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==",
"dev": true,
"requires": {
"@babel/types": "^7.13.0"
"@babel/types": "^7.13.12"
}
},
"@babel/helper-module-imports": {
"version": "7.12.13",
"resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.13.tgz",
"integrity": "sha512-NGmfvRp9Rqxy0uHSSVP+SRIW1q31a7Ji10cLBcqSDUngGentY4FRiHOFZFE1CLU5eiL0oE8reH7Tg1y99TDM/g==",
"version": "7.13.12",
"resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz",
"integrity": "sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA==",
"dev": true,
"requires": {
"@babel/types": "^7.12.13"
"@babel/types": "^7.13.12"
}
},
"@babel/helper-module-transforms": {
"version": "7.13.0",
"resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.13.0.tgz",
"integrity": "sha512-Ls8/VBwH577+pw7Ku1QkUWIyRRNHpYlts7+qSqBBFCW3I8QteB9DxfcZ5YJpOwH6Ihe/wn8ch7fMGOP1OhEIvw==",
"version": "7.13.12",
"resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.13.12.tgz",
"integrity": "sha512-7zVQqMO3V+K4JOOj40kxiCrMf6xlQAkewBB0eu2b03OO/Q21ZutOzjpfD79A5gtE/2OWi1nv625MrDlGlkbknQ==",
"dev": true,
"requires": {
"@babel/helper-module-imports": "^7.12.13",
"@babel/helper-replace-supers": "^7.13.0",
"@babel/helper-simple-access": "^7.12.13",
"@babel/helper-module-imports": "^7.13.12",
"@babel/helper-replace-supers": "^7.13.12",
"@babel/helper-simple-access": "^7.13.12",
"@babel/helper-split-export-declaration": "^7.12.13",
"@babel/helper-validator-identifier": "^7.12.11",
"@babel/template": "^7.12.13",
"@babel/traverse": "^7.13.0",
"@babel/types": "^7.13.0",
"lodash": "^4.17.19"
"@babel/types": "^7.13.12"
}
},
"@babel/helper-optimise-call-expression": {
@ -6847,24 +6860,24 @@
}
},
"@babel/helper-replace-supers": {
"version": "7.13.0",
"resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.0.tgz",
"integrity": "sha512-Segd5me1+Pz+rmN/NFBOplMbZG3SqRJOBlY+mA0SxAv6rjj7zJqr1AVr3SfzUVTLCv7ZLU5FycOM/SBGuLPbZw==",
"version": "7.13.12",
"resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz",
"integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==",
"dev": true,
"requires": {
"@babel/helper-member-expression-to-functions": "^7.13.0",
"@babel/helper-member-expression-to-functions": "^7.13.12",
"@babel/helper-optimise-call-expression": "^7.12.13",
"@babel/traverse": "^7.13.0",
"@babel/types": "^7.13.0"
"@babel/types": "^7.13.12"
}
},
"@babel/helper-simple-access": {
"version": "7.12.13",
"resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.12.13.tgz",
"integrity": "sha512-0ski5dyYIHEfwpWGx5GPWhH35j342JaflmCeQmsPWcrOQDtCN6C1zKAVRFVbK53lPW2c9TsuLLSUDf0tIGJ5hA==",
"version": "7.13.12",
"resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.13.12.tgz",
"integrity": "sha512-7FEjbrx5SL9cWvXioDbnlYTppcZGuCY6ow3/D5vMggb2Ywgu4dMrpTJX0JdQAIcRRUElOIxF3yEooa9gUb9ZbA==",
"dev": true,
"requires": {
"@babel/types": "^7.12.13"
"@babel/types": "^7.13.12"
}
},
"@babel/helper-skip-transparent-expression-wrappers": {
@ -6932,11 +6945,22 @@
}
},
"@babel/parser": {
"version": "7.13.11",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.13.11.tgz",
"integrity": "sha512-PhuoqeHoO9fc4ffMEVk4qb/w/s2iOSWohvbHxLtxui0eBg3Lg5gN1U8wp1V1u61hOWkPQJJyJzGH6Y+grwkq8Q==",
"version": "7.13.12",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.13.12.tgz",
"integrity": "sha512-4T7Pb244rxH24yR116LAuJ+adxXXnHhZaLJjegJVKSdoNCe4x1eDBaud5YIcQFcqzsaD5BHvJw5BQ0AZapdCRw==",
"dev": true
},
"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": {
"version": "7.13.12",
"resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.13.12.tgz",
"integrity": "sha512-d0u3zWKcoZf379fOeJdr1a5WPDny4aOFZ6hlfKivgK0LY7ZxNfoaHL2fWwdGtHyVvra38FC+HVYkO+byfSA8AQ==",
"dev": true,
"requires": {
"@babel/helper-plugin-utils": "^7.13.0",
"@babel/helper-skip-transparent-expression-wrappers": "^7.12.1",
"@babel/plugin-proposal-optional-chaining": "^7.13.12"
}
},
"@babel/plugin-proposal-async-generator-functions": {
"version": "7.13.8",
"resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.13.8.tgz",
@ -7053,9 +7077,9 @@
}
},
"@babel/plugin-proposal-optional-chaining": {
"version": "7.13.8",
"resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.13.8.tgz",
"integrity": "sha512-hpbBwbTgd7Cz1QryvwJZRo1U0k1q8uyBmeXOSQUjdg/A2TASkhR/rz7AyqZ/kS8kbpsNA80rOYbxySBJAqmhhQ==",
"version": "7.13.12",
"resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.13.12.tgz",
"integrity": "sha512-fcEdKOkIB7Tf4IxrgEVeFC4zeJSTr78no9wTdBuZZbqF64kzllU0ybo2zrzm7gUQfxGhBgq4E39oRs8Zx/RMYQ==",
"dev": true,
"requires": {
"@babel/helper-plugin-utils": "^7.13.0",
@ -7527,15 +7551,16 @@
}
},
"@babel/preset-env": {
"version": "7.13.10",
"resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.13.10.tgz",
"integrity": "sha512-nOsTScuoRghRtUsRr/c69d042ysfPHcu+KOB4A9aAO9eJYqrkat+LF8G1yp1HD18QiwixT2CisZTr/0b3YZPXQ==",
"version": "7.13.12",
"resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.13.12.tgz",
"integrity": "sha512-JzElc6jk3Ko6zuZgBtjOd01pf9yYDEIH8BcqVuYIuOkzOwDesoa/Nz4gIo4lBG6K861KTV9TvIgmFuT6ytOaAA==",
"dev": true,
"requires": {
"@babel/compat-data": "^7.13.8",
"@babel/compat-data": "^7.13.12",
"@babel/helper-compilation-targets": "^7.13.10",
"@babel/helper-plugin-utils": "^7.13.0",
"@babel/helper-validator-option": "^7.12.17",
"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.13.12",
"@babel/plugin-proposal-async-generator-functions": "^7.13.8",
"@babel/plugin-proposal-class-properties": "^7.13.0",
"@babel/plugin-proposal-dynamic-import": "^7.13.8",
@ -7546,7 +7571,7 @@
"@babel/plugin-proposal-numeric-separator": "^7.12.13",
"@babel/plugin-proposal-object-rest-spread": "^7.13.8",
"@babel/plugin-proposal-optional-catch-binding": "^7.13.8",
"@babel/plugin-proposal-optional-chaining": "^7.13.8",
"@babel/plugin-proposal-optional-chaining": "^7.13.12",
"@babel/plugin-proposal-private-methods": "^7.13.0",
"@babel/plugin-proposal-unicode-property-regex": "^7.12.13",
"@babel/plugin-syntax-async-generators": "^7.8.4",
@ -7594,7 +7619,7 @@
"@babel/plugin-transform-unicode-escapes": "^7.12.13",
"@babel/plugin-transform-unicode-regex": "^7.12.13",
"@babel/preset-modules": "^0.1.4",
"@babel/types": "^7.13.0",
"@babel/types": "^7.13.12",
"babel-plugin-polyfill-corejs2": "^0.1.4",
"babel-plugin-polyfill-corejs3": "^0.1.3",
"babel-plugin-polyfill-regenerator": "^0.1.2",
@ -7653,9 +7678,9 @@
}
},
"@babel/types": {
"version": "7.13.0",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.13.0.tgz",
"integrity": "sha512-hE+HE8rnG1Z6Wzo+MhaKE5lM5eMx71T4EHJgku2E3xIfaULhDcxiiRxUYgwX8qwP1BBSlag+TdGOt6JAidIZTA==",
"version": "7.13.12",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.13.12.tgz",
"integrity": "sha512-K4nY2xFN4QMvQwkQ+zmBDp6ANMbVNw6BbxWmYA4qNjhR9W+Lj/8ky5MEY2Me5r+B2c6/v6F53oMndG+f9s3IiA==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.12.11",
@ -8258,9 +8283,9 @@
}
},
"caniuse-lite": {
"version": "1.0.30001202",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001202.tgz",
"integrity": "sha512-ZcijQNqrcF8JNLjzvEiXqX4JUYxoZa7Pvcsd9UD8Kz4TvhTonOSNRsK+qtvpVL4l6+T1Rh4LFtLfnNWg6BGWCQ==",
"version": "1.0.30001204",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001204.tgz",
"integrity": "sha512-JUdjWpcxfJ9IPamy2f5JaRDCaqJOxDzOSKtbdx4rH9VivMd1vIzoPumsJa9LoMIi4Fx2BV2KZOxWhNkBjaYivQ==",
"dev": true
},
"caseless": {
@ -8606,9 +8631,9 @@
}
},
"semver": {
"version": "7.3.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz",
"integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==",
"version": "7.3.5",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
"integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==",
"dev": true,
"requires": {
"lru-cache": "^6.0.0"
@ -8725,9 +8750,9 @@
}
},
"electron-to-chromium": {
"version": "1.3.690",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.690.tgz",
"integrity": "sha512-zPbaSv1c8LUKqQ+scNxJKv01RYFkVVF1xli+b+3Ty8ONujHjAMg+t/COmdZqrtnS1gT+g4hbSodHillymt1Lww==",
"version": "1.3.695",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.695.tgz",
"integrity": "sha512-lz66RliUqLHU1Ojxx1A4QUxKydjiQ79Y4dZyPobs2Dmxj5aVL2TM3KoQ2Gs7HS703Bfny+ukI3KOxwAB0xceHQ==",
"dev": true
},
"emoji-regex": {
@ -9910,9 +9935,9 @@
},
"dependencies": {
"semver": {
"version": "7.3.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz",
"integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==",
"version": "7.3.5",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
"integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==",
"dev": true,
"requires": {
"lru-cache": "^6.0.0"
@ -10310,9 +10335,9 @@
"dev": true
},
"queue-microtask": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.2.tgz",
"integrity": "sha512-dB15eXv3p2jDlbOiNLyMabYg1/sXvppd8DP2J3EOCQ0AkuSXCW2tP7mnVouVLJKgUMY6yP0kcQDVpLCN13h4Xg==",
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
"integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==",
"dev": true,
"peer": true
},
@ -10481,9 +10506,9 @@
"dev": true
},
"regjsparser": {
"version": "0.6.7",
"resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.7.tgz",
"integrity": "sha512-ib77G0uxsA2ovgiYbCVGx4Pv3PSttAx2vIwidqQzbL2U5S4Q+j00HdSAneSBuyVcMvEnTXMjiGgB+DlXozVhpQ==",
"version": "0.6.8",
"resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.8.tgz",
"integrity": "sha512-3weFrFQREJhJ2PW+iCGaG6TenyzNSZgsBKZ/oEf6Trme31COSeIWhHw9O6FPkuXktfx+b6Hf/5e6dKPHaROq2g==",
"dev": true,
"requires": {
"jsesc": "~0.5.0"
@ -11219,9 +11244,9 @@
}
},
"terser": {
"version": "5.6.0",
"resolved": "https://registry.npmjs.org/terser/-/terser-5.6.0.tgz",
"integrity": "sha512-vyqLMoqadC1uR0vywqOZzriDYzgEkNJFK4q9GeyOBHIbiECHiWLKcWfbQWAUaPfxkjDhapSlZB9f7fkMrvkVjA==",
"version": "5.6.1",
"resolved": "https://registry.npmjs.org/terser/-/terser-5.6.1.tgz",
"integrity": "sha512-yv9YLFQQ+3ZqgWCUk+pvNJwgUTdlIxUk1WTN+RnaFJe2L7ipG2csPT0ra2XRm7Cs8cxN7QXmK1rFzEwYEQkzXw==",
"dev": true,
"requires": {
"commander": "^2.20.0",
@ -11498,9 +11523,9 @@
}
},
"webpack": {
"version": "5.26.3",
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.26.3.tgz",
"integrity": "sha512-z/F2lt2N1fZqaud1B4SzjL3OW03eULThbBXQ2OX4LSrZX4N9k1A5d0Rje3zS2g887DTWyAV0KGqEf64ois2dhg==",
"version": "5.27.2",
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.27.2.tgz",
"integrity": "sha512-brNF3N/EdvMzkaZ/Xzb8sqPn5Si3iw6meqCnmNFtcnkorZsFZCBFMa2ElpIMjx6sKWYsnUpBO2dnX+7xgj+mjg==",
"dev": true,
"requires": {
"@types/eslint-scope": "^3.7.0",
@ -11580,9 +11605,9 @@
},
"dependencies": {
"commander": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-7.1.0.tgz",
"integrity": "sha512-pRxBna3MJe6HKnBGsDyMv8ETbptw3axEdYHoqNh7gu5oDcew8fs0xnivZGm06Ogk8zGAJ9VX+OPEr2GXEQK4dg==",
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz",
"integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==",
"dev": true
}
}

View File

@ -17,6 +17,8 @@ export class Picking {
plane;
touchCapable = false;
isDraging = false;
enabled = true;
defaultMapCursor;
constructor(size, center, simulation) {
this.size = size;
@ -43,6 +45,7 @@ export class Picking {
simulation.scene.add(this.plane);
this.domElement = simulation.renderer.domElement;
this.defaultMapCursor = this.domElement.style.cursor;
domEvent.on(this.domElement, 'mousemove', this.mouseMove, this);
if (this.touchCapable == true) {
domEvent.on(this.domElement, 'touchstart', this.beginDrag, this);
@ -78,7 +81,7 @@ export class Picking {
}
mouseMove(event) {
if (this.isDraging == true || this.simulation.selection.visible == false) {
if (this.isDraging == true || this.simulation.selection.visible == false || this.enabled == false) {
return;
}
let point = this._getCanvasPoint(event);
@ -110,14 +113,14 @@ export class Picking {
// cursor is not selecting the box
this.intersected.guardian.rayOut();
this.intersected = null;
this.simulation.renderer.domElement.style.cursor = 'auto';
this.simulation.renderer.domElement.style.cursor = this.defaultMapCursor;
// this.simulation.throttledRender();
this.simulation.deferringThrottle();
}
}
beginDrag(event) {
if (this.simulation.selection.visible == false) {
if (this.simulation.selection.visible == false && this.enabled == false) {
return;
}
// exit drag method, if not left mouse button was clicked
@ -225,5 +228,25 @@ export class Picking {
}
}
disable () {
domEvent.off(this.domElement, 'mousemove', this.mouseMove, this);
if (this.touchCapable == true) {
domEvent.off(this.domElement, 'touchstart', this.beginDrag, this);
} else {
domEvent.off(this.domElement, 'mousedown', this.beginDrag, this);
}
this.enabled = false;
}
enable() {
domEvent.on(this.domElement, 'mousemove', this.mouseMove, this);
if (this.touchCapable == true) {
domEvent.on(this.domElement, 'touchstart', this.beginDrag, this);
} else {
domEvent.on(this.domElement, 'mousedown', this.beginDrag, this);
}
this.enabled = true;
}
}

View File

@ -0,0 +1,51 @@
.gba-maptool-control {
border-radius: 4px;
border: 1px solid #bbb;
box-shadow: none;
margin:0;
padding:0;
overflow:hidden;
}
.gba-maptool-control a {
background-position: 50% 50%;
margin: 0;
background-repeat: no-repeat;
display: block;
height: 30px;
width: 30px;
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAdCAAAAACYz4PQAAAAAnRSTlMA/1uRIrUAAAAJcEhZcwAAFxIAABcSAWef0lIAAACLSURBVCjPzZExGQUxCINjoB5qAge1UBvdKgIN3c8ELjqjAQu89W4g8+tG/4+QAPL9zMw+H3gXd5mtKLGfTK3x/XPsDLskyR3SyFr2wKi7cwCLiAPPqcUDhwbbmfxi2thaDjpxPoFZ4+gYSjCEOpdg2DVdmPPojcxWATlodrRNgz27np029RLx9PjWPwOEKTMp8DmSAAAAAElFTkSuQmCC') /*img/drill2.png*/;
float: left;
}
.measure-enabled .gba-maptool-control a{
background-color:skyblue;
}
#radio{
float: left;
}
.gba-maptool-toggle {
display: inline-block;
vertical-align: middle;
}
.gba-maptool-control input:checked + label:before {
content: '✓';
padding-left: -2em;
}
.gba-maptool-control input[type=radio] {
display: none;
}
.gba-maptool-control input[type=radio] + label {
display: none;
line-height: 30px;
height: 30px;
width: 30px;
margin: 0;
padding: 0;
font-size: 12px;
text-align: center;
vertical-align: middle;
cursor: pointer;
}
.measure-enabled .gba-maptool-control input[type=radio] + label {
display: inline-block;
}

View File

@ -0,0 +1,34 @@
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';
import './BoreholeControl.css';
export class BoreholeControl extends Control {
onAdd (map) {
this.map = map;
// var b = this._nls = util.mixin({}, N.widgets.boreholetool);
this._container = dom.createDom("div", { "class": 'gba-maptool-control gba-control' });
//new L.Measurable(map);
let mapTool = new BoreholeTool(this.map);
//var inputDiv = dom.createDom("div", { id: "radio" }, this._container);
//this.addUnit(inputDiv, 'km', 'km', 'kilometers', true);
//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
// .on(toggle, 'click', domEvent.stop)
// .on(toggle, 'click', domEvent.preventDefault)
.on(toggle, 'click', mapTool.toggle, mapTool);
return this._container;
}
}

150
src/js/core/BaseEditor.js Normal file
View File

@ -0,0 +1,150 @@
import * as util from './utilities';
var Editable = {
makeCancellable: function (e) {
e.cancel = function () {
e._cancelled = true;
};
}
};
export class BaseEditor {
map;
marker;
mapTool;
constructor(map, featureLayer, options = {}) {
util.setOptions(this, options);
this.map = map;
this.marker = featureLayer;
this.marker.editor = this;
//this.editLayer = new LayerGroup();
this.mapTool = map.mapTool; //this.options.editTools || map.mapTool;
// this.marker.bindPopup(map._controls.boreholePopup);
}
enable() {
if (this._enabled) return this;
//if (this.isConnected() == true) {
// this.mapTool.editLayer.addLayer(this.editLayer);
//}
this.onEnable();
this._enabled = true;
this.marker.on('remove', this.disable.bind(this));
return this;
}
disable() {
this.marker.off('remove', this.disable.bind(this));
//this.editLayer.clearLayers();
//this.mapTool.editLayer.removeLayer(this.editLayer);
this.onDisable();
delete this._enabled;
if (this._drawing) this.cancelDrawing();
return this;
}
isConnected() {
return this.map.hasLayer(this.marker);
}
drawing() {
return !!this._drawing;
}
fireAndForward(type, e) {
e = e || {};
e.layer = this.marker;
this.marker.emit(type, e);
this.mapTool.fireAndForward(type, e);
}
onEnable() {
this.fireAndForward('editable:enable');
}
onDisable() {
this.fireAndForward('editable:disable');
}
onEditing() {
this.fireAndForward('editable:editing');
}
onDrawingMouseDown(e) {
this.fireAndForward('editable:drawing:mousedown', e);
}
startDrawing() {
if (!this._drawing) {
this._drawing = 1;// L.Editable.FORWARD;
}
this.mapTool.registerForDrawing(this);
this._onStartDrawing();
}
_onStartDrawing() {
this.fireAndForward('editable:drawing:start');
}
onDrawingClick(e) {
if (!this.drawing) return;
Editable.makeCancellable(e);
this.fireAndForward('editable:drawing:click', e);
if (e._cancelled) return;
//if (!this.isConnected()) {
// this.connect(e);
//}
var dxfIdentifyParams = {};
dxfIdentifyParams.clientX = e.clientX;
dxfIdentifyParams.clientY = e.clientY;
dxfIdentifyParams.width = this.map.container.clientWidth;
dxfIdentifyParams.height = this.map.container.clientHeight;
// var deferred = this.mapTool.drillTask.execute(dxfIdentifyParams);
// deferred.then(this.handleQueryResults3.bind(this));
this._processDrawingClick(e);
}
_processDrawingClick (e) {
this.fireAndForward('editable:drawing:clicked', e);
this._commitDrawing(e);
}
_commitDrawing (e) {
this._onCommitDrawing(e);
}
_onCommitDrawing(e) {
this.fireAndForward('editable:drawing:commit', e);
}
cancelDrawing() {
this._onCancelDrawing();
this._endDrawing();
}
_onCancelDrawing () {
this.fireAndForward('editable:drawing:cancel');
}
_endDrawing () {
this._drawing = false;
this.mapTool.unregisterForDrawing(this);
this._onEndDrawing();
}
_onEndDrawing() {
this.fireAndForward('editable:drawing:end');
}
}

View File

@ -2,6 +2,7 @@ import { OrbitControls } from '../lib/OrbitControls';
import * as dom from './domUtil';
import { HomeButton } from '../controls/HomeButton';
import { ZoomControl } from '../controls/ZoomControl';
import { BoreholeControl } from '../controls/BoreholeControl';
import * as util from './utilities';
import { TinLayer } from '../layer/TinLayer';
@ -125,6 +126,8 @@ class Map extends OrbitControls {
let zoomControl = this._controls.zoomControl = new ZoomControl();
zoomControl.addTo(this);
this._controls.maptoolControl = new BoreholeControl().addTo(this);
}
async addLayer(layer) {
@ -150,6 +153,10 @@ class Map extends OrbitControls {
return !!layer && (util.stamp(layer) in this._layers);
}
getCenter () { // (Boolean) -> LatLng
return this.target;
}
}
export { Map };

View File

@ -86,6 +86,17 @@ export function setProperties(element, properties) {
}
}
// @function hasClass(el: HTMLElement, name: String): Boolean
// Returns `true` if the element's class attribute contains `name`.
export function hasClass(el, name) {
if (el.classList !== undefined) {
return el.classList.contains(name);
}
var className = getClass(el);
return className.length > 0 && new RegExp('(^|\\s)' + name + '(\\s|$)').test(className);
}
// @function addClass(el: HTMLElement, name: String)
// Adds `name` to the element's class attribute.
export function addClass(el, name) {

View File

@ -42,6 +42,57 @@ class Layer extends EventEmitter {
return this._map.scene;
}
// @method bindPopup(content: String|HTMLElement|Function|Popup, options?: Popup options): this
// Binds a popup to the layer with the passed `content` and sets up the
// neccessary event listeners. If a `Function` is passed it will receive
// the layer as the first argument and should return a `String` or `HTMLElement`.
bindPopup(content) {
if (content instanceof BoreholePopup) {
//util.setOptions(content, options);
this._popup = content;
content._source = this;
}
if (!this._popup) {
//this._popup = new L.Popup(options, this);
this._popup = new BoreholePopup({}, this);
this._popup.addTo(this._map);
this._popup.setChartContent(content);
}
if (!this._popupHandlersAdded) {
this.on("click", this.openPopup, this); //remove: this.closePopup //move: this._movePopup
this.on('remove', this.closePopup, this);
this._popupHandlersAdded = true;
}
//// save the originally passed offset
//this._originalPopupOffset = this._popup.options.offset;
return this;
}
setPopupChartData(content) {
this._popup.setChartContent(content);
}
openPopup() {
this._popup.show();
}
// @method closePopup(): this
// Closes the popup bound to this layer if it is open.
closePopup() {
if (this._popup) {
this._popup._close();
//this._popup.removeFrom(this._map);
}
return this;
}
}
export { Layer };

131
src/js/layer/MarkerLayer.js Normal file
View File

@ -0,0 +1,131 @@
import { Layer } from './Layer';
import * as util from '../core/utilities';
import { BaseEditor } from '../core/BaseEditor';
export class MarkerLayer extends Layer {
createEditor(map) {
map = map || this._map;
var Klass = this.options.editorClass || this.getEditorClass(map);
return new Klass(map, this, this.options.editOptions);
}
enableEdit(map) {
if (!this.editor) {
this.createEditor(map);
}
return this.editor.enable();
}
getEditorClass(map) {
return BaseEditor;
}
options = {
pane: 'markerPane',
nonBubblingEvents: ['click', 'dblclick', 'mouseover', 'mouseout', 'contextmenu'],
//icon: new L.Icon.Default(),
opacity: 1,
clickable: true,
};
constructor(latlng, options) {
super();
util.setOptions(this, options);
this._latlng = latlng;
}
onAdd(map) {
//this._zoomAnimated = this._zoomAnimated && map.options.markerZoomAnimation;
this._initIcon();
this.update();
this.emit('add');
}
onRemove() {
//if (this.dragging && this.dragging.enabled()) {
// this.options.draggable = true;
// this.dragging.removeHooks();
//}
this._removeIcon();
//this._removeShadow();
this.emit('remove');
this._map = null;
}
update() {
if (this._icon) {
var pos = this._latlng;
this._setPos(pos);
}
this._map.emit("change");
return this;
}
getElement() {
return this._icon;
}
_initIcon() {
//create default icon
var opt = { r: 0.25, c: 0xffff00, o: 0.8 };
var icon = new THREE.Mesh(new THREE.CylinderGeometry(0, 0.5, 2),
new THREE.MeshLambertMaterial({ color: 0x38eeff, opacity: opt.o, transparent: (opt.o < 1) }));
icon.rotation.x = THREE.Math.degToRad(-90);
icon.visible = true;
//app.scene.add(app.boreholeMarker);
var addIcon = false;
// if we're not reusing the icon, remove the old one and init new one
if (icon !== this._icon) {
if (this._icon) {
this._removeIcon();
}
addIcon = true;
//if (options.title) {
// icon.title = options.title;
//}
//if (options.alt) {
// icon.alt = options.alt;
//}
}
this._icon = icon;
//this._initInteraction();
if (addIcon === true) {
this.getPane().add(this._icon);
}
}
_removeIcon() {
//if (this.options.riseOnHover) {
// this.off({
// mouseover: this._bringToFront,
// mouseout: this._resetZIndex
// });
//}
//L.DomUtil.remove(this._icon);
this.getPane().remove(this._icon);
//this.removeInteractiveTarget(this._icon);
this._icon = null;
}
_setPos(pos) {
//L.DomUtil.setPosition(this._icon, pos);
this._icon.position.set(pos.x, pos.y, pos.z);
}
setLatLng(latlng) {
this._latlng = latlng;
this.update();
}
}

View File

@ -13,7 +13,6 @@ import { NorthArrow } from './controls/NorthArrow';
import { LayerControl } from './controls/LayerControl';
import { BasemapControl } from './controls/BasemapControl';
import { SliderControl } from './controls/SliderControl';
// import { SlicerControl } from './controls/SlicerControl';
import { Mesh } from 'three/src/objects/Mesh';
import { SphereGeometry } from 'three/src/geometries/SphereGeometry';
import { MeshLambertMaterial } from 'three/src/materials/MeshLambertMaterial';
@ -196,7 +195,7 @@ class Application {
);
this.map.addLayer(this.selection);
new Picking(size, center, this);
this.map.picking = new Picking(size, center, this);
// let boxLayer = new BoxLayer({

View File

@ -0,0 +1,185 @@
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';
export class BoreholeTool extends EventEmitter {
options = {
zIndex: 1000,
markerClass: MarkerLayer,//THREE.CylinderGeometry,
drawingCSSClass: 'gba-editable-drawing',
drawingCursor: 'crosshair'
};
constructor(map, options = {}) {
super();
util.setOptions(this, options);
this._lastZIndex = this.options.zIndex;
this.map = map;
// this.featuresLayer = this._createFeaturesLayer();
//this.forwardLineGuide = this.createLineGuide();
//this.backwardLineGuide = this.createLineGuide();
this.map.mapTool = this;
//this.on('editable:drawing:end', function () {
// if (this.enabled()) this.startMarker();
//});
let highlightMaterial = new MeshLambertMaterial({ emissive: 0x999900, transparent: true, opacity: 0.5 });
this.defaultMapCursor = this.map.domElement.style.cursor;
}
// _createFeaturesLayer () {
// return new LayerGroup().addTo(this.map);
// }
enabled() {
return dom.hasClass(this.map.container, 'measure-enabled');
}
toggle() {
if (this.enabled()) {
this.disable();
}
else {
this.enable();
}
}
enable() {
//if (this.map.mapTool) this.map.mapTool.on('editable:drawing:start', this.disable.bind(this));
dom.addClass(this.map.container, 'measure-enabled');
//this.fireAndForward('showmeasure');
this._startMarker();
}
disable() {
//if (this.map.mapTool) this.map.mapTool.off('editable:drawing:start', this.disable.bind(this));
dom.removeClass(this.map.container, 'measure-enabled');
// this.featuresLayer.clearLayers();
//this.fireAndForward('hidemeasure');
if (this._drawingEditor) {
this._drawingEditor.cancelDrawing();
}
}
fireAndForward(type, e) {
e = e || {};
e.mapTool = this;
this.emit(type, e);
this.map.emit(type, e);
}
_startMarker(latlng, options) {
latlng = latlng || this.map.getCenter().clone();
let markerLayer = this._createMarker(latlng, options);//.addTo(this.map);
//this.map.addLayer(marker);
//marker.enableEdit(this.map).startDrawing(); //editor.startDrawing() -> registerForDrawing
let baseEditor = markerLayer.enableEdit(this.map);
baseEditor.startDrawing();
return markerLayer;
}
_createMarker(latlng, options) {
return this._createLayer(options && options.markerClass || this.options.markerClass, latlng, options);
}
_createLayer(klass, latlngs, options) {
options = util.extend({ editOptions: { mapTool: this } }, options);
let layer = new klass(latlngs, options);
//this.fireAndForward('editable:created', { layer: layer });
return layer;
}
registerForDrawing(editor) {
if (this._drawingEditor) {
this.unregisterForDrawing(this._drawingEditor);
}
//this.map.on('mousemove touchmove', editor.onDrawingMouseMove, editor);
this._blockEvents();
this._drawingEditor = editor;
this.map.on('mousedown', this._onMousedown);
this.map.on('clicked', this._onMouseup);
dom.addClass(this.map.domElement, this.options.drawingCSSClass);
// this.defaultMapCursor = this.map.domElement.style.cursor;
//this.map.domElement.style.cursor = this.options.drawingCursor;
// this.map.domElement.style.cursor = "crosshair";
this.map.domElement.style.cursor = "url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAdCAMAAABRwYYcAAABPlBMVEUAAAC7u7vQ0NCTk5PU1NTr6+u6urpVVVXR0dEhISG8vLxISEjS0tL09PTo6OiEhISlpaX39/cAAABNTU2mpqZRUVH4+Phzc3NOTk75+fmBgYHu7u7CwsKdnZ1cXFzQ0NAvLy8FBQXb29v9/f0rKysJCQmFhYVlZWUyMjLa2tr///96enoMDAyJiYkXFxcZGRkLCwtZWVl/f38aGhqrq6vV1dXj4+N5eXnb29vd3d1FRUXR0dG5ubnQ0NCCgoKVlZWNjY1BQUHt7e0GBgYAAAC3t7ctLS2/v783NzcfHx/r6+uUlJSkpKQCAgKoqKh8fHyAgIAsLCynp6cHBwddXV0yMjIXFxfOzs4+Pj7g4OCioqITExOfn58BAQEbGxsxMTGTk5PPz8+QkJAICAi4uLjf39+zs7O+vr5LS0uLi4svZJaIAAAATHRSTlMA7uD+DN/YA9/Y/tjfye4Z9Mn+/vTuydj+yfTmFRULC+7+38nY/hUZ/uDJ2P7+C/7Y2BT+/tjJFeD8C+AL3/702O7f/gPu/hTY7uDuXbwlLQAAAKxJREFUeF6VzWVyAmEMBuCwuLu7lsW9uBWqK7i7tb3/BcjHDciPPJPJmwnUBb8KCQBQ/OXWtAOUTVLtSg9Qe8JNCdW5jiEACHDLYTSGDhZvSpyrHTZhRen1mCuoAcS7nwi5oxy9l38L+Zfj3zGvYk4GOeY8ZjacRb+nW2MbFc98bpJv/GleiXTrY24LAshG13wG993D3v+Jpr7YdPxxd2aSmPP2J8IiYIkqTux3Y8Yeb6YtyDkAAAAASUVORK5CYII=') 3 31, crosshair";
//background-image:url(/content/img/drill.png);
}
unregisterForDrawing(editor) {
this._unblockEvents();
dom.removeClass(this.map.domElement, this.options.drawingCSSClass);
this.map.domElement.style.cursor = this.defaultMapCursor;
editor = editor || this._drawingEditor;
if (!editor) return;
//this.map.off('mousemove touchmove', editor.onDrawingMouseMove, editor);
this.map.off('mousedown', this._onMousedown);
this.map.off('clicked', this._onMouseup);
if (editor !== this._drawingEditor) return;
delete this._drawingEditor;
//if (editor._drawing) {
// editor.cancelDrawing();
//}
}
_blockEvents() {
// Hack: force map not to listen to other layers events while drawing.
//if (!this._oldTargets) {
//this._oldTargets = this.map._events;
//this.map._events = {};
//}
if (!this._oldClickTargets) {
this._oldClickTargets = this.map._events.clicked;
this.map._events.clicked = [];
}
if (this.map.picking) {
this.map.picking.disable();
}
}
_unblockEvents() {
//if (this._oldTargets) {
// // Reset, but keep targets created while drawing.
// this.map._events = util.extend(this.map._events, this._oldTargets);
// delete this._oldTargets;
//}
if (this._oldClickTargets) {
// Reset, but keep targets created while drawing.
this.map._events.clicked = this.map._events.clicked.concat(this._oldClickTargets);
delete this._oldClickTargets;
}
if (this.map.picking) {
this.map.picking.enable();
}
}
_onMousedown(e) {
//var canvasOffset = $(this.domElement).offset();
//var xClickedOnCanvas = e.clientX - canvasOffset.left;
//var yClickedonCanvas = e.clientY - canvasOffset.top;
//var event = { x: xClickedOnCanvas, y: yClickedonCanvas };
this.mapTool._mouseDown = e;
this.mapTool._drawingEditor.onDrawingMouseDown(e);
}
_onMouseup(e) {
if (this.mapTool._mouseDown) {
//var originPoint = new Point(this.mapTool._mouseDown.clientX, this.mapTool._mouseDown.clientY);
//var endPoint = new Point(e.clientX, e.clientY);
//var distance = endPoint.distanceTo(originPoint);
//if (Math.abs(distance) < 9 * (window.devicePixelRatio || 1)) this.mapTool._drawingEditor.onDrawingClick(e);
//else this._drawingEditor.onDrawingMouseUp(e);
this.mapTool._drawingEditor.onDrawingClick(this.mapTool._mouseDown);
}
this.mapTool._mouseDown = null;
}
}