From 8d81dfca4997d003a68d9895de4f917afe697135 Mon Sep 17 00:00:00 2001 From: Stephen Davies Date: Thu, 14 Sep 2023 16:45:35 +1000 Subject: [PATCH 01/53] Remove broken link --- .../controlling-in-an-iframe-or-popup.md | 2 - yarn.lock | 90 ++++++------------- 2 files changed, 26 insertions(+), 66 deletions(-) diff --git a/doc/deploying/controlling-in-an-iframe-or-popup.md b/doc/deploying/controlling-in-an-iframe-or-popup.md index 2d27a916832..337fb3fa1ae 100644 --- a/doc/deploying/controlling-in-an-iframe-or-popup.md +++ b/doc/deploying/controlling-in-an-iframe-or-popup.md @@ -1,7 +1,5 @@ TerriaJS can be configured to accept messages posted to it by its parent window. This is useful when embedding a TerriaJS app in an iframe and when the parent wants to send more data to the embedded app than can be reasonably included in a URL. -Click [here](http://terriajs.github.io/embedded-natmap/) to see a demo, which also sizes the iframe to fill the available space. - First, the TerriaJS app must include a line like this: ```js diff --git a/yarn.lock b/yarn.lock index 6d398c7b81b..c00c3ba2ba8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17,14 +17,14 @@ dependencies: "@babel/highlight" "^7.10.4" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.16.7", "@babel/code-frame@^7.22.5", "@babel/code-frame@^7.8.3": +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.22.5", "@babel/code-frame@^7.8.3": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.5.tgz#234d98e1551960604f1246e6475891a570ad5658" integrity sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ== dependencies: "@babel/highlight" "^7.22.5" -"@babel/compat-data@^7.16.4", "@babel/compat-data@^7.20.5", "@babel/compat-data@^7.22.5", "@babel/compat-data@^7.22.6", "@babel/compat-data@^7.22.9": +"@babel/compat-data@^7.20.5", "@babel/compat-data@^7.22.5", "@babel/compat-data@^7.22.6", "@babel/compat-data@^7.22.9": version "7.22.9" resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.22.9.tgz#71cdb00a1ce3a329ce4cbec3a44f9fef35669730" integrity sha512-5UamI7xkUcJ3i9qVDS+KFDEK8/7oJ55/sJMB1Ge7IEapr7KfdfV/HErR+koZwOfd+SgtFKOKRhRakdg++DcJpQ== @@ -59,7 +59,7 @@ eslint-visitor-keys "^2.1.0" semver "^6.3.0" -"@babel/generator@^7.16.7", "@babel/generator@^7.22.7", "@babel/generator@^7.22.9", "@babel/generator@^7.4.0": +"@babel/generator@^7.22.7", "@babel/generator@^7.22.9", "@babel/generator@^7.4.0": version "7.22.9" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.22.9.tgz#572ecfa7a31002fa1de2a9d91621fd895da8493d" integrity sha512-KtLMbmicyuK2Ak/FTCJVbDnkN1SlT8/kceFTiuDiiRUUSMnHMidxSCdG4ndkTOHHpoomWe/4xkvHkEOncwjYIw== @@ -69,7 +69,7 @@ "@jridgewell/trace-mapping" "^0.3.17" jsesc "^2.5.1" -"@babel/helper-annotate-as-pure@^7.15.4", "@babel/helper-annotate-as-pure@^7.16.0", "@babel/helper-annotate-as-pure@^7.16.7", "@babel/helper-annotate-as-pure@^7.22.5": +"@babel/helper-annotate-as-pure@^7.15.4", "@babel/helper-annotate-as-pure@^7.16.0", "@babel/helper-annotate-as-pure@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz#e7f06737b197d580a01edf75d97e2c8be99d3882" integrity sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg== @@ -83,7 +83,7 @@ dependencies: "@babel/types" "^7.22.5" -"@babel/helper-compilation-targets@^7.16.7", "@babel/helper-compilation-targets@^7.20.7", "@babel/helper-compilation-targets@^7.22.5", "@babel/helper-compilation-targets@^7.22.6", "@babel/helper-compilation-targets@^7.22.9": +"@babel/helper-compilation-targets@^7.20.7", "@babel/helper-compilation-targets@^7.22.5", "@babel/helper-compilation-targets@^7.22.6", "@babel/helper-compilation-targets@^7.22.9": version "7.22.9" resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.9.tgz#f9d0a7aaaa7cd32a3f31c9316a69f5a9bcacb892" integrity sha512-7qYrNM6HjpnPHJbopxmb8hSPoZ0gsX8IvUS32JGVoy+pU9e5N0nLr1VjJoR6kA4d9dmGLxNYOjeB8sUDal2WMw== @@ -129,12 +129,12 @@ lodash.debounce "^4.0.8" resolve "^1.14.2" -"@babel/helper-environment-visitor@^7.16.7", "@babel/helper-environment-visitor@^7.22.5": +"@babel/helper-environment-visitor@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz#f06dd41b7c1f44e1f8da6c4055b41ab3a09a7e98" integrity sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q== -"@babel/helper-function-name@^7.16.7", "@babel/helper-function-name@^7.22.5": +"@babel/helper-function-name@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz#ede300828905bb15e582c037162f99d5183af1be" integrity sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ== @@ -142,14 +142,7 @@ "@babel/template" "^7.22.5" "@babel/types" "^7.22.5" -"@babel/helper-get-function-arity@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz#ea08ac753117a669f1508ba06ebcc49156387419" - integrity sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw== - dependencies: - "@babel/types" "^7.16.7" - -"@babel/helper-hoist-variables@^7.16.7", "@babel/helper-hoist-variables@^7.22.5": +"@babel/helper-hoist-variables@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz#c01a007dac05c085914e8fb652b339db50d823bb" integrity sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw== @@ -163,14 +156,14 @@ dependencies: "@babel/types" "^7.22.5" -"@babel/helper-module-imports@^7.0.0", "@babel/helper-module-imports@^7.0.0-beta.49", "@babel/helper-module-imports@^7.15.4", "@babel/helper-module-imports@^7.16.0", "@babel/helper-module-imports@^7.16.7", "@babel/helper-module-imports@^7.22.5": +"@babel/helper-module-imports@^7.0.0", "@babel/helper-module-imports@^7.0.0-beta.49", "@babel/helper-module-imports@^7.15.4", "@babel/helper-module-imports@^7.16.0", "@babel/helper-module-imports@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.22.5.tgz#1a8f4c9f4027d23f520bd76b364d44434a72660c" integrity sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg== dependencies: "@babel/types" "^7.22.5" -"@babel/helper-module-transforms@^7.16.7", "@babel/helper-module-transforms@^7.22.5", "@babel/helper-module-transforms@^7.22.9": +"@babel/helper-module-transforms@^7.22.5", "@babel/helper-module-transforms@^7.22.9": version "7.22.9" resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.22.9.tgz#92dfcb1fbbb2bc62529024f72d942a8c97142129" integrity sha512-t+WA2Xn5K+rTeGtC8jCsdAH52bjggG5TKRuRrAGNM/mjIbO4GxvlLMFOEz9wXY5I2XQ60PMFsAG2WIcG82dQMQ== @@ -211,7 +204,7 @@ "@babel/helper-member-expression-to-functions" "^7.22.5" "@babel/helper-optimise-call-expression" "^7.22.5" -"@babel/helper-simple-access@^7.16.7", "@babel/helper-simple-access@^7.22.5": +"@babel/helper-simple-access@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz#4938357dc7d782b80ed6dbb03a0fba3d22b1d5de" integrity sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w== @@ -225,7 +218,7 @@ dependencies: "@babel/types" "^7.22.5" -"@babel/helper-split-export-declaration@^7.16.7", "@babel/helper-split-export-declaration@^7.22.6": +"@babel/helper-split-export-declaration@^7.22.6": version "7.22.6" resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz#322c61b7310c0997fe4c323955667f18fcefb91c" integrity sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g== @@ -237,12 +230,12 @@ resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz#533f36457a25814cf1df6488523ad547d784a99f" integrity sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw== -"@babel/helper-validator-identifier@^7.16.7", "@babel/helper-validator-identifier@^7.22.5": +"@babel/helper-validator-identifier@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz#9544ef6a33999343c8740fa51350f30eeaaaf193" integrity sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ== -"@babel/helper-validator-option@^7.16.7", "@babel/helper-validator-option@^7.22.5": +"@babel/helper-validator-option@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.22.5.tgz#de52000a15a177413c8234fa3a8af4ee8102d0ac" integrity sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw== @@ -256,7 +249,7 @@ "@babel/template" "^7.22.5" "@babel/types" "^7.22.5" -"@babel/helpers@^7.16.7", "@babel/helpers@^7.22.6": +"@babel/helpers@^7.22.6": version "7.22.6" resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.22.6.tgz#8e61d3395a4f0c5a8060f309fb008200969b5ecd" integrity sha512-YjDs6y/fVOYFV8hAf1rxd1QvR9wJe1pDBZ2AREKq/SDayfPzgk0PBnVuTCE5X1acEpMMNOVUqoe+OwiZGJ+OaA== @@ -265,7 +258,7 @@ "@babel/traverse" "^7.22.6" "@babel/types" "^7.22.5" -"@babel/highlight@^7.10.4", "@babel/highlight@^7.16.7", "@babel/highlight@^7.22.5": +"@babel/highlight@^7.10.4", "@babel/highlight@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.22.5.tgz#aa6c05c5407a67ebce408162b7ede789b4d22031" integrity sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw== @@ -274,7 +267,7 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.16.7", "@babel/parser@^7.22.5", "@babel/parser@^7.22.7", "@babel/parser@^7.4.3": +"@babel/parser@^7.22.5", "@babel/parser@^7.22.7", "@babel/parser@^7.4.3": version "7.22.7" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.22.7.tgz#df8cf085ce92ddbdbf668a7f186ce848c9036cae" integrity sha512-7NF8pOkHP5o2vpmGgNGcfAeCvOYhGLyA3Z4eBQkT1RJlWu47n63bCs93QfJ2hIAFCil7L5P2IWhs1oToVgrL0Q== @@ -1049,7 +1042,7 @@ dependencies: regenerator-runtime "^0.13.4" -"@babel/template@^7.16.7", "@babel/template@^7.22.5", "@babel/template@^7.4.0": +"@babel/template@^7.22.5", "@babel/template@^7.4.0": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.5.tgz#0c8c4d944509875849bd0344ff0050756eefc6ec" integrity sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw== @@ -1058,7 +1051,7 @@ "@babel/parser" "^7.22.5" "@babel/types" "^7.22.5" -"@babel/traverse@^7.16.7", "@babel/traverse@^7.22.6", "@babel/traverse@^7.22.8", "@babel/traverse@^7.4.3", "@babel/traverse@^7.4.5": +"@babel/traverse@^7.22.6", "@babel/traverse@^7.22.8", "@babel/traverse@^7.4.3", "@babel/traverse@^7.4.5": version "7.22.8" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.22.8.tgz#4d4451d31bc34efeae01eac222b514a77aa4000e" integrity sha512-y6LPR+wpM2I3qJrsheCTwhIinzkETbplIgPBbwvqPKc+uljeA5gP+3nP8irdYt1mjQaDnlIcG+dw8OjAco4GXw== @@ -1074,7 +1067,7 @@ debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0-beta.49", "@babel/types@^7.16.7", "@babel/types@^7.22.5", "@babel/types@^7.4.0", "@babel/types@^7.4.4": +"@babel/types@^7.0.0-beta.49", "@babel/types@^7.22.5", "@babel/types@^7.4.0", "@babel/types@^7.4.4": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.22.5.tgz#cd93eeaab025880a3a47ec881f4b096a5b786fbe" integrity sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA== @@ -3182,7 +3175,7 @@ browserify-zlib@^0.2.0: dependencies: pako "~1.0.5" -browserslist@^4.17.5, browserslist@^4.21.9: +browserslist@^4.21.9: version "4.21.9" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.9.tgz#e11bdd3c313d7e2a9e87e8b4b0c7872b13897635" integrity sha512-M0MFoZzbUrRU4KNfCrDLnvyE7gub+peetoTid3TBIqtunaDJyXlwhakT+/VkvSXcfIzFfK/nkCs4nmyTmxdNSg== @@ -3381,7 +3374,7 @@ camelize@^1.0.0: resolved "https://registry.yarnpkg.com/camelize/-/camelize-1.0.0.tgz#164a5483e630fa4321e5af07020e531831b2609b" integrity sha1-FkpUg+Yw+kMh5a8HAg5TGDGyYJs= -caniuse-lite@^1.0.30001286, caniuse-lite@^1.0.30001503: +caniuse-lite@^1.0.30001503: version "1.0.30001517" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001517.tgz#90fabae294215c3495807eb24fc809e11dc2f0a8" integrity sha512-Vdhm5S11DaFVLlyiKu4hiUTkpZu+y1KA/rZZqVQfOD5YdDT/eQKlkt7NaE0WGOFgX32diqt9MiP9CAiFeRklaA== @@ -4794,7 +4787,7 @@ ee-first@1.1.1: resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= -electron-to-chromium@^1.4.17, electron-to-chromium@^1.4.431: +electron-to-chromium@^1.4.431: version "1.4.477" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.477.tgz#05669aa6f161ee9076a6805457e9bd9fe6d0dfd1" integrity sha512-shUVy6Eawp33dFBFIoYbIwLHrX0IZ857AlH9ug2o4rvbWmpaCUdBpQ5Zw39HRrfzAFm4APJE9V+E2A/WB0YqJw== @@ -8659,7 +8652,7 @@ node-notifier@^8.0.2: uuid "^8.3.0" which "^2.0.2" -node-releases@^2.0.1, node-releases@^2.0.12: +node-releases@^2.0.12: version "2.0.13" resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.13.tgz#d5ed1627c23e3461e819b02e57b75e4899b1c81d" integrity sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ== @@ -10215,13 +10208,6 @@ regenerate-unicode-properties@^10.1.0: dependencies: regenerate "^1.4.2" -regenerate-unicode-properties@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-9.0.0.tgz#54d09c7115e1f53dc2314a974b32c1c344efe326" - integrity sha512-3E12UeNSPfjrgwjkR81m5J7Aw/T55Tu7nUyZVQYCKEOs+2dkxEY+DpPtZzO4YruuiPb7NkYLVcyJC4+zCbk5pA== - dependencies: - regenerate "^1.4.2" - regenerate@^1.4.2: version "1.4.2" resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" @@ -10270,18 +10256,6 @@ regexpp@^3.1.0: resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== -regexpu-core@^4.7.1: - version "4.8.0" - resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.8.0.tgz#e5605ba361b67b1718478501327502f4479a98f0" - integrity sha512-1F6bYsoYiz6is+oz70NWur2Vlh9KWtswuRuzJOfeYUrfPX2o8n74AnUVaOGDbUqVGO9fNHu48/pjJO4sNVwsOg== - dependencies: - regenerate "^1.4.2" - regenerate-unicode-properties "^9.0.0" - regjsgen "^0.5.2" - regjsparser "^0.7.0" - unicode-match-property-ecmascript "^2.0.0" - unicode-match-property-value-ecmascript "^2.0.0" - regexpu-core@^5.3.1: version "5.3.2" resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-5.3.2.tgz#11a2b06884f3527aec3e93dbbf4a3b958a95546b" @@ -10294,18 +10268,6 @@ regexpu-core@^5.3.1: unicode-match-property-ecmascript "^2.0.0" unicode-match-property-value-ecmascript "^2.1.0" -regjsgen@^0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.5.2.tgz#92ff295fb1deecbf6ecdab2543d207e91aa33733" - integrity sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A== - -regjsparser@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.7.0.tgz#a6b667b54c885e18b52554cb4960ef71187e9968" - integrity sha512-A4pcaORqmNMDVwUjWoTzuhwMGpP+NykpfqAsEgI1FSH/EzC7lrN5TMd+kN8YCovX+jMpu8eaqXgXPCa0g8FQNQ== - dependencies: - jsesc "~0.5.0" - regjsparser@^0.9.1: version "0.9.1" resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.9.1.tgz#272d05aa10c7c1f67095b1ff0addae8442fc5709" @@ -11129,7 +11091,7 @@ source-map@^0.4.2: dependencies: amdefine ">=0.0.4" -source-map@^0.5.0, source-map@^0.5.6, source-map@^0.5.7: +source-map@^0.5.6, source-map@^0.5.7: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= @@ -12175,7 +12137,7 @@ unicode-match-property-ecmascript@^2.0.0: unicode-canonical-property-names-ecmascript "^2.0.0" unicode-property-aliases-ecmascript "^2.0.0" -unicode-match-property-value-ecmascript@^2.0.0, unicode-match-property-value-ecmascript@^2.1.0: +unicode-match-property-value-ecmascript@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.1.0.tgz#cb5fffdcd16a05124f5a4b0bf7c3770208acbbe0" integrity sha512-qxkjQt6qjg/mYscYMC0XKRn3Rh0wFPlfxB0xkt9CfyTvpX1Ra0+rAmdX2QyAobptSEvuy4RtpPRui6XkV+8wjA== From d5e9dd7789502a412ba74127b7f89b551e433664 Mon Sep 17 00:00:00 2001 From: Yusuke Kiuchi <4221178-yusuke.kiuchi@users.noreply.gitlab.com> Date: Fri, 14 Oct 2022 19:30:44 +0900 Subject: [PATCH 02/53] I18nify TableStylingWorkflow and its related components --- CHANGES.md | 1 + lib/ModelMixins/TableMixin.ts | 13 +- lib/Models/Workflows/TableStylingWorkflow.ts | 861 ++++++++++++++---- .../SelectableDimensions/Checkbox.tsx | 6 +- lib/ReactViews/SelectableDimensions/Color.tsx | 6 +- .../ColorSchemeOptionRenderer.tsx | 16 +- lib/ReactViews/SelectableDimensions/Group.tsx | 6 +- .../SelectableDimensions/Select.tsx | 3 +- wwwroot/languages/en/translation.json | 516 ++++++++++- wwwroot/languages/ja/translation.json | 542 ++++++++++- 10 files changed, 1754 insertions(+), 216 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 550acf4c56e..8deb2b9c9e6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,7 @@ #### next release (8.3.6) - Fixed a bug where incorrect "Remove all" icon is shown when the trait `displayGroup` of some group types (e.g.`wms-group`) is set to `true` but the members have not been populated yet. +- Allow translation of TableStylingWorkflow. - [The next improvement] #### 8.3.5 - 2023-09-26 diff --git a/lib/ModelMixins/TableMixin.ts b/lib/ModelMixins/TableMixin.ts index 08ad30f90ec..2f44c562e12 100644 --- a/lib/ModelMixins/TableMixin.ts +++ b/lib/ModelMixins/TableMixin.ts @@ -453,7 +453,7 @@ function TableMixin>(Base: T) { ...super.viewingControls, { id: TableStylingWorkflow.type, - name: "Edit Style", + name: i18next.t("models.tableData.editStyle"), onClick: action((viewState) => SelectableDimensionWorkflow.runWorkflow( viewState, @@ -493,7 +493,7 @@ function TableMixin>(Base: T) { return { type: "select", id: "activeStyle", - name: "Display Variable", + name: i18next.t("models.tableData.activeStyle"), options: this.tableStyles .filter((style) => !style.hidden || this.activeStyle === style.id) .map((style) => { @@ -531,7 +531,7 @@ function TableMixin>(Base: T) { return { id: "regionMapping", - name: "Region Mapping", + name: i18next.t("models.tableData.regionMapping"), options: allRegionProviders.map((regionProvider) => { return { name: regionProvider.description, @@ -577,7 +577,7 @@ function TableMixin>(Base: T) { return { id: "regionColumn", - name: "Region Column", + name: i18next.t("models.tableData.regionColumn"), options: this.tableColumns.map((col) => { return { name: col.name, @@ -596,7 +596,8 @@ function TableMixin>(Base: T) { @computed get regionMappingDimensions(): SelectableDimensionGroup { return { - id: "Manual Region Mapping", + id: "manual-region-mapping", + name: i18next.t("models.tableData.manualRegionMapping"), type: "group", selectableDimensions: filterOutUndefined([ this.regionColumnDimensions, @@ -718,7 +719,7 @@ function TableMixin>(Base: T) { @computed get legendButton() { return this.activeTableStyle.isCustom ? { - title: "Custom", + title: i18next.t("models.tableData.custom"), onClick: action(() => { SelectableDimensionWorkflow.runWorkflow( this.terria, diff --git a/lib/Models/Workflows/TableStylingWorkflow.ts b/lib/Models/Workflows/TableStylingWorkflow.ts index 2eb67c9a5ef..4eeaf228f68 100644 --- a/lib/Models/Workflows/TableStylingWorkflow.ts +++ b/lib/Models/Workflows/TableStylingWorkflow.ts @@ -55,6 +55,7 @@ import ViewingControls from "../ViewingControls"; import SelectableDimensionWorkflow, { SelectableDimensionWorkflowGroup } from "../Workflows/SelectableDimensionWorkflow"; +import i18next from "i18next"; /** The ColorSchemeType is used to change which SelectableDimensions are shown. * It is basically the "mode" of the TableStylingWorkflow @@ -143,16 +144,16 @@ export default class TableStylingWorkflow return { options: filterOutUndefined([ { - text: `${ - this.showAdvancedOptions ? "Hide" : "Show" - } advanced options`, + text: this.showAdvancedOptions + ? i18next.t("models.tableStyling.hideAdvancedOptions") + : i18next.t("models.tableStyling.showAdvancedOptions"), onSelect: action(() => { this.showAdvancedOptions = !this.showAdvancedOptions; }) }, this.showAdvancedOptions ? { - text: "Copy user stratum to clipboard", + text: i18next.t("models.tableStyling.copyUserStratum"), onSelect: () => { const stratum = JSON.stringify( this.item.strata.get(CommonStrata.user) @@ -177,7 +178,7 @@ export default class TableStylingWorkflow } get name() { - return `Style`; + return i18next.t("models.tableStyling.name"); } get icon() { @@ -186,7 +187,7 @@ export default class TableStylingWorkflow get footer() { return { - buttonText: "Reset to default style", + buttonText: i18next.t("models.tableStyling.reset"), /** Delete all user strata values for TableColumnTraits and TableStyleTraits for the current activeStyle */ onClick: action(() => { this.getTableColumnTraits(CommonStrata.user)?.strata.delete( @@ -472,12 +473,17 @@ export default class TableStylingWorkflow return { type: "group", - id: "Data", + id: "data", + + name: i18next.t("models.tableStyling.data.name"), selectableDimensions: filterOutUndefined([ { type: "select", id: "dataset", - name: "Dataset", + + name: i18next.t( + "models.tableStyling.data.selectableDimensions.dataset.name" + ), selectedId: this.item.uniqueId, // Find all workbench items which have TableStylingWorkflow @@ -513,7 +519,10 @@ export default class TableStylingWorkflow { type: "select", id: "table-style", - name: "Style", + + name: i18next.t( + "models.tableStyling.data.selectableDimensions.tableStyle.dataset" + ), selectedId: this.tableStyle.id, options: this.item.tableStyles.map((style) => ({ id: style.id, @@ -532,19 +541,62 @@ export default class TableStylingWorkflow { type: "select", id: "table-style-type", - name: "Symbology", + + name: i18next.t( + "models.tableStyling.data.selectableDimensions.tableStyleType.name" + ), selectedId: this.styleType, options: filterOutUndefined([ - { id: "fill", name: "Fill color" }, + { + id: "fill", + + name: i18next.t( + "models.tableStyling.data.selectableDimensions.tableStyleType.options.fill.name" + ) + }, showPointSize - ? { id: "point-size", name: "Point size" } + ? { + id: "point-size", + + name: i18next.t( + "models.tableStyling.data.selectableDimensions.tableStyleType.options.pointSize.name" + ) + } : undefined, showPointStyles - ? { id: "point", name: "Point/Marker style" } + ? { + id: "point", + + name: i18next.t( + "models.tableStyling.data.selectableDimensions.tableStyleType.options.point.name" + ) + } + : undefined, + { + id: "outline", + + name: i18next.t( + "models.tableStyling.data.selectableDimensions.tableStyleType.options.outline.name" + ) + }, + showLabelStyles + ? { + id: "label", + + name: i18next.t( + "models.tableStyling.data.selectableDimensions.tableStyleType.options.label.name" + ) + } : undefined, - { id: "outline", name: "Outline color" }, - showLabelStyles ? { id: "label", name: "Label style" } : undefined, - showTrailStyles ? { id: "trail", name: "Trail style" } : undefined + showTrailStyles + ? { + id: "trail", + + name: i18next.t( + "models.tableStyling.data.selectableDimensions.tableStyleType.options.trail.name" + ) + } + : undefined ]), setDimensionValue: (stratumId, value) => { if ( @@ -585,7 +637,9 @@ export default class TableStylingWorkflow @computed get colorSchemeSelectableDim(): SelectableDimensionWorkflowGroup { return { type: "group", - id: "Fill Color", + id: "fill", + + name: i18next.t("models.tableStyling.fill.name"), selectableDimensions: filterOutUndefined([ // Show "Variable" selector to pick colorColumn if tableStyle ID is different from colorColumn ID // OR if we are in advanced mode @@ -593,8 +647,11 @@ export default class TableStylingWorkflow this.showAdvancedOptions ? { type: "select", - id: "table-color-col", - name: "Variable", + id: "table-color-column", + + name: i18next.t( + "models.tableStyling.fill.selectableDimensions.tableColorColumn.name" + ), selectedId: this.tableStyle.colorColumn?.name, options: this.item.tableColumns.map((col) => ({ id: col.name, @@ -631,7 +688,10 @@ export default class TableStylingWorkflow ? { type: "select", id: "data-type", - name: "Column type (advanced)", + + name: i18next.t( + "models.tableStyling.fill.selectableDimensions.dataType.name" + ), options: Object.keys(TableColumnType) .filter((type) => type.length > 1) .map((colType) => ({ id: colType })), @@ -651,35 +711,80 @@ export default class TableStylingWorkflow this.tableStyle.colorColumn ? { type: "select", - id: "Type", - name: "Type", - undefinedLabel: "Please specify", + id: "type", + + name: i18next.t( + "models.tableStyling.fill.selectableDimensions.type.name" + ), + + undefinedLabel: i18next.t( + "models.tableStyling.fill.selectableDimensions.type.undefinedLabel" + ), options: filterOutUndefined([ - { id: "no-style", name: "No style" }, + { + id: "no-style", + + name: i18next.t( + "models.tableStyling.fill.selectableDimensions.type.options.noStyle.name" + ) + }, ...(this.tableStyle.colorColumn.type === TableColumnType.scalar ? [ { id: "sequential-continuous", - name: "Sequential (continuous)" + + name: i18next.t( + "models.tableStyling.fill.selectableDimensions.type.options.sequentialContinuous.name" + ) }, { id: "sequential-discrete", - name: "Sequential (discrete)" + + name: i18next.t( + "models.tableStyling.fill.selectableDimensions.type.options.sequentialDiscrete.name" + ) }, { id: "diverging-continuous", - name: "Divergent (continuous)" + + name: i18next.t( + "models.tableStyling.fill.selectableDimensions.type.options.divergingContinuous.name" + ) }, - { id: "diverging-discrete", name: "Divergent (discrete)" } + { + id: "diverging-discrete", + + name: i18next.t( + "models.tableStyling.fill.selectableDimensions.type.options.divergingDiscrete.name" + ) + } ] : []), - { id: "qualitative", name: "Qualitative" }, + { + id: "qualitative", + + name: i18next.t( + "models.tableStyling.fill.selectableDimensions.type.options.qualitative.name" + ) + }, // Add options for "custom" color palettes if we are in "custom-qualitative" or "custom-discrete" mode this.colorSchemeType === "custom-qualitative" - ? { id: "custom-qualitative", name: "Custom (qualitative)" } + ? { + id: "custom-qualitative", + + name: i18next.t( + "models.tableStyling.fill.selectableDimensions.type.options.customQualitative.name" + ) + } : undefined, this.colorSchemeType === "custom-discrete" - ? { id: "custom-discrete", name: "Custom (discrete)" } + ? { + id: "custom-discrete", + + name: i18next.t( + "models.tableStyling.fill.selectableDimensions.type.options.customDiscrete.name" + ) + } : undefined ]), selectedId: this.colorSchemeType, @@ -691,8 +796,11 @@ export default class TableStylingWorkflow { type: "select", - id: "Scheme", - name: "Scheme", + id: "scheme", + + name: i18next.t( + "models.tableStyling.fill.selectableDimensions.scheme.name" + ), selectedId: this.tableStyle.colorTraits.colorPalette ?? @@ -732,8 +840,11 @@ export default class TableStylingWorkflow this.colorSchemeType === "diverging-discrete" ? { type: "numeric", - id: "numberOfBins", - name: "Number of Bins", + id: "number-of-bins", + + name: i18next.t( + "models.tableStyling.fill.selectableDimensions.numberOfBins.name" + ), allowUndefined: true, min: // Sequential and diverging color scales must have at least 3 bins @@ -772,7 +883,8 @@ export default class TableStylingWorkflow return { type: "numeric", id: "min", - name: "Min", + + name: i18next.t("models.tableStyling.min.name"), max: this.tableStyle.tableColorMap.maximumValue, value: this.tableStyle.tableColorMap.minimumValue, setDimensionValue: (stratumId, value) => { @@ -799,14 +911,19 @@ export default class TableStylingWorkflow @computed get displayRangeDim(): SelectableDimensionWorkflowGroup { return { type: "group", - id: "Display range", + id: "display-range", + + name: i18next.t("models.tableStyling.displayRange.name"), isOpen: false, selectableDimensions: filterOutUndefined([ this.minimumValueSelectableDim, { type: "numeric", id: "max", - name: "Max", + + name: i18next.t( + "models.tableStyling.displayRange.selectableDimensions.max.name" + ), min: this.tableStyle.tableColorMap.minimumValue, value: this.tableStyle.tableColorMap.maximumValue, setDimensionValue: (stratumId, value) => { @@ -827,7 +944,9 @@ export default class TableStylingWorkflow @computed get binColorDims(): SelectableDimensionWorkflowGroup { return { type: "group", - id: "Bins", + id: "bins", + + name: i18next.t("models.tableStyling.bins.name"), isOpen: false, selectableDimensions: [ ...this.tableStyle.tableColorMap.binMaximums @@ -838,11 +957,16 @@ export default class TableStylingWorkflow id: `bin-${idx}-start`, name: getColorPreview( this.tableStyle.tableColorMap.binColors[idx] ?? "#aaa", - `${ - idx === 0 - ? this.minimumValueSelectableDim.value - : this.tableStyle.tableColorMap.binMaximums[idx - 1] - } to ${bin}` + i18next.t( + "models.tableStyling.bins.selectableDimensions.start.name", + { + value1: + idx === 0 + ? this.minimumValueSelectableDim.value + : this.tableStyle.tableColorMap.binMaximums[idx - 1], + value2: bin + } + ) ), isOpen: this.openBinIndex.get("fill") === idx, onToggle: (open) => { @@ -854,8 +978,11 @@ export default class TableStylingWorkflow selectableDimensions: [ { type: "color", - id: `bin-${idx}-col`, - name: `Color`, + id: `bin-${idx}-color`, + + name: i18next.t( + "models.tableStyling.bins.selectableDimensions.start.selectableDimensions.color.name" + ), value: this.tableStyle.tableColorMap.binColors[idx], setDimensionValue: (stratumId, value) => { const binColors = [ @@ -875,7 +1002,10 @@ export default class TableStylingWorkflow : { type: "numeric", id: `bin-${idx}-start`, - name: "Start", + + name: i18next.t( + "models.tableStyling.bins.selectableDimensions.start.selectableDimensions.start.name" + ), value: this.tableStyle.tableColorMap.binMaximums[idx - 1], setDimensionValue: (stratumId, value) => { @@ -889,7 +1019,10 @@ export default class TableStylingWorkflow { type: "numeric", id: `bin-${idx}-stop`, - name: "Stop", + + name: i18next.t( + "models.tableStyling.bins.selectableDimensions.start.selectableDimensions.stop.name" + ), value: bin, setDimensionValue: (stratumId, value) => { const binMaximums = [ @@ -911,7 +1044,9 @@ export default class TableStylingWorkflow @computed get enumColorDims(): SelectableDimensionWorkflowGroup { return { type: "group", - id: "Colors", + id: "colors", + + name: i18next.t("models.tableStyling.colors.name"), isOpen: false, selectableDimensions: filterOutUndefined([ ...this.tableStyle.tableColorMap.enumColors.map((enumCol, idx) => { @@ -930,8 +1065,11 @@ export default class TableStylingWorkflow selectableDimensions: [ { type: "color", - id: `enum-${idx}-col`, - name: `Color`, + id: `enum-${idx}-color`, + + name: i18next.t( + "models.tableStyling.colors.selectableDimensions.color.name" + ), value: enumCol.color, setDimensionValue: (stratumId, value) => { this.colorSchemeType = "custom-qualitative"; @@ -941,7 +1079,10 @@ export default class TableStylingWorkflow { type: "select", id: `enum-${idx}-value`, - name: "Value", + + name: i18next.t( + "models.tableStyling.colors.selectableDimensions.value.name" + ), selectedId: enumCol.value, // Find unique column values which don't already have an enumCol // We prepend the current enumCol.value @@ -964,7 +1105,10 @@ export default class TableStylingWorkflow { type: "button", id: `enum-${idx}-remove`, - value: "Remove", + + value: i18next.t( + "models.tableStyling.colors.selectableDimensions.remove.value" + ), setDimensionValue: (stratumId) => { this.colorSchemeType = "custom-qualitative"; // Remove element by clearing `value` @@ -984,7 +1128,10 @@ export default class TableStylingWorkflow ? { type: "button", id: `enum-add`, - value: "Add Color", + + value: i18next.t( + "models.tableStyling.colors.selectableDimensions.add.value" + ), setDimensionValue: (stratumId) => { this.colorSchemeType = "custom-qualitative"; const firstValue = @@ -1029,8 +1176,9 @@ export default class TableStylingWorkflow @computed get nullColorDimension(): SelectableDimensionColor { return { type: "color", - id: `null-col`, - name: `Default color`, + id: `null-color`, + + name: i18next.t("models.tableStyling.nullColor.name"), value: this.tableStyle.colorTraits.nullColor, allowUndefined: true, setDimensionValue: (stratumId, value) => { @@ -1046,8 +1194,9 @@ export default class TableStylingWorkflow @computed get outlierColorDimension(): SelectableDimensionColor { return { type: "color", - id: `outlier-col`, - name: `Outlier color`, + id: `outlier-color`, + + name: i18next.t("models.tableStyling.outlierColor.name"), allowUndefined: true, value: this.tableStyle.colorTraits.outlierColor ?? @@ -1070,15 +1219,20 @@ export default class TableStylingWorkflow @computed get additionalColorDimensions(): SelectableDimensionGroup { return { type: "group", - id: "Additional colors", + id: "additional-colors", + + name: i18next.t("models.tableStyling.additionalColors.name"), // Open group by default is no activeStyle is selected isOpen: !this.item.activeStyle || this.colorSchemeType === "no-style", selectableDimensions: filterOutUndefined([ this.tableStyle.colorColumn?.type === TableColumnType.region ? { type: "color", - id: `region-col`, - name: `Region color`, + id: `region-color`, + + name: i18next.t( + "models.tableStyling.additionalColors.selectableDimensions.regionColor.name" + ), value: this.tableStyle.colorTraits.regionColor, allowUndefined: true, setDimensionValue: (stratumId, value) => { @@ -1091,8 +1245,11 @@ export default class TableStylingWorkflow } : { type: "color", - id: `null-col`, - name: `Default color`, + id: `null-color`, + + name: i18next.t( + "models.tableStyling.additionalColors.selectableDimensions.nullColor.name" + ), value: this.tableStyle.colorTraits.nullColor, allowUndefined: true, setDimensionValue: (stratumId, value) => { @@ -1106,8 +1263,11 @@ export default class TableStylingWorkflow this.tableStyle.colorColumn?.type === TableColumnType.scalar ? { type: "color", - id: `outlier-col`, - name: `Outlier color`, + id: `outlier-color`, + + name: i18next.t( + "models.tableStyling.additionalColors.selectableDimensions.outlierColor.name" + ), allowUndefined: true, value: this.tableStyle.colorTraits.outlierColor ?? @@ -1128,13 +1288,18 @@ export default class TableStylingWorkflow @computed get pointSizeDimensions(): SelectableDimensionGroup { return { type: "group", - id: "Point size", + id: "point-size", + + name: i18next.t("models.tableStyling.pointSize.name"), isOpen: true, selectableDimensions: [ { type: "select", id: `point-size-column`, - name: `Variable`, + + name: i18next.t( + "models.tableStyling.pointSize.selectableDimensions.pointSizeColumn.name" + ), selectedId: this.tableStyle.pointSizeTraits.pointSizeColumn, options: this.item.tableColumns .filter((col) => col.type === TableColumnType.scalar) @@ -1156,7 +1321,10 @@ export default class TableStylingWorkflow { type: "numeric", id: "point-size-null", - name: "Default size", + + name: i18next.t( + "models.tableStyling.pointSize.selectableDimensions.pointSizeNull.name" + ), min: 0, value: this.tableStyle.pointSizeTraits.nullSize, setDimensionValue: (stratumId, value) => { @@ -1170,7 +1338,10 @@ export default class TableStylingWorkflow { type: "numeric", id: "point-sizes-factor", - name: "Size factor", + + name: i18next.t( + "models.tableStyling.pointSize.selectableDimensions.pointSizesFactor.name" + ), min: 0, value: this.tableStyle.pointSizeTraits.sizeFactor, setDimensionValue: (stratumId, value) => { @@ -1184,7 +1355,10 @@ export default class TableStylingWorkflow { type: "numeric", id: "point-size-offset", - name: "Size offset", + + name: i18next.t( + "models.tableStyling.pointSize.selectableDimensions.pointSizeOffset.name" + ), min: 0, value: this.tableStyle.pointSizeTraits.sizeOffset, setDimensionValue: (stratumId, value) => { @@ -1207,7 +1381,9 @@ export default class TableStylingWorkflow get advancedRegionMappingDimensions(): SelectableDimensionWorkflowGroup { return { type: "group", - id: "Region mapping", + id: "region-mapping", + + name: i18next.t("models.tableStyling.regionMapping.name"), isOpen: false, selectableDimensions: filterOutUndefined([ this.item.regionColumnDimensions, @@ -1228,13 +1404,18 @@ export default class TableStylingWorkflow return [ { type: "group", - id: "Legend", + id: "legend", + + name: i18next.t("models.tableStyling.legend.name"), isOpen: false, selectableDimensions: filterOutUndefined([ { type: "text", id: "legend-title", - name: "Title", + + name: i18next.t( + "models.tableStyling.legend.selectableDimensions.legendTitle.name" + ), value: this.tableStyle.colorTraits.legend.title, setDimensionValue: (stratumId, value) => { this.getTableStyleTraits(stratumId)?.color.legend.setTrait( @@ -1249,7 +1430,10 @@ export default class TableStylingWorkflow ? { type: "numeric", id: "legend-ticks", - name: "Ticks", + + name: i18next.t( + "models.tableStyling.legend.selectableDimensions.legendTicks.name" + ), min: 2, value: this.tableStyle.colorTraits.legendTicks, setDimensionValue: (stratumId, value) => { @@ -1267,7 +1451,10 @@ export default class TableStylingWorkflow ({ type: "text", id: `legend-${idx}-title`, - name: `Item ${idx + 1} Title`, + name: i18next.t( + "models.tableStyling.legend.selectableDimensions.title.name", + { index: idx + 1 } + ), value: legendItem.title, setDimensionValue: (stratumId, value) => { legendItem.setTrait(stratumId, "title", value); @@ -1278,13 +1465,18 @@ export default class TableStylingWorkflow }, { type: "group", - id: "Style options", + id: "style-options", + + name: i18next.t("models.tableStyling.styleOptions.name"), isOpen: false, selectableDimensions: filterOutUndefined([ { type: "text", id: "style-title", - name: "Title", + + name: i18next.t( + "models.tableStyling.styleOptions.selectableDimensions.styleTitle.name" + ), value: this.tableStyle.title, setDimensionValue: (stratumId, value) => { this.getTableStyleTraits(stratumId)?.setTrait( @@ -1296,8 +1488,11 @@ export default class TableStylingWorkflow }, { type: "select", - id: "table-style", - name: "Longitude column", + id: "longitude-column", + + name: i18next.t( + "models.tableStyling.styleOptions.selectableDimensions.longitudeColumn.name" + ), selectedId: this.tableStyle.longitudeColumn?.name, allowUndefined: true, options: this.item.tableColumns.map((col) => ({ @@ -1314,8 +1509,11 @@ export default class TableStylingWorkflow }, { type: "select", - id: "table-style", - name: "Latitude column", + id: "latitude-column", + + name: i18next.t( + "models.tableStyling.styleOptions.selectableDimensions.latitudeColumn.name" + ), selectedId: this.tableStyle.latitudeColumn?.name, allowUndefined: true, options: this.item.tableColumns.map((col) => ({ @@ -1334,13 +1532,18 @@ export default class TableStylingWorkflow }, { type: "group", - id: "Time options", + id: "time-options", + + name: i18next.t("models.tableStyling.timeOptions.name"), isOpen: false, selectableDimensions: filterOutUndefined([ { type: "select", - id: "table-time-col", - name: "Time column", + id: "table-time-column", + + name: i18next.t( + "models.tableStyling.timeOptions.selectableDimensions.tableTimeColumn.name" + ), selectedId: this.tableStyle.timeColumn?.name, allowUndefined: true, options: this.item.tableColumns.map((col) => ({ @@ -1357,8 +1560,11 @@ export default class TableStylingWorkflow }, { type: "select", - id: "table-end-time-col", - name: "End time column", + id: "table-end-time-column", + + name: i18next.t( + "models.tableStyling.timeOptions.selectableDimensions.tableEndTimeColumn.name" + ), selectedId: this.tableStyle.endTimeColumn?.name, allowUndefined: true, options: this.item.tableColumns.map((col) => ({ @@ -1376,8 +1582,11 @@ export default class TableStylingWorkflow { type: "select-multi", - id: "table-time-id-cols", - name: "ID columns", + id: "table-time-id-columns", + + name: i18next.t( + "models.tableStyling.timeOptions.selectableDimensions.tableTimeIdColumns.name" + ), selectedIds: this.tableStyle.idColumns?.map((c) => c.name), allowUndefined: true, options: this.item.tableColumns.map((col) => ({ @@ -1395,10 +1604,24 @@ export default class TableStylingWorkflow { type: "checkbox", id: "table-time-is-sampled", - name: "Is Sampled", + + name: i18next.t( + "models.tableStyling.timeOptions.selectableDimensions.tableTimeIsSampled.name" + ), options: [ - { id: "true", name: "Yes" }, - { id: "false", name: "No" } + { + id: "true", + name: i18next.t( + "models.tableStyling.timeOptions.selectableDimensions.tableTimeIsSampled.options.true.name" + ) + }, + + { + id: "false", + name: i18next.t( + "models.tableStyling.timeOptions.selectableDimensions.tableTimeIsSampled.options.false.name" + ) + } ], selectedId: this.tableStyle.isSampled ? "true" : "false", setDimensionValue: (stratumId, value) => { @@ -1412,7 +1635,10 @@ export default class TableStylingWorkflow { type: "numeric", id: `table-time-display-duration`, - name: "Display Duration", + + name: i18next.t( + "models.tableStyling.timeOptions.selectableDimensions.tableTimeDisplayDuration.name" + ), value: this.tableStyle.timeTraits.displayDuration, setDimensionValue: (stratumId, value) => { this.getTableStyleTraits(stratumId)?.time.setTrait( @@ -1425,10 +1651,24 @@ export default class TableStylingWorkflow { type: "checkbox", id: "table-time-spread-start-time", - name: "Spread start time", + + name: i18next.t( + "models.tableStyling.timeOptions.selectableDimensions.tableTimeSpreadStartTime.name" + ), options: [ - { id: "true", name: "Yes" }, - { id: "false", name: "No" } + { + id: "true", + name: i18next.t( + "models.tableStyling.timeOptions.selectableDimensions.tableTimeSpreadStartTime.options.true.name" + ) + }, + + { + id: "false", + name: i18next.t( + "models.tableStyling.timeOptions.selectableDimensions.tableTimeSpreadStartTime.options.false.name" + ) + } ], selectedId: this.tableStyle.timeTraits.spreadStartTime ? "true" @@ -1444,10 +1684,24 @@ export default class TableStylingWorkflow { type: "checkbox", id: "table-time-spread-finish-time", - name: "Spread finish time", + + name: i18next.t( + "models.tableStyling.timeOptions.selectableDimensions.tableTimeSpreadFinishTime.name" + ), options: [ - { id: "true", name: "Yes" }, - { id: "false", name: "No" } + { + id: "true", + name: i18next.t( + "models.tableStyling.timeOptions.selectableDimensions.tableTimeSpreadFinishTime.options.true.name" + ) + }, + + { + id: "false", + name: i18next.t( + "models.tableStyling.timeOptions.selectableDimensions.tableTimeSpreadFinishTime.options.false.name" + ) + } ], selectedId: this.tableStyle.timeTraits.spreadFinishTime ? "true" @@ -1464,16 +1718,32 @@ export default class TableStylingWorkflow }, { type: "group", - id: "Workbench options", + id: "workbench-options", + + name: i18next.t("models.tableStyling.workbenchOptions.name"), isOpen: false, selectableDimensions: filterOutUndefined([ { type: "checkbox", id: "table-style-enabled", - name: "Show style in Workbench", + + name: i18next.t( + "models.tableStyling.workbenchOptions.selectableDimensions.tableStyleEnalbed.name" + ), options: [ - { id: "true", name: "Style showing" }, - { id: "false", name: "Style hidden" } + { + id: "true", + name: i18next.t( + "models.tableStyling.workbenchOptions.selectableDimensions.tableStyleEnalbed.options.true.name" + ) + }, + + { + id: "false", + name: i18next.t( + "models.tableStyling.workbenchOptions.selectableDimensions.tableStyleEnalbed.options.false.name" + ) + } ], selectedId: this.item.activeTableStyle.hidden ? "false" : "true", setDimensionValue: (stratumId, value) => { @@ -1486,8 +1756,11 @@ export default class TableStylingWorkflow }, { type: "checkbox", - id: "showDisableStyleOption", - name: "Show disable style option", + id: "show-disable-style-option", + + name: i18next.t( + "models.tableStyling.workbenchOptions.selectableDimensions.showDisableStyleOption.name" + ), options: [{ id: "true" }, { id: "false" }], selectedId: this.item.showDisableStyleOption ? "true" : "false", setDimensionValue: (stratumId, value) => { @@ -1500,8 +1773,11 @@ export default class TableStylingWorkflow }, { type: "checkbox", - id: "showDisableTimeOption", - name: "Show disable time option", + id: "show-disable-time-option", + + name: i18next.t( + "models.tableStyling.workbenchOptions.selectableDimensions.showDisableTimeOption.name" + ), options: [{ id: "true" }, { id: "false" }], selectedId: this.item.showDisableTimeOption ? "true" : "false", setDimensionValue: (stratumId, value) => { @@ -1514,8 +1790,11 @@ export default class TableStylingWorkflow }, { type: "checkbox", - id: "enableManualRegionMapping", - name: "Enable manual region mapping", + id: "enable-manual-region-mapping", + + name: i18next.t( + "models.tableStyling.workbenchOptions.selectableDimensions.enableManualRegionMapping.name" + ), options: [{ id: "true" }, { id: "false" }], selectedId: this.item.enableManualRegionMapping ? "true" : "false", setDimensionValue: (stratumId, value) => { @@ -1530,13 +1809,18 @@ export default class TableStylingWorkflow }, { type: "group", - id: "Variable/column", + id: "variable-and-column", + + name: i18next.t("models.tableStyling.variableAndColumn.name"), isOpen: false, selectableDimensions: filterOutUndefined([ { type: "text", id: "column-title", - name: "Title", + + name: i18next.t( + "models.tableStyling.variableAndColumn.selectableDimensions.columnTitle.name" + ), value: this.tableStyle.colorColumn?.title, setDimensionValue: (stratumId, value) => { this.getTableColumnTraits(stratumId)?.setTrait( @@ -1549,7 +1833,10 @@ export default class TableStylingWorkflow { type: "text", id: "column-units", - name: "Units", + + name: i18next.t( + "models.tableStyling.variableAndColumn.selectableDimensions.columnUnits.name" + ), value: this.tableStyle.colorColumn?.units, setDimensionValue: (stratumId, value) => { this.getTableColumnTraits(stratumId)?.setTrait( @@ -1596,7 +1883,10 @@ export default class TableStylingWorkflow { type: "select", id: `${key}-column`, - name: "Variable", + + name: i18next.t( + "models.tableStyling.style.selectableDimensions.column.name" + ), selectedId: tableStyleMap.column?.name, allowUndefined: true, options: this.item.tableColumns.map((col) => ({ @@ -1611,14 +1901,38 @@ export default class TableStylingWorkflow ? { type: "select", id: `${key}-style-type`, - name: "Type", - undefinedLabel: "Please specify", + + name: i18next.t( + "models.tableStyling.style.selectableDimensions.styleType.name" + ), + + undefinedLabel: i18next.t( + "models.tableStyling.style.selectableDimensions.styleType.undefinedLabel" + ), options: filterOutUndefined([ - { id: "constant", name: "No style" }, + { + id: "constant", + + name: i18next.t( + "models.tableStyling.style.selectableDimensions.styleType.constant.name" + ) + }, tableStyleMap.column.type === TableColumnType.scalar - ? { id: "bin", name: "Discrete" } + ? { + id: "bin", + + name: i18next.t( + "models.tableStyling.style.selectableDimensions.styleType.bin.name" + ) + } : undefined, - { id: "enum", name: "Qualitative" } + { + id: "enum", + + name: i18next.t( + "models.tableStyling.style.selectableDimensions.styleType.enum.name" + ) + } ]), selectedId: traits.mapType ?? tableStyleMap.styleMap.type, setDimensionValue: (stratumId, id) => { @@ -1635,7 +1949,10 @@ export default class TableStylingWorkflow ? { type: "group", id: `${key}-enum`, - name: "Enum styles", + + name: i18next.t( + "models.tableStyling.style.selectableDimensions.enum.name" + ), isOpen: true, selectableDimensions: filterOutUndefined([ ...traits.enum?.map((enumPoint, idx) => { @@ -1645,7 +1962,10 @@ export default class TableStylingWorkflow name: getPreview( tableStyleMap.traitValues.enum[idx], tableStyleMap.traitValues.null, - tableStyleMap.commonTraits.enum[idx].value ?? "No value" + tableStyleMap.commonTraits.enum[idx].value ?? + i18next.t( + "models.tableStyling.style.selectableDimensions.enum.selectableDimensions.enum.noValue" + ) ), isOpen: this.openBinIndex.get(key) === idx, onToggle: (open) => { @@ -1658,7 +1978,10 @@ export default class TableStylingWorkflow { type: "select", id: `${key}-enum-${idx}-value`, - name: "Value", + + name: i18next.t( + "models.tableStyling.style.selectableDimensions.enum.selectableDimensions.enum.selectableDimensions.value.name" + ), selectedId: enumPoint.value ?? undefined, // Find unique column values which don't already have an enumCol // We prepend the current enumCol.value @@ -1686,7 +2009,10 @@ export default class TableStylingWorkflow { type: "button", id: `${key}-enum-${idx}-remove`, - value: "Remove", + + value: i18next.t( + "models.tableStyling.style.selectableDimensions.enum.selectableDimensions.enum.selectableDimensions.remove.value" + ), setDimensionValue: (stratumId) => { enumPoint.setTrait(stratumId, "value", null); } @@ -1704,7 +2030,10 @@ export default class TableStylingWorkflow ? ({ type: "button", id: `${key}-enum-add`, - value: "Add style for value", + + value: i18next.t( + "models.tableStyling.style.selectableDimensions.enum.selectableDimensions.enum.add.value" + ), setDimensionValue: (stratumId) => { const firstValue = tableStyleMap.column?.uniqueValues.values.find( @@ -1733,14 +2062,20 @@ export default class TableStylingWorkflow (traits.mapType ?? tableStyleMap.styleMap.type) === "bin" ? { type: "group", - name: "Bin styles", id: `${key}-bin`, + + name: i18next.t( + "models.tableStyling.style.selectableDimensions.bin.name" + ), isOpen: true, selectableDimensions: filterOutUndefined([ { type: "button", id: `${key}-bin-add`, - value: "Add style bin", + + value: i18next.t( + "models.tableStyling.style.selectableDimensions.bin.selectableDimensions.add.value" + ), setDimensionValue: (stratumId) => { const newModel = traits.addObject(stratumId, "bin"); @@ -1763,13 +2098,19 @@ export default class TableStylingWorkflow tableStyleMap.traitValues.bin[idx], tableStyleMap.traitValues.null, !isDefined(bin.maxValue ?? undefined) - ? "No value" - : `${ - idx > 0 && - isDefined(traits.bin[idx - 1].maxValue ?? undefined) - ? `${traits.bin[idx - 1].maxValue} to ` - : "" - }${bin.maxValue}` + ? i18next.t( + "models.tableStyling.style.selectableDimensions.bin.selectableDimensions.bin.noValue" + ) + : idx > 0 && + isDefined(traits.bin[idx - 1].maxValue ?? undefined) + ? i18next.t( + "models.tableStyling.style.selectableDimensions.bin.selectableDimensions.bin.range", + { + value1: traits.bin[idx - 1].maxValue, + value2: bin.maxValue + } + ) + : `${bin.maxValue}` ), isOpen: this.openBinIndex.get(key) === idx, @@ -1784,7 +2125,10 @@ export default class TableStylingWorkflow ? { type: "numeric", id: `${key}-bin-${idx}-start`, - name: "Start", + + name: i18next.t( + "models.tableStyling.style.selectableDimensions.bin.selectableDimensions.bin.selectableDimensions.start.name" + ), value: traits.bin[idx - 1].maxValue ?? undefined, setDimensionValue: (stratumId, value) => { traits.bin[idx - 1].setTrait( @@ -1798,7 +2142,10 @@ export default class TableStylingWorkflow { type: "numeric", id: `${key}-bin-${idx}-stop`, - name: "Stop", + + name: i18next.t( + "models.tableStyling.style.selectableDimensions.bin.selectableDimensions.bin.selectableDimensions.stop.name" + ), value: bin.maxValue ?? undefined, setDimensionValue: (stratumId, value) => { bin.setTrait(stratumId, "maxValue", value); @@ -1812,7 +2159,10 @@ export default class TableStylingWorkflow { type: "button", id: `${key}-bin-${idx}-remove`, - value: "Remove", + + value: i18next.t( + "models.tableStyling.style.selectableDimensions.bin.selectableDimensions.bin.selectableDimensions.remove.value" + ), setDimensionValue: (stratumId) => { bin.setTrait(stratumId, "maxValue", null); } @@ -1828,7 +2178,8 @@ export default class TableStylingWorkflow { type: "group", id: `${key}-null`, - name: "Default", + + name: i18next.t("models.tableStyling.style.null.name"), isOpen: !tableStyleMap.column || !traits.mapType || @@ -1844,7 +2195,7 @@ export default class TableStylingWorkflow @computed get markerDims(): SelectableDimensionWorkflowGroup[] { return this.getStyleDims( - "Marker style", + i18next.t("models.tableStyling.point.name"), "point", this.tableStyle.pointStyleMap, (id, pointTraits, nullValues) => @@ -1852,7 +2203,11 @@ export default class TableStylingWorkflow { type: "select", id: `${id}-marker`, - name: 'Marker supports URL and base64 of any supported image format (eg PNG, SVG)', + name: `${i18next.t( + "models.tableStyling.point.selectableDimensions.marker.tooltip" + )}`, selectedId: (pointTraits.marker ?? nullValues.marker) || "point", allowUndefined: true, allowCustomInput: true, @@ -1867,7 +2222,10 @@ export default class TableStylingWorkflow { type: "numeric", id: `${id}-rotation`, - name: "Rotation", + + name: i18next.t( + "models.tableStyling.point.selectableDimensions.rotation.name" + ), value: pointTraits.rotation ?? nullValues.rotation, setDimensionValue: (stratumId, value) => { pointTraits.setTrait(stratumId, "rotation", value); @@ -1877,7 +2235,10 @@ export default class TableStylingWorkflow ? { type: "numeric", id: `${id}-height`, - name: "Height", + + name: i18next.t( + "models.tableStyling.point.selectableDimensions.height.name" + ), value: pointTraits.height ?? nullValues.height, setDimensionValue: (stratumId, value) => { pointTraits.setTrait(stratumId, "height", value); @@ -1888,7 +2249,10 @@ export default class TableStylingWorkflow ? { type: "numeric", id: `${id}-width`, - name: "Width", + + name: i18next.t( + "models.tableStyling.point.selectableDimensions.width.name" + ), value: pointTraits.width ?? nullValues.width, setDimensionValue: (stratumId, value) => { pointTraits.setTrait(stratumId, "width", value); @@ -1914,14 +2278,17 @@ export default class TableStylingWorkflow @computed get outlineDims(): SelectableDimensionWorkflowGroup[] { return this.getStyleDims( - "Outline style", + i18next.t("models.tableStyling.outline.name"), "outline", this.tableStyle.outlineStyleMap, (id, outlineTraits, nullValues) => [ { type: "color", id: `${id}-color`, - name: `Color`, + + name: i18next.t( + "models.tableStyling.outline.selectableDimensions.color" + ), allowUndefined: true, value: outlineTraits.color ?? nullValues.color, setDimensionValue: (stratumId, value) => { @@ -1931,7 +2298,10 @@ export default class TableStylingWorkflow { type: "numeric", id: `${id}-width`, - name: "Width", + + name: i18next.t( + "models.tableStyling.outline.selectableDimensions.width" + ), value: outlineTraits.width ?? nullValues.width, setDimensionValue: (stratumId, value) => { outlineTraits.setTrait(stratumId, "width", value); @@ -1945,7 +2315,7 @@ export default class TableStylingWorkflow @computed get labelDims(): SelectableDimensionWorkflowGroup[] { return this.getStyleDims( - "Label style", + i18next.t("models.tableStyling.label.name"), "label", this.tableStyle.labelStyleMap, (id, labelTraits, nullValues) => @@ -1953,7 +2323,10 @@ export default class TableStylingWorkflow { type: "select", id: `${id}-column`, - name: "Label column", + + name: i18next.t( + "models.tableStyling.label.selectableDimensions.column.name" + ), selectedId: labelTraits.labelColumn ?? nullValues.labelColumn, allowUndefined: true, options: this.item.tableColumns.map((col) => ({ @@ -1967,7 +2340,10 @@ export default class TableStylingWorkflow { type: "text", id: `${id}-font`, - name: "Font", + + name: i18next.t( + "models.tableStyling.label.selectableDimensions.font.name" + ), value: labelTraits.font ?? nullValues.font, setDimensionValue: (stratumId, value) => { labelTraits.setTrait(stratumId, "font", value); @@ -1976,12 +2352,33 @@ export default class TableStylingWorkflow { type: "select", id: `${id}-style`, - name: "Label style", + + name: i18next.t( + "models.tableStyling.label.selectableDimensions.style.name" + ), selectedId: labelTraits.style ?? nullValues.style, options: [ - { id: "FILL", name: "Fill only" }, - { id: "OUTLINE", name: "Outline only" }, - { id: "FILL_AND_OUTLINE", name: "Fill and outline" } + { + id: "FILL", + + name: i18next.t( + "models.tableStyling.label.selectableDimensions.style.options.fill.name" + ) + }, + { + id: "OUTLINE", + + name: i18next.t( + "models.tableStyling.label.selectableDimensions.style.options.outline.name" + ) + }, + { + id: "FILL_AND_OUTLINE", + + name: i18next.t( + "models.tableStyling.label.selectableDimensions.style.options.fillAndOutline.name" + ) + } ], setDimensionValue: (stratumId, value) => { labelTraits.setTrait(stratumId, "style", value); @@ -1990,7 +2387,10 @@ export default class TableStylingWorkflow { type: "numeric", id: `${id}-scale`, - name: "Scale", + + name: i18next.t( + "models.tableStyling.label.selectableDimensions.scale.name" + ), value: labelTraits.scale ?? nullValues.scale, setDimensionValue: (stratumId, value) => { labelTraits.setTrait(stratumId, "scale", value); @@ -2003,7 +2403,10 @@ export default class TableStylingWorkflow ? { type: "color", id: `${id}-fill-color`, - name: `Fill color`, + + name: i18next.t( + "models.tableStyling.label.selectableDimensions.fillColor.name" + ), value: labelTraits.fillColor ?? nullValues.fillColor, setDimensionValue: (stratumId, value) => { labelTraits.setTrait(stratumId, "fillColor", value); @@ -2015,7 +2418,10 @@ export default class TableStylingWorkflow ? { type: "color", id: `${id}-outline-color`, - name: `Outline color`, + + name: i18next.t( + "models.tableStyling.label.selectableDimensions.outlineColor.name" + ), value: labelTraits.outlineColor ?? nullValues.outlineColor, setDimensionValue: (stratumId, value) => { labelTraits.setTrait(stratumId, "outlineColor", value); @@ -2027,7 +2433,10 @@ export default class TableStylingWorkflow ? { type: "numeric", id: `${id}-outline-width`, - name: "Outline width", + + name: i18next.t( + "models.tableStyling.label.selectableDimensions.outlineWidth.name" + ), value: labelTraits.outlineWidth ?? nullValues.outlineWidth, setDimensionValue: (stratumId, value) => { labelTraits.setTrait(stratumId, "outlineWidth", value); @@ -2037,13 +2446,34 @@ export default class TableStylingWorkflow { type: "select", id: `${id}-horizontal-origin`, - name: "Horizontal origin", + + name: i18next.t( + "models.tableStyling.label.selectableDimensions.horizontalOrigin.name" + ), selectedId: labelTraits.horizontalOrigin ?? nullValues.horizontalOrigin, options: [ - { id: "LEFT", name: "Left" }, - { id: "CENTER", name: "Center" }, - { id: "RIGHT", name: "Right" } + { + id: "LEFT", + + name: i18next.t( + "models.tableStyling.label.selectableDimensions.horizontalOrigin.options.left.name" + ) + }, + { + id: "CENTER", + + name: i18next.t( + "models.tableStyling.label.selectableDimensions.horizontalOrigin.options.center.name" + ) + }, + { + id: "RIGHT", + + name: i18next.t( + "models.tableStyling.label.selectableDimensions.horizontalOrigin.options.right.name" + ) + } ], setDimensionValue: (stratumId, value) => { labelTraits.setTrait(stratumId, "horizontalOrigin", value); @@ -2052,13 +2482,40 @@ export default class TableStylingWorkflow { type: "select", id: `${id}-vertical-origin`, - name: "Vertical origin", + + name: i18next.t( + "models.tableStyling.label.selectableDimensions.verticalOrigin.name" + ), selectedId: labelTraits.verticalOrigin ?? nullValues.verticalOrigin, options: [ - { id: "TOP", name: "Top" }, - { id: "CENTER", name: "Center" }, - { id: "BASELINE", name: "Baseline" }, - { id: "BOTTOM", name: "Bottom" } + { + id: "TOP", + + name: i18next.t( + "models.tableStyling.label.selectableDimensions.verticalOrigin.options.top.name" + ) + }, + { + id: "CENTER", + + name: i18next.t( + "models.tableStyling.label.selectableDimensions.verticalOrigin.options.center.name" + ) + }, + { + id: "BASELINE", + + name: i18next.t( + "models.tableStyling.label.selectableDimensions.verticalOrigin.options.baseline.name" + ) + }, + { + id: "BOTTOM", + + name: i18next.t( + "models.tableStyling.label.selectableDimensions.verticalOrigin.options.bottom.name" + ) + } ], setDimensionValue: (stratumId, value) => { labelTraits.setTrait(stratumId, "verticalOrigin", value); @@ -2067,7 +2524,10 @@ export default class TableStylingWorkflow { type: "numeric", id: `${id}-pixel-offset-x`, - name: "Pixel offset X", + + name: i18next.t( + "models.tableStyling.label.selectableDimensions.offsetX.name" + ), value: labelTraits.pixelOffset[0] ?? nullValues.pixelOffset[0], setDimensionValue: (stratumId, value) => { labelTraits.setTrait(stratumId, "pixelOffset", [ @@ -2079,7 +2539,10 @@ export default class TableStylingWorkflow { type: "numeric", id: `${id}-pixel-offset-y`, - name: "Pixel offset Y", + + name: i18next.t( + "models.tableStyling.label.selectableDimensions.offsetY.name" + ), value: labelTraits.pixelOffset[1] ?? nullValues.pixelOffset[1], setDimensionValue: (stratumId, value) => { labelTraits.setTrait(stratumId, "pixelOffset", [ @@ -2103,8 +2566,10 @@ export default class TableStylingWorkflow filterOutUndefined([ { type: "numeric", - id: `${id}-lead-power`, - name: "Lead time (secs)", + id: `${id}-lead-time`, + name: i18next.t( + "models.tableStyling.trail.selectableDimensions.leadTime.name" + ), value: trailTraits.leadTime ?? nullValues.leadTime, setDimensionValue: (stratumId, value) => { trailTraits.setTrait(stratumId, "leadTime", value); @@ -2113,7 +2578,10 @@ export default class TableStylingWorkflow { type: "numeric", id: `${id}-trail-time`, - name: "Trail time (secs)", + + name: i18next.t( + "models.tableStyling.trail.selectableDimensions.trailTime.name" + ), value: trailTraits.trailTime ?? nullValues.trailTime, setDimensionValue: (stratumId, value) => { trailTraits.setTrait(stratumId, "trailTime", value); @@ -2122,7 +2590,10 @@ export default class TableStylingWorkflow { type: "numeric", id: `${id}-width`, - name: "Width", + + name: i18next.t( + "models.tableStyling.trail.selectableDimensions.width.name" + ), value: trailTraits.width ?? nullValues.width, setDimensionValue: (stratumId, value) => { trailTraits.setTrait(stratumId, "width", value); @@ -2131,7 +2602,10 @@ export default class TableStylingWorkflow { type: "numeric", id: `${id}-resolution`, - name: "Resolution", + + name: i18next.t( + "models.tableStyling.trail.selectableDimensions.resolution.name" + ), value: trailTraits.resolution ?? nullValues.resolution, setDimensionValue: (stratumId, value) => { trailTraits.setTrait(stratumId, "resolution", value); @@ -2145,7 +2619,10 @@ export default class TableStylingWorkflow { type: "color", id: `${id}-glow-color`, - name: `Glow color`, + + name: i18next.t( + "models.tableStyling.trail.selectableDimensions.growColor.name" + ), value: trailTraits.polylineGlow.color ?? nullValues.polylineGlow?.color, @@ -2160,7 +2637,10 @@ export default class TableStylingWorkflow { type: "numeric", id: `${id}-glow-power`, - name: "Glow power", + + name: i18next.t( + "models.tableStyling.trail.selectableDimensions.growPower.name" + ), value: trailTraits.polylineGlow.glowPower ?? nullValues.polylineGlow?.glowPower, @@ -2175,7 +2655,10 @@ export default class TableStylingWorkflow { type: "numeric", id: `${id}-taper-power`, - name: "Taper power", + + name: i18next.t( + "models.tableStyling.trail.selectableDimensions.taperPower.name" + ), value: trailTraits.polylineGlow.taperPower ?? nullValues.polylineGlow?.taperPower, @@ -2192,7 +2675,10 @@ export default class TableStylingWorkflow { type: "color", id: `${id}-solid-color`, - name: `Solid color`, + + name: i18next.t( + "models.tableStyling.trail.selectableDimensions.solidColor.name" + ), value: trailTraits.solidColor.color ?? nullValues.solidColor?.color, @@ -2210,17 +2696,36 @@ export default class TableStylingWorkflow ), { type: "group", - id: "Trail style options", + id: "trail-style-options", + + name: i18next.t( + "models.tableStyling.trail.selectableDimensions.trailStyleOptions.name" + ), isOpen: false, selectableDimensions: filterOutUndefined([ { type: "select", id: "trail-style-options-material", - name: "Material type", + + name: i18next.t( + "models.tableStyling.trail.selectableDimensions.trailStyleOptions.selectableDimensions.material.name" + ), selectedId: this.tableStyle.trailStyleMap.traits.materialType, options: [ - { id: "solidColor", name: "Solid color" }, - { id: "polylineGlow", name: "Polyline glow" } + { + id: "solidColor", + + name: i18next.t( + "models.tableStyling.trail.selectableDimensions.trailStyleOptions.selectableDimensions.material.options.solidColor.name" + ) + }, + { + id: "polylineGlow", + + name: i18next.t( + "models.tableStyling.trail.selectableDimensions.trailStyleOptions.selectableDimensions.material.options.polylineGlow.name" + ) + } ], setDimensionValue: (stratumId, value) => { if (value === "solidColor" || value === "polylineGlow") diff --git a/lib/ReactViews/SelectableDimensions/Checkbox.tsx b/lib/ReactViews/SelectableDimensions/Checkbox.tsx index 40ed573bffc..eb20321e145 100644 --- a/lib/ReactViews/SelectableDimensions/Checkbox.tsx +++ b/lib/ReactViews/SelectableDimensions/Checkbox.tsx @@ -1,5 +1,6 @@ import { runInAction } from "mobx"; import React from "react"; +import { useTranslation } from "react-i18next"; import CommonStrata from "../../Models/Definition/CommonStrata"; import { SelectableDimensionCheckbox as SelectableDimensionCheckboxModel } from "../../Models/SelectableDimensions/SelectableDimensions"; import Checkbox from "../../Styled/Checkbox"; @@ -9,6 +10,7 @@ export const SelectableDimensionCheckbox: React.FC<{ id: string; dim: SelectableDimensionCheckboxModel; }> = ({ id, dim }) => { + const { t } = useTranslation(); return ( {dim.options?.find((opt) => opt.id === dim.selectedId)?.name ?? - (dim.selectedId === "true" ? "Enabled" : "Disabled")} + (dim.selectedId === "true" + ? t("selectableDimensions.enabled") + : t("selectableDimensions.disabled"))} ); diff --git a/lib/ReactViews/SelectableDimensions/Color.tsx b/lib/ReactViews/SelectableDimensions/Color.tsx index 787112def8c..41f4b38a834 100644 --- a/lib/ReactViews/SelectableDimensions/Color.tsx +++ b/lib/ReactViews/SelectableDimensions/Color.tsx @@ -3,6 +3,7 @@ import { action, runInAction } from "mobx"; import { observer } from "mobx-react"; import React, { useState } from "react"; import { ChromePicker } from "react-color"; +import { useTranslation } from "react-i18next"; import isDefined from "../../Core/isDefined"; import CommonStrata from "../../Models/Definition/CommonStrata"; import { SelectableDimensionColor as SelectableDimensionColorModel } from "../../Models/SelectableDimensions/SelectableDimensions"; @@ -24,6 +25,7 @@ export const SelectableDimensionColor: React.FC<{ dim: SelectableDimensionColorModel; }> = observer(({ id, dim }) => { const [open, setIsOpen] = useState(false); + const { t } = useTranslation(); return (
{dim.value ? ( @@ -62,7 +64,7 @@ export const SelectableDimensionColor: React.FC<{ fullHeight > - Add + {t("selectableDimensions.colorAdd")} @@ -81,7 +83,7 @@ export const SelectableDimensionColor: React.FC<{ fullHeight > - Clear + {t("selectableDimensions.colorRemove")} diff --git a/lib/ReactViews/SelectableDimensions/ColorSchemeOptionRenderer.tsx b/lib/ReactViews/SelectableDimensions/ColorSchemeOptionRenderer.tsx index 2c3b480709e..3f3a250422d 100644 --- a/lib/ReactViews/SelectableDimensions/ColorSchemeOptionRenderer.tsx +++ b/lib/ReactViews/SelectableDimensions/ColorSchemeOptionRenderer.tsx @@ -1,9 +1,15 @@ +import { useTranslation } from "react-i18next"; import { lab, rgb } from "d3-color"; import * as d3Scale from "d3-scale-chromatic"; import React from "react"; import StandardCssColors from "../../Core/StandardCssColors"; import { OptionRenderer } from "../../Models/SelectableDimensions/SelectableDimensions"; +const Invalid: React.VFC<{}> = () => { + const { t } = useTranslation(); + return {t("selectableDimensions.invalid")}; +}; + /* The ramp and swatches functions are adapted from https://observablehq.com/@d3/color-schemes?collection=@d3/d3-scale-chromatic * * Copyright 2018–2020 Observable, Inc. @@ -28,7 +34,7 @@ function ramp( name: string | undefined, n: number | undefined ): React.ReactChild { - if (!name) return Invalid; + if (!name) return ; let colors: string[]; /** This could be used to draw text on top of swatches/ramps */ @@ -43,7 +49,7 @@ function ramp( } else { const interpolate = (d3Scale as any)[`interpolate${name}`]; if (!interpolate) { - return Invalid; + return ; } colors = []; dark = lab(interpolate(0)).l < 50; @@ -73,7 +79,7 @@ function ramp( canvas.width = interpolateWidth; canvas.height = 1; const context = canvas.getContext("2d"); - if (!context) return Invalid; + if (!context) return ; canvas.style.width = `${interpolateWidth}px`; canvas.style.height = `${height}px`; for (let i = 0; i < interpolateWidth; ++i) { @@ -97,13 +103,13 @@ function ramp( } function swatches(name: string | undefined) { - if (!name) return Invalid; + if (!name) return ; let colors: string[] | undefined = (d3Scale as any)[`scheme${name}`]; // Handle custom HighContrast style if (!colors && name === "HighContrast") { colors = StandardCssColors.highContrast; } - if (!colors) return Invalid; + if (!colors) return ; const n = colors.length; const dark = lab(colors[0]).l < 50; return ( diff --git a/lib/ReactViews/SelectableDimensions/Group.tsx b/lib/ReactViews/SelectableDimensions/Group.tsx index 95bb258c24b..e06b370ba37 100644 --- a/lib/ReactViews/SelectableDimensions/Group.tsx +++ b/lib/ReactViews/SelectableDimensions/Group.tsx @@ -1,4 +1,5 @@ import React from "react"; +import { useTranslation } from "react-i18next"; import CommonStrata from "../../Models/Definition/CommonStrata"; import { filterSelectableDimensions, @@ -17,6 +18,7 @@ export const SelectableDimensionGroup: React.FC<{ id: string; dim: SelectableDimensionGroupModel | SelectableDimensionCheckboxGroupModel; }> = ({ id, dim }) => { + const { t } = useTranslation(); const childDims = filterSelectableDimensions(dim.placement)( dim.selectableDimensions ); @@ -29,7 +31,9 @@ export const SelectableDimensionGroup: React.FC<{ dim.type === "group" ? dim.name ?? dim.id ?? "" : dim.options?.find((opt) => opt.id === dim.selectedId)?.name ?? - (dim.selectedId === "true" ? "Enabled" : "Disabled") + (dim.selectedId === "true" + ? t("selectableDimensions.enabled") + : t("selectableDimensions.disabled")) } bodyBoxProps={{ displayInlineBlock: true, diff --git a/lib/ReactViews/SelectableDimensions/Select.tsx b/lib/ReactViews/SelectableDimensions/Select.tsx index 2b37f420aa5..d27aabe9897 100644 --- a/lib/ReactViews/SelectableDimensions/Select.tsx +++ b/lib/ReactViews/SelectableDimensions/Select.tsx @@ -21,8 +21,7 @@ export const SelectableDimensionEnum: React.FC<{ const undefinedOption = { value: undefined, label: - dim.undefinedLabel ?? - i18next.t("workbench.dimensionsSelector.undefinedLabel") + dim.undefinedLabel ?? i18next.t("selectableDimensions.undefinedLabel") }; let options = dim.options?.map((option) => ({ diff --git a/wwwroot/languages/en/translation.json b/wwwroot/languages/en/translation.json index 58be23229bc..8810fd7529a 100644 --- a/wwwroot/languages/en/translation.json +++ b/wwwroot/languages/en/translation.json @@ -541,9 +541,6 @@ "toggleVisibility": "Data show/hide", "addItemErrorTitle": "Catalog item could not be added to workbench.", "addItemErrorMessage": "An error occurred while loading the catalog item.", - "dimensionsSelector": { - "undefinedLabel": "Not specified" - }, "searchItem": "Search", "searchItemTitle": "Search", "splitScreenMode": "SPLIT SCREEN MODE" @@ -1290,11 +1287,17 @@ "bulkGeocoderErrorMessage": "Unable to map addresses to lat-long coordinates, as an error occurred while retrieving address coordinates. Please check your internet connection or try again later.", "legendZFilterLabel": "Extreme values", "legendNullLabel": "(No value)", + "activeStyle": "Display Variable", "styleDisabledLabel": "Disable style", "zFilterEnabled": "Extreme values hidden (click to show)", "zFilterDisabled": "Extreme values detected (click to hide)", "timeDimensionEnabled": "Time enabled (click to disable)", - "timeDimensionDisabled": "Time disabled (click to enable)" + "timeDimensionDisabled": "Time disabled (click to enable)", + "editStyle": "Edit Style", + "custom": "Custom", + "regionMapping": "Region Mapping", + "regionColumn": "Region Column", + "manualRegionMapping": "Manual Region Mapping" }, "terrainCatalog": { "notSupportedErrorTitle": "Not supported in 2D", @@ -1519,6 +1522,503 @@ "scaleDatasetNotVisible": { "scaleZoomIn": "Dataset is not available at this scale, zoom in to see it", "scaleZoomOut": "Dataset is not available at this scale, zoom out to see it" + }, + "tableStyling": { + "hideAdvancedOptions": "Hide advanced options", + "showAdvancedOptions": "Show advanced options", + "copyUserStratum": "Copy user stratum to clipboard", + "name": "Style", + "reset": "Reset to default style", + "data": { + "name": "Data", + "selectableDimensions": { + "dataset": { + "name": "Dataset" + }, + "tableStyle": { + "dataset": "Style" + }, + "tableStyleType": { + "name": "Symbology", + "options": { + "fill": { + "name": "Fill color" + }, + "pointSize": { + "name": "Point size" + }, + "point": { + "name": "Point/Marker style" + }, + "outline": { + "name": "Outline color" + }, + "label": { + "name": "Label style" + }, + "trail": { + "name": "Trail style" + } + } + } + } + }, + "fill": { + "name": "Fill Color", + "selectableDimensions": { + "tableColorColumn": { + "name": "Variable" + }, + "dataType": { + "name": "Column type (advanced)" + }, + "type": { + "name": "Type", + "undefinedLabel": "Please specify", + "options": { + "noStyle": { + "name": "No style" + }, + "sequentialContinuous": { + "name": "Sequential (continuous)" + }, + "sequentialDiscrete": { + "name": "Sequential (discrete)" + }, + "divergingContinuous": { + "name": "Divergent (continuous)" + }, + "divergingDiscrete": { + "name": "Divergent (discrete)" + }, + "qualitative": { + "name": "Qualitative" + }, + "customQualitative": { + "name": "Custom (qualitative)" + }, + "customDiscrete": { + "name": "Custom (discrete)" + } + } + }, + "scheme": { + "name": "Scheme" + }, + "numberOfBins": { + "name": "Number of Bins" + } + } + }, + "min": { + "name": "Min" + }, + "displayRange": { + "name": "Display range", + "selectableDimensions": { + "max": { + "name": "Max" + } + } + }, + "bins": { + "name": "Bins", + "selectableDimensions": { + "start": { + "name": "{{value1}} to {{value2}}", + "selectableDimensions": { + "color": { + "name": "Color" + }, + "start": { + "name": "Start" + }, + "stop": { + "name": "Stop" + } + } + } + } + }, + "colors": { + "name": "Colors", + "selectableDimensions": { + "color": { + "name": "Color" + }, + "value": { + "name": "Value" + }, + "remove": { + "value": "Remove" + }, + "add": { + "value": "Add Color" + } + } + }, + "nullColor": { + "name": "Default color" + }, + "outlierColor": { + "name": "Outlier color" + }, + "additionalColors": { + "name": "Additional colors", + "selectableDimensions": { + "regionColor": { + "name": "Region color" + }, + "nullColor": { + "name": "Default color" + }, + "outlierColor": { + "name": "Outlier color" + } + } + }, + "pointSize": { + "name": "Point size", + "selectableDimensions": { + "pointSizeColumn": { + "name": "Variable" + }, + "pointSizeNull": { + "name": "Default size" + }, + "pointSizesFactor": { + "name": "Size factor" + }, + "pointSizeOffset": { + "name": "Size offset" + } + } + }, + "regionMapping": { + "name": "Region mapping" + }, + "legend": { + "name": "Legend", + "selectableDimensions": { + "legendTitle": { + "name": "Title" + }, + "legendTicks": { + "name": "Ticks" + }, + "title": { + "name": "Item {{index}} Title" + } + } + }, + "styleOptions": { + "name": "Style options", + "selectableDimensions": { + "styleTitle": { + "name": "Title" + }, + "longitudeColumn": { + "name": "Longitude column" + }, + "latitudeColumn": { + "name": "Latitude column" + } + } + }, + "timeOptions": { + "name": "Time options", + "selectableDimensions": { + "tableTimeColumn": { + "name": "Time column" + }, + "tableEndTimeColumn": { + "name": "End time column" + }, + "tableTimeIdColumns": { + "name": "ID columns" + }, + "tableTimeIsSampled": { + "name": "Is Sampled", + "options": { + "true": { + "name": "Yes" + }, + "false": { + "name": "No" + } + } + }, + "tableTimeDisplayDuration": { + "name": "Display Duration" + }, + "tableTimeSpreadStartTime": { + "name": "Spread start time", + "options": { + "true": { + "name": "Yes" + }, + "false": { + "name": "No" + } + } + }, + "tableTimeSpreadFinishTime": { + "name": "Spread finish time", + "options": { + "true": { + "name": "Yes" + }, + "false": { + "name": "No" + } + } + } + } + }, + "workbenchOptions": { + "name": "Workbench options", + "selectableDimensions": { + "tableStyleEnalbed": { + "name": "Show style in Workbench", + "options": { + "true": { + "name": "Style showing" + }, + "false": { + "name": "Style hidden" + } + } + }, + "showDisableStyleOption": { + "name": "Show disable style option" + }, + "showDisableTimeOption": { + "name": "Show disable time option" + }, + "enableManualRegionMapping": { + "name": "Enable manual region mapping" + } + } + }, + "variableAndColumn": { + "name": "Variable/column", + "selectableDimensions": { + "columnTitle": { + "name": "Title" + }, + "columnUnits": { + "name": "Units" + } + } + }, + "style": { + "selectableDimensions": { + "column": { + "name": "Variable" + }, + "styleType": { + "name": "Type", + "undefinedLabel": "Please specify", + "constant": { + "name": "No style" + }, + "bin": { + "name": "Discrete" + }, + "enum": { + "name": "Qualitative" + } + }, + "enum": { + "name": "Enum styles", + "selectableDimensions": { + "enum": { + "noValue": "No value", + "selectableDimensions": { + "value": { + "name": "Value" + }, + "remove": { + "value": "Remove" + } + }, + "add": { + "value": "Add style for value" + } + } + } + }, + "bin": { + "name": "Bin styles", + "selectableDimensions": { + "add": { + "value": "Add style bin" + }, + "bin": { + "noValue": "No value", + "range": "{{value1}} to {{value2}}", + "selectableDimensions": { + "start": { + "name": "Start" + }, + "stop": { + "name": "Stop" + }, + "remove": { + "value": "Remove" + } + } + } + } + } + }, + "null": { + "name": "Default" + } + }, + "point": { + "name": "Marker style", + "selectableDimensions": { + "marker": { + "name": "Marker", + "tooltip": "Marker supports URL and base64 of any supported image format (eg PNG, SVG)" + }, + "rotation": { + "name": "Rotation" + }, + "height": { + "name": "Height" + }, + "width": { + "name": "Width" + } + } + }, + "outline": { + "name": "Outline style", + "selectableDimensions": { + "color": "Color", + "width": "Width" + } + }, + "label": { + "name": "Label style", + "selectableDimensions": { + "column": { + "name": "Label column" + }, + "font": { + "name": "Font" + }, + "style": { + "name": "Label style", + "options": { + "fill": { + "name": "Fill only" + }, + "outline": { + "name": "Outline only" + }, + "fillAndOutline": { + "name": "Fill and outline" + } + } + }, + "scale": { + "name": "Scale" + }, + "fillColor": { + "name": "Fill color" + }, + "outlineColor": { + "name": "Outline color" + }, + "outlineWidth": { + "name": "Outline width" + }, + "horizontalOrigin": { + "name": "Horizontal origin", + "options": { + "left": { + "name": "Left" + }, + "center": { + "name": "Center" + }, + "right": { + "name": "Right" + } + } + }, + "verticalOrigin": { + "name": "Vertical origin", + "options": { + "top": { + "name": "Top" + }, + "center": { + "name": "Center" + }, + "baseline": { + "name": "Baseline" + }, + "bottom": { + "name": "Bottom" + } + } + }, + "offsetX": { + "name": "Pixel offset X" + }, + "offsetY": { + "name": "Pixel offset Y" + } + } + }, + "trail": { + "selectableDimensions": { + "leadTime": { + "name": "Lead time (secs)" + }, + "trailTime": { + "name": "Trail time (secs)" + }, + "width": { + "name": "Width" + }, + "resolution": { + "name": "Resolution" + }, + "growColor": { + "name": "Glow color" + }, + "growPower": { + "name": "Glow power" + }, + "taperPower": { + "name": "Taper power" + }, + "solidColor": { + "name": "Solid color" + }, + "trailStyleOptions": { + "name": "Trail style options", + "selectableDimensions": { + "material": { + "name": "Material type", + "options": { + "solidColor": { + "name": "Solid color" + }, + "polylineGlow": { + "name": "Polyline glow" + } + } + } + } + } + } + } } }, "deltaTool": { @@ -1628,5 +2128,13 @@ "mouseTooltipTitle": "Select location", "mouseTooltipMessage": "Right click to cancel" } + }, + "selectableDimensions": { + "undefinedLabel": "Not specified", + "enabled": "Enabled", + "disabled": "Disabled", + "colorAdd": "Add", + "colorRemove": "Remove", + "invalid": "Invalid" } } diff --git a/wwwroot/languages/ja/translation.json b/wwwroot/languages/ja/translation.json index f56687b37ca..f6e4628150b 100644 --- a/wwwroot/languages/ja/translation.json +++ b/wwwroot/languages/ja/translation.json @@ -273,9 +273,6 @@ "success": "クリップボードにコピーしました" }, "workbench": { - "dimensionsSelector": { - "undefinedLabel": "未指定" - }, "addItemErrorMessage": "カタログのアイテム追加の際にエラーが発生しました。", "addItemErrorTitle": "カタログのアイテムをワークベンチに追加できませんでした。", "toggleVisibility": "データの表示/非表示", @@ -1378,21 +1375,27 @@ "notSupportedErrorTitle": "2Dではサポートされていません" }, "tableData": { - "bulkGeocoderErrorMessage": "座標の取得時にエラーが発生したため、緯度経度を住所に対応づけることができませんでした。インターネット接続を確認するか時間をおいてやり直してください。", - "bulkGeocoderErrorTitle": "一括ジオコーダーエラー", - "bulkGeocoderInfo2Message": "{{nullAddresses}}個の住所がCSVにありませんでした。", - "bulkGeocoderInfoMessage": "CSVに含まれている住所のうち{{number}}個を地図で見つけることができませんでした ", - "bulkGeocoderInfoTitle": "一括ジオコーダー", - "unsupportedCharactersMessage": "{{longitude}}, {{latitude}}を緯度・経度の組として読み取ることができません", - "unsupportedCharactersTitle": "緯度・経度の列に無効な文字が含まれています", "noData": "表示するデータがありません", - "legendNullLabel": "(値無し)", - "legendZFilterLabel": "異常な値", - "zFilterEnabled": "異常な値は表示していません (クリックして表示)", - "zFilterDisabled": "異常値が見つかりました (クリックして非表示)", - "timeDimensionEnabled": "時間を有効 (クリックで無効)", - "styleDisabledLabel": "スタイルを無効", - "timeDimensionDisabled": "時間を無効 (クリックで有効)" + "unsupportedCharactersTitle": "緯度・経度の列に無効な文字が含まれています", + "unsupportedCharactersMessage": "{{longitude}}, {{latitude}}を緯度・経度の組として読み取ることができません", + "bulkGeocoderInfoTitle": "一括ジオコーダー", + "bulkGeocoderInfoMessage": "CSVに含まれている住所のうち{{number}}個を地図で見つけることができませんでした ", + "bulkGeocoderInfo2Message": "{{nullAddresses}}個の住所がCSVにありませんでした。", + "bulkGeocoderErrorTitle": "一括ジオコーダーエラー", + "bulkGeocoderErrorMessage": "座標の取得時にエラーが発生したため、緯度経度を住所に対応づけることができませんでした。インターネット接続を確認するか時間をおいてやり直してください。", + "legendZFilterLabel": "異常値", + "legendNullLabel": "(値なし)", + "activeStyle": "使用するスタイル", + "styleDisabledLabel": "スタイルなし", + "zFilterEnabled": "異常値が非表示 (クリックして表示)", + "zFilterDisabled": "異常値あり (クリックして非表示)", + "timeDimensionEnabled": "時系列表示が有効 (クリックで無効化)", + "timeDimensionDisabled": "時系列表示が無効 (クリックで有効化)", + "editStyle": "スタイルを編集", + "custom": "カスタム", + "regionMapping": "リージョンマッピング", + "regionColumn": "リージョン変数", + "manualRegionMapping": "手動のリージョンマッピング" }, "terriaJSONcatalog": { "serviceResponseErrorMessage": "TerriaJsonCatalogFunction JSON を受け取るはずでしたが、{{xhr}} を受け取りました", @@ -1518,6 +1521,503 @@ }, "showClippingBox": "クリップボックスを表示", "groupName": "クリップボックス" + }, + "tableStyling": { + "hideAdvancedOptions": "詳細オプションを非表示", + "showAdvancedOptions": "詳細オプションを表示", + "copyUserStratum": "ユーザー設定をクリップボードにコピー", + "name": "スタイル", + "reset": "デフォルトのスタイルを復元", + "data": { + "name": "データ", + "selectableDimensions": { + "dataset": { + "name": "データセット" + }, + "tableStyle": { + "dataset": "スタイル" + }, + "tableStyleType": { + "name": "シンボル設定", + "options": { + "fill": { + "name": "塗り色" + }, + "pointSize": { + "name": "点の大きさ" + }, + "point": { + "name": "点・マーカー" + }, + "outline": { + "name": "線" + }, + "label": { + "name": "ラベル" + }, + "trail": { + "name": "軌跡" + } + } + } + } + }, + "fill": { + "name": "塗り色", + "selectableDimensions": { + "tableColorColumn": { + "name": "変数" + }, + "dataType": { + "name": "変数の型 (上級者向け)" + }, + "type": { + "name": "カラースキームの種類", + "undefinedLabel": "選択してください", + "options": { + "noStyle": { + "name": "単色" + }, + "sequentialContinuous": { + "name": "単方向 (連続)" + }, + "sequentialDiscrete": { + "name": "単方向 (離散)" + }, + "divergingContinuous": { + "name": "双方向 (連続)" + }, + "divergingDiscrete": { + "name": "双方向 (離散)" + }, + "qualitative": { + "name": "分類" + }, + "customQualitative": { + "name": "カスタム (分類)" + }, + "customDiscrete": { + "name": "カスタム (離散)" + } + } + }, + "scheme": { + "name": "カラースキーム" + }, + "numberOfBins": { + "name": "階級の数" + } + } + }, + "min": { + "name": "最小" + }, + "displayRange": { + "name": "表示範囲", + "selectableDimensions": { + "max": { + "name": "最大" + } + } + }, + "bins": { + "name": "階級", + "selectableDimensions": { + "start": { + "name": "{{value1}} から {{value2}}", + "selectableDimensions": { + "color": { + "name": "色" + }, + "start": { + "name": "下限値" + }, + "stop": { + "name": "上限値" + } + } + } + } + }, + "colors": { + "name": "色の設定", + "selectableDimensions": { + "color": { + "name": "色" + }, + "value": { + "name": "値" + }, + "remove": { + "value": "削除" + }, + "add": { + "value": "追加" + } + } + }, + "nullColor": { + "name": "デフォルトの色" + }, + "outlierColor": { + "name": "外れ値の色" + }, + "additionalColors": { + "name": "その他の色", + "selectableDimensions": { + "regionColor": { + "name": "リージョンの色" + }, + "nullColor": { + "name": "デフォルトの色" + }, + "outlierColor": { + "name": "外れ値の色" + } + } + }, + "pointSize": { + "name": "点の大きさ", + "selectableDimensions": { + "pointSizeColumn": { + "name": "変数" + }, + "pointSizeNull": { + "name": "デフォルトの大きさ" + }, + "pointSizesFactor": { + "name": "係数" + }, + "pointSizeOffset": { + "name": "オフセット" + } + } + }, + "regionMapping": { + "name": "リージョンマッピング" + }, + "legend": { + "name": "凡例", + "selectableDimensions": { + "legendTitle": { + "name": "タイトル" + }, + "legendTicks": { + "name": "目盛りの数" + }, + "title": { + "name": "{{index}} 番目のタイトル" + } + } + }, + "styleOptions": { + "name": "スタイルオプション", + "selectableDimensions": { + "styleTitle": { + "name": "タイトル" + }, + "longitudeColumn": { + "name": "経度の変数" + }, + "latitudeColumn": { + "name": "緯度の変数" + } + } + }, + "timeOptions": { + "name": "時系列オプション", + "selectableDimensions": { + "tableTimeColumn": { + "name": "時刻の変数" + }, + "tableEndTimeColumn": { + "name": "終了時刻の変数" + }, + "tableTimeIdColumns": { + "name": "ID の変数" + }, + "tableTimeIsSampled": { + "name": "サンプリングデータとして扱う", + "options": { + "true": { + "name": "はい" + }, + "false": { + "name": "いいえ" + } + } + }, + "tableTimeDisplayDuration": { + "name": "表示時間" + }, + "tableTimeSpreadStartTime": { + "name": "開始時点ですべてのフィーチャーを表示する", + "options": { + "true": { + "name": "はい" + }, + "false": { + "name": "いいえ" + } + } + }, + "tableTimeSpreadFinishTime": { + "name": "終了時点ですべてのフィーチャーを表示する", + "options": { + "true": { + "name": "はい" + }, + "false": { + "name": "いいえ" + } + } + } + } + }, + "workbenchOptions": { + "name": "ワークベンチオプション", + "selectableDimensions": { + "tableStyleEnalbed": { + "name": "ワークベンチでスタイルを表示する", + "options": { + "true": { + "name": "表示" + }, + "false": { + "name": "非表示" + } + } + }, + "showDisableStyleOption": { + "name": "スタイルなしのオプションを表示" + }, + "showDisableTimeOption": { + "name": "時系列表示をオンオフできるようにする" + }, + "enableManualRegionMapping": { + "name": "手動のリージョンマッピングを有効にする" + } + } + }, + "variableAndColumn": { + "name": "変数/列", + "selectableDimensions": { + "columnTitle": { + "name": "タイトル" + }, + "columnUnits": { + "name": "単位" + } + } + }, + "style": { + "selectableDimensions": { + "column": { + "name": "変数" + }, + "styleType": { + "name": "スタイルのタイプ", + "undefinedLabel": "選択してください", + "constant": { + "name": "固定" + }, + "bin": { + "name": "離散" + }, + "enum": { + "name": "分類" + } + }, + "enum": { + "name": "分類", + "selectableDimensions": { + "enum": { + "noValue": "値なし", + "selectableDimensions": { + "value": { + "name": "値" + }, + "remove": { + "value": "削除" + } + }, + "add": { + "value": "追加" + } + } + } + }, + "bin": { + "name": "階級", + "selectableDimensions": { + "add": { + "value": "追加" + }, + "bin": { + "noValue": "値なし", + "range": "{{value1}} から {{value2}}", + "selectableDimensions": { + "start": { + "name": "下限値" + }, + "stop": { + "name": "上限値" + }, + "remove": { + "value": "削除" + } + } + } + } + } + }, + "null": { + "name": "デフォルト" + } + }, + "point": { + "name": "点・マーカー", + "selectableDimensions": { + "marker": { + "name": "マーカー", + "tooltip": "マーカーにはサポートされている画像形式 (PNG、SVG等) のURLとBase64が使用できます" + }, + "rotation": { + "name": "回転" + }, + "height": { + "name": "高さ" + }, + "width": { + "name": "幅" + } + } + }, + "outline": { + "name": "線", + "selectableDimensions": { + "color": "色", + "width": "太さ" + } + }, + "label": { + "name": "ラベル", + "selectableDimensions": { + "column": { + "name": "変数" + }, + "font": { + "name": "フォント" + }, + "style": { + "name": "ラベルのスタイル", + "options": { + "fill": { + "name": "塗り" + }, + "outline": { + "name": "輪郭" + }, + "fillAndOutline": { + "name": "塗りと輪郭" + } + } + }, + "scale": { + "name": "倍率" + }, + "fillColor": { + "name": "塗り色" + }, + "outlineColor": { + "name": "輪郭の色" + }, + "outlineWidth": { + "name": "輪郭の太さ" + }, + "horizontalOrigin": { + "name": "水平原点", + "options": { + "left": { + "name": "左" + }, + "center": { + "name": "中央" + }, + "right": { + "name": "右" + } + } + }, + "verticalOrigin": { + "name": "垂直原点", + "options": { + "top": { + "name": "上" + }, + "center": { + "name": "中央" + }, + "baseline": { + "name": "ベースライン" + }, + "bottom": { + "name": "下" + } + } + }, + "offsetX": { + "name": "ピクセルオフセットX" + }, + "offsetY": { + "name": "ピクセルオフセットY" + } + } + }, + "trail": { + "selectableDimensions": { + "leadTime": { + "name": "前方の軌跡の表示時間 (秒)" + }, + "trailTime": { + "name": "後方の軌跡の表示時間 (秒)" + }, + "width": { + "name": "太さ" + }, + "resolution": { + "name": "解像度" + }, + "growColor": { + "name": "輝きの色" + }, + "growPower": { + "name": "輝きの強さ" + }, + "taperPower": { + "name": "減衰" + }, + "solidColor": { + "name": "色" + }, + "trailStyleOptions": { + "name": "軌跡のスタイルオプション", + "selectableDimensions": { + "material": { + "name": "マテリアルタイプ", + "options": { + "solidColor": { + "name": "単色" + }, + "polylineGlow": { + "name": "輝き" + } + } + } + } + } + } + } } }, "map": { @@ -1706,5 +2206,13 @@ "firefox": "Mozilla Firefox", "safari": "Apple Safari", "edge": "Microsoft Edge" + }, + "selectableDimensions": { + "undefinedLabel": "指定されていません", + "enabled": "有効", + "disabled": "無効", + "colorAdd": "追加", + "colorRemove": "削除", + "invalid": "無効" } } From 85c8bd18aa12496f42aa988d9f639759f8a4737b Mon Sep 17 00:00:00 2001 From: Nick Forbes-Smith Date: Tue, 3 Oct 2023 12:34:49 +1000 Subject: [PATCH 03/53] Fix excludeMembers lowecase bug (#6915) --- CHANGES.md | 1 + lib/ModelMixins/GroupMixin.ts | 4 ++-- test/Models/Catalog/CatalogGroupSpec.ts | 10 +++++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 550acf4c56e..a20d2924bfc 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,7 @@ #### next release (8.3.6) - Fixed a bug where incorrect "Remove all" icon is shown when the trait `displayGroup` of some group types (e.g.`wms-group`) is set to `true` but the members have not been populated yet. +- Fix regression in `excludeMembers`, `id` and `name` should be lower-case for comparing. - [The next improvement] #### 8.3.5 - 2023-09-26 diff --git a/lib/ModelMixins/GroupMixin.ts b/lib/ModelMixins/GroupMixin.ts index 0bb82327536..9037a0e20c6 100644 --- a/lib/ModelMixins/GroupMixin.ts +++ b/lib/ModelMixins/GroupMixin.ts @@ -83,10 +83,10 @@ function GroupMixin>(Base: T) { // Get model name, apply includeMemberRegex and excludeMembers const modelName = CatalogMemberMixin.isMixedInto(model) - ? model.name?.trim() + ? model.name?.toLowerCase().trim() : undefined; - const modelId = model?.uniqueId?.trim(); + const modelId = model?.uniqueId?.toLowerCase().trim(); if ( model && // Does includeMemberRegex match model ID or model name diff --git a/test/Models/Catalog/CatalogGroupSpec.ts b/test/Models/Catalog/CatalogGroupSpec.ts index 27b2ce63ad1..6d18e9c143b 100644 --- a/test/Models/Catalog/CatalogGroupSpec.ts +++ b/test/Models/Catalog/CatalogGroupSpec.ts @@ -175,7 +175,7 @@ describe("CatalogGroup", function () { type: "group", id: "grandmama", name: "Test Group", - excludeMembers: ["grandchild1", "parent3", "some name"] + excludeMembers: ["grandchild1", "PARENT3", "some name"] }; upsertModelFromJson( CatalogMemberFactory, @@ -223,18 +223,18 @@ describe("CatalogGroup", function () { }, { type: "group", - id: "parent3" + id: "PARENT3" } ]); expect(item.excludeMembers).toEqual([ "grandchild1", - "parent3", + "PARENT3", "some name" ]); expect(item.mergedExcludeMembers).toEqual([ "grandchild1", - "parent3", + "PARENT3", "some name" ]); @@ -257,7 +257,7 @@ describe("CatalogGroup", function () { expect(parent1.mergedExcludeMembers).toEqual([ "grandchild4", "grandchild1", - "parent3", + "PARENT3", "some name" ]); }); From 178fb44f1d00781a258d9ea32970f5111f16f525 Mon Sep 17 00:00:00 2001 From: Mike Wu <41275384+mwu2018@users.noreply.github.com> Date: Tue, 3 Oct 2023 13:58:30 +1100 Subject: [PATCH 04/53] v8.3.6 (#6921) --- CHANGES.md | 7 +++++-- package.json | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index a20d2924bfc..490d3bb5d76 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,10 +1,13 @@ # Change Log -#### next release (8.3.6) +#### next release (8.3.7) + +- [The next improvement] + +#### 8.3.6 - 2023-10-03 - Fixed a bug where incorrect "Remove all" icon is shown when the trait `displayGroup` of some group types (e.g.`wms-group`) is set to `true` but the members have not been populated yet. - Fix regression in `excludeMembers`, `id` and `name` should be lower-case for comparing. -- [The next improvement] #### 8.3.5 - 2023-09-26 diff --git a/package.json b/package.json index a30e87258f2..35fc2b61343 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "terriajs", - "version": "8.3.5", + "version": "8.3.6", "description": "Geospatial data visualization platform.", "license": "Apache-2.0", "engines": { From 9b8748e522561de1b9b45c28718f34a124160d10 Mon Sep 17 00:00:00 2001 From: Zoran Kokeza Date: Tue, 3 Oct 2023 09:21:33 +0200 Subject: [PATCH 05/53] Fix basemaps doc --- doc/customizing/initialization-files.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/customizing/initialization-files.md b/doc/customizing/initialization-files.md index c91316db9a7..97d7d0d761e 100644 --- a/doc/customizing/initialization-files.md +++ b/doc/customizing/initialization-files.md @@ -246,7 +246,7 @@ Definition of the story. This can be pretty complex to define for the standard u Definition of the base map model. | Name | Required | Type | Default | Description | -| --------------------------------------------- | -------- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | +| --------------------------------------------- | -------- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `items` | no | [**`basemapItem`**](#basemap-item) | [default list of basemaps](https://github.com/TerriaJS/terriajs/blob/main/lib/Models/BaseMaps/defaultBaseMaps.ts) | The array of the base maps to be shown to the user. It will be combined with default list. To override the default basemap definition specify the id of the default basemap and parameter that need to be overriden. | | `defaultBaseMapId` | no | **`string`** | | The id of the baseMap user will see on the first mapLoad. The value must be an id of the catalog item from the [**`enabledBaseMaps`**](#enabledbasemaps) array. | | `previewBaseMapId` | no | **`string`** | | The id of the baseMap to be used as the base map in data preview. The value must be an id of the catalog item from the [**`enabledBaseMaps`**](#enabledbasemaps) array. | | From 0a086fa0b95702da389c666c1d47ac16c0e02e50 Mon Sep 17 00:00:00 2001 From: Zoran Kokeza Date: Tue, 3 Oct 2023 09:24:53 +0200 Subject: [PATCH 06/53] Update initialization-files.md From 853223acceeafad3af129b918e46013d5f8f8e50 Mon Sep 17 00:00:00 2001 From: Zoran Kokeza Date: Tue, 3 Oct 2023 09:25:44 +0200 Subject: [PATCH 07/53] Update initialization-files.md --- doc/customizing/initialization-files.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/customizing/initialization-files.md b/doc/customizing/initialization-files.md index 97d7d0d761e..dbe52897093 100644 --- a/doc/customizing/initialization-files.md +++ b/doc/customizing/initialization-files.md @@ -249,7 +249,7 @@ Definition of the base map model. | --------------------------------------------- | -------- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `items` | no | [**`basemapItem`**](#basemap-item) | [default list of basemaps](https://github.com/TerriaJS/terriajs/blob/main/lib/Models/BaseMaps/defaultBaseMaps.ts) | The array of the base maps to be shown to the user. It will be combined with default list. To override the default basemap definition specify the id of the default basemap and parameter that need to be overriden. | | `defaultBaseMapId` | no | **`string`** | | The id of the baseMap user will see on the first mapLoad. The value must be an id of the catalog item from the [**`enabledBaseMaps`**](#enabledbasemaps) array. | -| `previewBaseMapId` | no | **`string`** | | The id of the baseMap to be used as the base map in data preview. The value must be an id of the catalog item from the [**`enabledBaseMaps`**](#enabledbasemaps) array. | | +| `previewBaseMapId` | no | **`string`** | | The id of the baseMap to be used as the base map in data preview. The value must be an id of the catalog item from the [**`enabledBaseMaps`**](#enabledbasemaps) array. | | `enabledBaseMaps` | no | **`string[]`** | _all_ | Array of base maps ids that is available to user. Use this do define order of the base maps in settings panel. Leave undefined to show all basemaps. The values must be an ids of the catalog item from the [**`baseMaps items`**](#basemaps-items) array. | **Example** From 6ec16b5e6f7f6c3aed6b149f9f033d20ee68593d Mon Sep 17 00:00:00 2001 From: Nick Forbes-Smith Date: Wed, 4 Oct 2023 16:07:38 +1100 Subject: [PATCH 08/53] Add more problems and solutions --- doc/contributing/problems-and-solutions.md | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/doc/contributing/problems-and-solutions.md b/doc/contributing/problems-and-solutions.md index ce356111539..f389e97ef33 100644 --- a/doc/contributing/problems-and-solutions.md +++ b/doc/contributing/problems-and-solutions.md @@ -62,3 +62,41 @@ yarn gulp sync-terriajs-dependencies ``` --- + +### Problem + +I have already have NodeJS installed, but I need an early version for TerriaJS + +### Solution + +You can use [nvm](https://github.com/nvm-sh/nvm#installing-and-updating) to manage multiple versions of NodeJS. + +Follow installation instructions [here](https://github.com/nvm-sh/nvm#installing-and-updating). + +Then run the following to install NodeJS v16 and use it: + +```bash +nvm install 16 +nvm use 16 +``` + +--- + +### Problem + +Python errors when building NodeJS dependencies (eg `node-sass`). This is common on M1/M2 macs. + +### Solution + +You may need to install Python2 to build NodeJS dependencies (like `node-sass`) + +We recommend using [`pyenv`](https://github.com/pyenv/pyenv#installation) to install Python2. + +Follow installation instructions [here](https://github.com/pyenv/pyenv#installation). + +Then run the following to install Python 2.7.18 and use it: + +```bash +pyenv install 2.7.18 +pyenv shell 2.7.18 +``` From bed63fc7595d730e2220eda34c567fa076cb2189 Mon Sep 17 00:00:00 2001 From: Stephen Davies Date: Wed, 4 Oct 2023 18:06:28 +1100 Subject: [PATCH 09/53] Improve wording of docker build command custom image --- doc/deploying/deploying-with-kubernetes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/deploying/deploying-with-kubernetes.md b/doc/deploying/deploying-with-kubernetes.md index 371b2571e0c..00246106c89 100644 --- a/doc/deploying/deploying-with-kubernetes.md +++ b/doc/deploying/deploying-with-kubernetes.md @@ -37,7 +37,7 @@ terriamap: # Building Your Own Image -You can build your own TerriaMap image +You can build your own TerriaMap image. Choose your own `app-name` and `tag` - e.g. `awesome-map:1.0.0` - and put them into the command below: ```bash docker build -t app-name:tag . From 3427b2ca2a16aa948c017c72efffa4d82bff39f3 Mon Sep 17 00:00:00 2001 From: Stephen Davies Date: Wed, 4 Oct 2023 18:10:28 +1100 Subject: [PATCH 10/53] Further clarifying improvements --- doc/deploying/deploying-with-kubernetes.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/doc/deploying/deploying-with-kubernetes.md b/doc/deploying/deploying-with-kubernetes.md index 00246106c89..6fb5ebb56a3 100644 --- a/doc/deploying/deploying-with-kubernetes.md +++ b/doc/deploying/deploying-with-kubernetes.md @@ -37,7 +37,7 @@ terriamap: # Building Your Own Image -You can build your own TerriaMap image. Choose your own `app-name` and `tag` - e.g. `awesome-map:1.0.0` - and put them into the command below: +You can build your own TerriaMap image. Choose your own `app-name` and `tag` (e.g. `awesome-map:1.0.0`) and put them into the command below: ```bash docker build -t app-name:tag . @@ -52,7 +52,7 @@ If you want to run a local version of TerriaMap using Kubernetes then you can tr Or try a tool recommended in the [official Kuberntes setup documentation](https://kubernetes.io/docs/setup/). -Then run: +Then, using the same `app-name` & `tag` that you chose when building the image, run: ```bash docker build -t app-name:tag . @@ -60,6 +60,4 @@ docker build -t app-name:tag . helm upgrade --install -f deploy/helm/example-prod.yml terria deploy/helm/terria --set terriamap.image.full=app-name:tag --set global.image.pullPolicy=Never ``` -using the same `app-name` & `tag` in both. - You can repeat the command `docker build -t app-name:tag .` and delete the terria-terriamap pod to update it, and you can run the above `helm upgrade` command after modifying or copying `example-prod.yml` to change the config. From 3226af3df01ebf9143c32adf13fa89a82020015b Mon Sep 17 00:00:00 2001 From: Nick Forbes-Smith Date: Wed, 4 Oct 2023 22:00:11 +1100 Subject: [PATCH 11/53] Remove all now removes all pickedFeatures --- CHANGES.md | 1 + lib/ReactViews/Workbench/Workbench.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 490d3bb5d76..368876ed9ed 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,7 @@ #### next release (8.3.7) +- Fix "Remove all" not removing selected/picked features - [The next improvement] #### 8.3.6 - 2023-10-03 diff --git a/lib/ReactViews/Workbench/Workbench.tsx b/lib/ReactViews/Workbench/Workbench.tsx index ed9c55291f8..90526099a6e 100644 --- a/lib/ReactViews/Workbench/Workbench.tsx +++ b/lib/ReactViews/Workbench/Workbench.tsx @@ -52,6 +52,7 @@ class Workbench extends React.Component { DataSourceAction.removeAllFromWorkbench, getPath(item) ); + this.props.terria.removeSelectedFeaturesForModel(item); }); this.props.terria.workbench.removeAll(); (this.props.terria.timelineStack.items as any).clear(); From 2069044877e02423417f1488c22a5fcb290a815c Mon Sep 17 00:00:00 2001 From: Lawrence Owen Date: Thu, 5 Oct 2023 14:22:35 +1000 Subject: [PATCH 12/53] Remove usages of construct --- .../Analytics/GeoJsonParameterEditor.jsx | 12 +- lib/ReactViews/Analytics/InvokeFunction.jsx | 4 +- lib/ReactViews/Analytics/ParameterEditor.jsx | 23 +- .../Analytics/PointParameterEditor.jsx | 4 +- .../BottomDock/Timeline/Timeline.jsx | 32 +- .../CleanDropdownPanel/CleanDropdownPanel.jsx | 4 +- lib/ReactViews/DataCatalog/CatalogGroup.jsx | 16 +- lib/ReactViews/DataCatalog/DataCatalog.jsx | 20 +- .../DataCatalog/DataCatalogGroup.jsx | 4 +- .../ExplorerWindow/Tabs/MyDataTab/AddData.jsx | 154 +++---- .../Tabs/MyDataTab/MyDataTab.jsx | 72 ++-- lib/ReactViews/Map/MenuBar/MenuBar.jsx | 12 +- lib/ReactViews/Map/Panels/DropdownPanel.jsx | 12 +- .../Map/Panels/HelpPanel/HelpVideoPanel.jsx | 68 +-- lib/ReactViews/Map/Panels/InnerPanel.jsx | 8 +- lib/ReactViews/Map/Panels/MobilePanel.jsx | 30 +- .../Map/Panels/SharePanel/StorySharePanel.jsx | 4 +- .../Map/Panels/ToolsPanel/ToolsPanel.jsx | 4 +- lib/ReactViews/Mobile/MobileHeader.jsx | 4 +- lib/ReactViews/Mobile/MobileMenu.jsx | 21 +- lib/ReactViews/Mobile/MobileModalWindow.jsx | 8 +- lib/ReactViews/Mobile/MobileSearch.jsx | 37 +- .../Notification/NotificationWindow.jsx | 4 +- lib/ReactViews/Preview/DataPreviewUrl.jsx | 24 +- lib/ReactViews/Preview/Description.jsx | 389 +++++++++--------- lib/ReactViews/Preview/GroupPreview.jsx | 26 +- lib/ReactViews/Preview/MappablePreview.jsx | 62 ++- lib/ReactViews/Preview/MetadataTable.jsx | 20 +- lib/ReactViews/Search/Breadcrumbs.jsx | 4 +- lib/ReactViews/Search/SearchBoxAndResults.jsx | 4 +- .../WelcomeMessage/WelcomeMessage.jsx | 132 +++--- .../Workbench/Controls/TimerSection.jsx | 4 +- 32 files changed, 591 insertions(+), 631 deletions(-) diff --git a/lib/ReactViews/Analytics/GeoJsonParameterEditor.jsx b/lib/ReactViews/Analytics/GeoJsonParameterEditor.jsx index b04ddc5efa8..fe9b4000a30 100644 --- a/lib/ReactViews/Analytics/GeoJsonParameterEditor.jsx +++ b/lib/ReactViews/Analytics/GeoJsonParameterEditor.jsx @@ -121,16 +121,8 @@ class GeoJsonParameterEditor extends React.Component { this.props.parameter )} /> - -
{t("analytics.nothingSelected")}
-
+ {getDisplayValue(this.props.parameter.value, this.props.parameter) === + "" &&
{t("analytics.nothingSelected")}
}
); } diff --git a/lib/ReactViews/Analytics/InvokeFunction.jsx b/lib/ReactViews/Analytics/InvokeFunction.jsx index 322f417f5cc..b58172ff7ec 100644 --- a/lib/ReactViews/Analytics/InvokeFunction.jsx +++ b/lib/ReactViews/Analytics/InvokeFunction.jsx @@ -128,12 +128,12 @@ class InvokeFunction extends React.Component {

{this.props.previewed.name}

- + {this.props.previewed.loadMetadataResult?.error && ( - + )}
{parseCustomMarkdownToReact(this.props.previewed.description, { catalogItem: this.props.previewed diff --git a/lib/ReactViews/Analytics/ParameterEditor.jsx b/lib/ReactViews/Analytics/ParameterEditor.jsx index efd9ce3a684..6f11239bcff 100644 --- a/lib/ReactViews/Analytics/ParameterEditor.jsx +++ b/lib/ReactViews/Analytics/ParameterEditor.jsx @@ -265,17 +265,20 @@ ParameterEditor.parameterTypeConverters = [ )[0]; return (
- - {parameterEditor.renderLabel()} - - - + {regionParam === undefined && ( + <> + {parameterEditor.renderLabel()} + + + )} + + {!parameterEditor.props.parameter.showInUi && (
- + )}
); } diff --git a/lib/ReactViews/Analytics/PointParameterEditor.jsx b/lib/ReactViews/Analytics/PointParameterEditor.jsx index 874271c1843..2fcec4baf8e 100644 --- a/lib/ReactViews/Analytics/PointParameterEditor.jsx +++ b/lib/ReactViews/Analytics/PointParameterEditor.jsx @@ -71,11 +71,11 @@ const PointParameterEditor = createReactClass({ const { t } = this.props; return (
- + {showErrorMessage && (
{t("analytics.enterValidCoords")}
-
+ )} - - this.changeDateTime()} - openDirection="up" - isOpen={this.state.isPickerOpen} - onOpen={() => this.onOpenPicker()} - onClose={() => this.onClosePicker()} - dateFormat={catalogItem.dateFormat} - /> - + {defined(discreteTimes) && + discreteTimes.length !== 0 && + defined(currentDiscreteJulianDate) && ( + this.changeDateTime()} + openDirection="up" + isOpen={this.state.isPickerOpen} + onOpen={() => this.onOpenPicker()} + onClose={() => this.onClosePicker()} + dateFormat={catalogItem.dateFormat} + /> + )}
diff --git a/lib/ReactViews/CleanDropdownPanel/CleanDropdownPanel.jsx b/lib/ReactViews/CleanDropdownPanel/CleanDropdownPanel.jsx index e35901ac0de..e40d58b2ff2 100644 --- a/lib/ReactViews/CleanDropdownPanel/CleanDropdownPanel.jsx +++ b/lib/ReactViews/CleanDropdownPanel/CleanDropdownPanel.jsx @@ -93,7 +93,7 @@ const CleanDropdownPanel = createReactClass({ ${this.props.cleanDropdownPanelStyles} `} > - + {this.isOpen() && ( {this.props.children} - + )} ); } diff --git a/lib/ReactViews/DataCatalog/CatalogGroup.jsx b/lib/ReactViews/DataCatalog/CatalogGroup.jsx index 58ef95040d4..8307c38d53e 100644 --- a/lib/ReactViews/DataCatalog/CatalogGroup.jsx +++ b/lib/ReactViews/DataCatalog/CatalogGroup.jsx @@ -39,9 +39,9 @@ function CatalogGroup(props) {
  • {/* If this is a display group, show the "PlusList" button */} - {/* TODO: This should be superimposed on the above button. + {/* TODO: This should be superimposed on the above button. We cannot have a button within a button, so maybe use z-values and superimpose */} - {/* TODO: Maybe this should be a component with a 'mode' flag. + {/* TODO: Maybe this should be a component with a 'mode' flag. With a different appearance and onClick function depending on the mode */} {props.displayGroup === true && ( @@ -79,7 +79,7 @@ function CatalogGroup(props) { onClick={props.onClick} active={props.selected} > - + {!props.topLevel && ( {props.open ? ( @@ -87,7 +87,7 @@ function CatalogGroup(props) { )} - + )} {props.text} @@ -104,7 +104,7 @@ function CatalogGroup(props) { )} {/* This next button is for user added data, and perhaps should be called 'trashable' instead of 'removable' */} - + {props.removable && ( - + )} - + {props.open && (
      {props.children}
    -
    + )}
  • ); } diff --git a/lib/ReactViews/DataCatalog/DataCatalog.jsx b/lib/ReactViews/DataCatalog/DataCatalog.jsx index 65690cef0aa..cf0fe0a197b 100644 --- a/lib/ReactViews/DataCatalog/DataCatalog.jsx +++ b/lib/ReactViews/DataCatalog/DataCatalog.jsx @@ -39,15 +39,17 @@ class DataCatalog extends React.Component { const { t } = this.props; return (
      - - - - + {isSearching && catalogSearchProvider && ( + <> + + + + )} {item !== this.props.terria.catalog.userAddedDataGroup && ( - + {this.isOpen() && ( - + )} ); } diff --git a/lib/ReactViews/ExplorerWindow/Tabs/MyDataTab/AddData.jsx b/lib/ReactViews/ExplorerWindow/Tabs/MyDataTab/AddData.jsx index c1c148943e3..10d48f53479 100644 --- a/lib/ReactViews/ExplorerWindow/Tabs/MyDataTab/AddData.jsx +++ b/lib/ReactViews/ExplorerWindow/Tabs/MyDataTab/AddData.jsx @@ -216,83 +216,87 @@ const AddData = createReactClass({ return (
      - -
      {t("addData.localAdd")}
      -
      - - - {this.state.localDataType?.description - ? parseCustomMarkdownToReactWithOptions( - this.state.localDataType?.description - ) - : null} - - - {this.state.isLoading && } -
      -
      - -
      {t("addData.webAdd")}
      -
      - - - {this.state.remoteDataType?.description - ? parseCustomMarkdownToReactWithOptions( - this.state.remoteDataType?.description - ) - : null} - -
      - +
      {t("addData.localAdd")}
      +
      + + + {this.state.localDataType?.description + ? parseCustomMarkdownToReactWithOptions( + this.state.localDataType?.description + ) + : null} + + - {this.state.isLoading && } - -
      - +
      + + )} + {this.props.activeTab === "web" && ( + <> +
      {t("addData.webAdd")}
      +
      + + + {this.state.remoteDataType?.description + ? parseCustomMarkdownToReactWithOptions( + this.state.remoteDataType?.description + ) + : null} + +
      + + + {this.state.isLoading && } + +
      + + )}
      ); }, diff --git a/lib/ReactViews/ExplorerWindow/Tabs/MyDataTab/MyDataTab.jsx b/lib/ReactViews/ExplorerWindow/Tabs/MyDataTab/MyDataTab.jsx index 2331e66977b..de13e91044f 100644 --- a/lib/ReactViews/ExplorerWindow/Tabs/MyDataTab/MyDataTab.jsx +++ b/lib/ReactViews/ExplorerWindow/Tabs/MyDataTab/MyDataTab.jsx @@ -137,37 +137,39 @@ class MyDataTab extends React.Component { [Styles.oneCol]: !showTwoColumn })} > - - - this.resetTab()} - onFileAddFinished={this.props.onFileAddFinished} - onUrlAddFinished={this.props.onUrlAddFinished} - localDataTypes={this.props.localDataTypes} - remoteDataTypes={this.props.remoteDataTypes} - /> - - + {this.state.activeTab && ( + <> + + this.resetTab()} + onFileAddFinished={this.props.onFileAddFinished} + onUrlAddFinished={this.props.onUrlAddFinished} + localDataTypes={this.props.localDataTypes} + remoteDataTypes={this.props.remoteDataTypes} + /> + + )} + {showTwoColumn && (

      @@ -188,10 +190,10 @@ class MyDataTab extends React.Component { />

    - - {this.renderPromptBox()} + )} + {!this.state.activeTab && this.renderPromptBox()}
    - + {showTwoColumn && ( - + )} ); } diff --git a/lib/ReactViews/Map/MenuBar/MenuBar.jsx b/lib/ReactViews/Map/MenuBar/MenuBar.jsx index 51466898134..80831e80cc2 100644 --- a/lib/ReactViews/Map/MenuBar/MenuBar.jsx +++ b/lib/ReactViews/Map/MenuBar/MenuBar.jsx @@ -56,13 +56,13 @@ const MenuBar = observer((props) => { )} - + {!viewState.useSmallScreenInterface && (
  • {element}
  • -
    + )}
    @@ -83,7 +83,7 @@ const MenuBar = observer((props) => { ) : null} - + {storyEnabled && (
    • { />
    -
    + )}
    • { />
    - + {!viewState.useSmallScreenInterface && (
  • {element}
  • -
    + )}
    ); diff --git a/lib/ReactViews/Map/Panels/DropdownPanel.jsx b/lib/ReactViews/Map/Panels/DropdownPanel.jsx index de08a135ec0..2ecd9bbc4fa 100644 --- a/lib/ReactViews/Map/Panels/DropdownPanel.jsx +++ b/lib/ReactViews/Map/Panels/DropdownPanel.jsx @@ -111,14 +111,10 @@ const DropdownPanel = createReactClass({ }`} `} > - - - - - {this.props.btnText} - + {this.props.theme.icon && } + {this.props.btnText && {this.props.btnText}} - + {this.isOpen() && ( {this.props.children} - + )}
    ); } diff --git a/lib/ReactViews/Map/Panels/HelpPanel/HelpVideoPanel.jsx b/lib/ReactViews/Map/Panels/HelpPanel/HelpVideoPanel.jsx index 1a4aac2c5e5..93101fe8cfc 100644 --- a/lib/ReactViews/Map/Panels/HelpPanel/HelpVideoPanel.jsx +++ b/lib/ReactViews/Map/Panels/HelpPanel/HelpVideoPanel.jsx @@ -76,50 +76,52 @@ class HelpVideoPanel extends React.Component { `} scroll > - - {this.props.videoUrl && this.props.placeholderImage && ( -
    -
    - + +
    +
    - -
    - )} - {this.props.markdownContent && ( - - )} - - + )} + {this.props.markdownContent && ( + + )} + + )} + {helpItemType === "slider" && ( - - + )} + {helpItemType === "trainer" && ( - + )} ) diff --git a/lib/ReactViews/Map/Panels/InnerPanel.jsx b/lib/ReactViews/Map/Panels/InnerPanel.jsx index 5eec2290d3b..c2594e35187 100644 --- a/lib/ReactViews/Map/Panels/InnerPanel.jsx +++ b/lib/ReactViews/Map/Panels/InnerPanel.jsx @@ -161,11 +161,7 @@ const InnerPanel = createReactClass({ > - + {defined(this.props.caretOffset) && !this.props.showDropdownAsModal && ( p.theme.dark}; `} /> - + )}
    {this.props.children}
    ); diff --git a/lib/ReactViews/Map/Panels/MobilePanel.jsx b/lib/ReactViews/Map/Panels/MobilePanel.jsx index bf5f1f72189..39c2e0220ce 100644 --- a/lib/ReactViews/Map/Panels/MobilePanel.jsx +++ b/lib/ReactViews/Map/Panels/MobilePanel.jsx @@ -29,20 +29,22 @@ const MobilePanel = createReactClass({ caption={this.props.btnText} icon={this.props.mobileIcon} /> - - {/* The overlay doesn't actually need to do anything except block clicks, as InnerPanel will listen to the window */} -
    - - - {this.props.children} - - + {this.isOpen() && ( + <> + {/* The overlay doesn't actually need to do anything except block clicks, as InnerPanel will listen to the window */} +
    + + + {this.props.children} + + + )}
    ); } diff --git a/lib/ReactViews/Map/Panels/SharePanel/StorySharePanel.jsx b/lib/ReactViews/Map/Panels/SharePanel/StorySharePanel.jsx index 084178915bf..9b80b1c78fc 100644 --- a/lib/ReactViews/Map/Panels/SharePanel/StorySharePanel.jsx +++ b/lib/ReactViews/Map/Panels/SharePanel/StorySharePanel.jsx @@ -76,7 +76,7 @@ const StorySharePanel = createReactClass({ > {this.props.btnText ? this.props.btnText : ""} - + {this.isOpen() && (
    -
    + )} ); } diff --git a/lib/ReactViews/Map/Panels/ToolsPanel/ToolsPanel.jsx b/lib/ReactViews/Map/Panels/ToolsPanel/ToolsPanel.jsx index 397c7e51cf3..634f6ac8165 100644 --- a/lib/ReactViews/Map/Panels/ToolsPanel/ToolsPanel.jsx +++ b/lib/ReactViews/Map/Panels/ToolsPanel/ToolsPanel.jsx @@ -30,13 +30,13 @@ const ToolsPanel = observer(() => { isOpen={isOpen} smallScreen={viewState.useSmallScreenInterface} > - + {isOpen && (
    -
    + )}
    diff --git a/lib/ReactViews/Mobile/MobileHeader.jsx b/lib/ReactViews/Mobile/MobileHeader.jsx index 63800fa92a2..0c24824cace 100644 --- a/lib/ReactViews/Mobile/MobileHeader.jsx +++ b/lib/ReactViews/Mobile/MobileHeader.jsx @@ -194,7 +194,7 @@ class MobileHeader extends React.Component { styledHeight="20px" /> - 0}> + {nowViewingLength > 0 && ( - + )} - + )}
    - + {denyText && ( - + )} diff --git a/lib/ReactViews/Preview/DataPreviewUrl.jsx b/lib/ReactViews/Preview/DataPreviewUrl.jsx index 83ae3bbc605..420d29b98ec 100644 --- a/lib/ReactViews/Preview/DataPreviewUrl.jsx +++ b/lib/ReactViews/Preview/DataPreviewUrl.jsx @@ -23,7 +23,7 @@ const DataPreviewUrl = createReactClass({ return (

    {this.props.metadataItem.typeName} URL

    - + {this.props.metadataItem.type === "wms" && (

    This is a @@ -38,8 +38,8 @@ const DataPreviewUrl = createReactClass({ software with this URL:

    -
    - + )} + {this.props.metadataItem.type === "wfs" && (

    This is a @@ -54,7 +54,7 @@ const DataPreviewUrl = createReactClass({ GIS software with this URL:

    -
    + )} - + {(this.props.metadataItem.type === "wms" || + (this.props.metadataItem.type === "esri-mapServer" && + this.props.metadataItem.layers)) && (

    Layer name {this.props.metadataItem.layers.split(",").length > 1 ? "s" : ""}: {this.props.metadataItem.layers}

    -
    - + )} + {this.props.metadataItem.type === "wfs" && (

    Type name {this.props.metadataItem.typeNames.split(",").length > 1 ? "s" : ""} : {this.props.metadataItem.typeNames}

    -
    + )}
    ); } diff --git a/lib/ReactViews/Preview/Description.jsx b/lib/ReactViews/Preview/Description.jsx index cfb32fdd38c..444b71a5316 100644 --- a/lib/ReactViews/Preview/Description.jsx +++ b/lib/ReactViews/Preview/Description.jsx @@ -42,164 +42,159 @@ class Description extends React.Component { } `} > - + {catalogItem.isExperiencingIssues && ( {t("preview.mayBeExperiencingIssues")} - + )} - 0 - } - > + {catalogItem.description && catalogItem.description.length > 0 && (

    {t("description.name")}

    {parseCustomMarkdownToReact(catalogItem.description, { catalogItem: catalogItem })}
    -
    + )} - -

    {t("description.dataLocal")}

    -
    + {catalogItem.hasLocalData &&

    {t("description.dataLocal")}

    } - + {!catalogItem.hasLocalData && !catalogItem.hasDescription && (

    {t("description.dataNotLocal")}

    -
    + )} - 0}> -

    {t("description.metadataUrls")}

    - - - p.theme.colorPrimary}; - `} - > - - - - {metadataUrl.url} - - - -
    + {metadataUrls && metadataUrls.length > 0 && ( + <> +

    {t("description.metadataUrls")}

    + + + p.theme.colorPrimary}; + `} + > + {metadataUrl.title && ( + + )} + {!metadataUrl.title ? metadataUrl.url : null} + + + + + )} - 0 - } - > + {catalogItem.dataCustodian && catalogItem.dataCustodian.length > 0 && (

    {t("description.dataCustodian")}

    {parseCustomMarkdownToReact(catalogItem.dataCustodian, { catalogItem: catalogItem })}
    -
    + )} - - -

    {catalogItem.typeName} URL

    - - -

    - - This is a - - WMS service - - , which generates map images on request. It can be used in - GIS software with this URL: - -

    -
    - -

    - - This is a - - WFS service - - , which transfers raw spatial data on request. It can be - used in GIS software with this URL: - -

    -
    -
    + {!catalogItem.hideSource && ( + <> + {catalogItem.url && ( + <> +

    {catalogItem.typeName} URL

    + + +

    + + This is a + + WMS service + + , which generates map images on request. It can be used + in GIS software with this URL: + +

    +
    + +

    + + This is a + + WFS service + + , which transfers raw spatial data on request. It can be + used in GIS software with this URL: + +

    +
    +
    - - - {catalogItem.url} - - - e.target.select()} - /> - - + + + {catalogItem.url} + + + e.target.select()} + /> + + - - -

    - {t("description.layerName")} - {(catalogItem.layers || "").split(",").length > 1 - ? "s" - : ""}: {catalogItem.layers} -

    -
    - -

    - {t("description.typeName")} - {(catalogItem.typeNames || "").split(",").length > 1 - ? "s" - : ""} - : {catalogItem.typeNames} -

    -
    -
    -
    + + +

    + {t("description.layerName")} + {(catalogItem.layers || "").split(",").length > 1 + ? "s" + : ""} + : {catalogItem.layers} +

    +
    + +

    + {t("description.typeName")} + {(catalogItem.typeNames || "").split(",").length > 1 + ? "s" + : ""} + : {catalogItem.typeNames} +

    +
    +
    + + )} - 0}> -

    {t("description.dataUrl")}

    - - - - {dataUrl.type?.startsWith("wfs") && - parseCustomMarkdownToReact( - t("description.useLinkBelow", { - link: ` + {dataUrls && dataUrls.length > 0 && ( + <> +

    {t("description.dataUrl")}

    + + + + {dataUrl.type?.startsWith("wfs") && + parseCustomMarkdownToReact( + t("description.useLinkBelow", { + link: ` ` - }) - )} - {dataUrl.type?.startsWith("wcs") && - parseCustomMarkdownToReact( - t("description.useLinkBelow", { - link: ` + }) + )} + {dataUrl.type?.startsWith("wcs") && + parseCustomMarkdownToReact( + t("description.useLinkBelow", { + link: ` ` - }) - )} - - - - p.theme.colorPrimary}; - `} - > - - - - {dataUrl.url} - - - -
    + }) + )} + + + + p.theme.colorPrimary}; + `} + > + {dataUrl.title && ( + + )} + {!dataUrl.title ? dataUrl.url : null} + + + + + )} - - 0 - } - > -
    - - - -
    -
    - 0 - } - > -
    - - - -
    -
    -
    -
    + {!this.props.printView && defined(catalogItem.metadata) && ( + <> + {defined(catalogItem.metadata.dataSourceMetadata) && + catalogItem.metadata.dataSourceMetadata.items.length > 0 && ( +
    + + + +
    + )} + {defined(catalogItem.metadata.dataSourceMetadata) && + catalogItem.metadata.dataSourceMetadata.items.length > 0 && ( +
    + + + +
    + )} + + )} + + )} {!this.props.printView ? ( ) : null} diff --git a/lib/ReactViews/Preview/GroupPreview.jsx b/lib/ReactViews/Preview/GroupPreview.jsx index c412a96ca37..65f49d82c88 100644 --- a/lib/ReactViews/Preview/GroupPreview.jsx +++ b/lib/ReactViews/Preview/GroupPreview.jsx @@ -74,18 +74,18 @@ class GroupPreview extends React.Component { />
    - + {this.props.previewed.loadMetadataResult?.error && ( - - + )} + {this.props.previewed.loadMembersResult?.error && ( - + )}
    @@ -107,24 +107,20 @@ class GroupPreview extends React.Component { - + {metadataItem.dataCustodian && (

    {t("preview.dataCustodian")}

    {parseCustomMarkdownToReact(metadataItem.dataCustodian, { catalogItem: metadataItem })}
    -
    + )} - - - + {metadataItem.url && + metadataItem.url.length && + !metadataItem.hideSource && ( + + )}
    diff --git a/lib/ReactViews/Preview/MappablePreview.jsx b/lib/ReactViews/Preview/MappablePreview.jsx index 61b7a8c3541..2d21f3d34b5 100644 --- a/lib/ReactViews/Preview/MappablePreview.jsx +++ b/lib/ReactViews/Preview/MappablePreview.jsx @@ -66,21 +66,17 @@ class MappablePreview extends React.Component { const catalogItem = this.props.previewed; return (
    - - - + {MappableMixin.isMixedInto(catalogItem) && + !catalogItem.disablePreview && ( + + )}
    - + {catalogItem.loadMetadataResult?.error && ( - - + )} + {catalogItem.loadMapItemsResult?.error && ( - + )} diff --git a/lib/ReactViews/Preview/MetadataTable.jsx b/lib/ReactViews/Preview/MetadataTable.jsx index 89ba5d80ba4..1f270582971 100644 --- a/lib/ReactViews/Preview/MetadataTable.jsx +++ b/lib/ReactViews/Preview/MetadataTable.jsx @@ -29,15 +29,11 @@ const MetadataTable = createReactClass({ - 0 && isJoinable(metadataItem) - } - > + {metadataItem.length > 0 && isJoinable(metadataItem) && ( {metadataItem.join(", ")} - + )} 0 && !isArr}> @@ -54,14 +50,10 @@ const MetadataTable = createReactClass({ isObservableArray(metadataItem[key]) } > - 0 && - isJoinable(metadataItem[key]) - } - > - {metadataItem[key].join(", ")} - + {metadataItem[key].length > 0 && + isJoinable(metadataItem[key]) + ? metadataItem[key].join(", ") + : null} {metadataItem[key]} diff --git a/lib/ReactViews/Search/Breadcrumbs.jsx b/lib/ReactViews/Search/Breadcrumbs.jsx index c70435a7b3d..c863f43054d 100644 --- a/lib/ReactViews/Search/Breadcrumbs.jsx +++ b/lib/ReactViews/Search/Breadcrumbs.jsx @@ -99,13 +99,13 @@ class Breadcrumbs extends React.Component { - + {i !== parentGroups.length - 1 && ( {">"} - + )} )} diff --git a/lib/ReactViews/Search/SearchBoxAndResults.jsx b/lib/ReactViews/Search/SearchBoxAndResults.jsx index 36f5fd82645..73de17a905e 100644 --- a/lib/ReactViews/Search/SearchBoxAndResults.jsx +++ b/lib/ReactViews/Search/SearchBoxAndResults.jsx @@ -165,7 +165,7 @@ export class SearchBoxAndResultsRaw extends React.Component { /> {/* Results */} - + {shouldShowResults && ( - + )} ); diff --git a/lib/ReactViews/WelcomeMessage/WelcomeMessage.jsx b/lib/ReactViews/WelcomeMessage/WelcomeMessage.jsx index 5ef747bb44f..1df80969196 100644 --- a/lib/ReactViews/WelcomeMessage/WelcomeMessage.jsx +++ b/lib/ReactViews/WelcomeMessage/WelcomeMessage.jsx @@ -241,72 +241,78 @@ export const WelcomeMessagePure = (props) => { - - - { - viewState.terria.configParameters.welcomeMessageVideo - .videoTitle - } - - - - - - + + { viewState.terria.configParameters.welcomeMessageVideo - .placeholderImage + .videoTitle } - backgroundBlackOverlay={"50%"} - > - - viewState.setVideoGuideVisible(WELCOME_MESSAGE_VIDEO) + + + + )} + + {!viewState.useSmallScreenInterface && ( + <> + - - - - - + + viewState.setVideoGuideVisible(WELCOME_MESSAGE_VIDEO) + } + > + + + + + + )} - - { - handleClose(false); - // not sure if we should wait for the exit animation, - // if we don't, we have a flicker due to the difference - // in overlay darkness - but if we wait, it goes - // dark -> light -> dark anyway.. - setShouldTakeTour(true); - viewState.setTourIndex(0); - viewState.setShowTour(true); - viewState.setTopElement(TourPortalDisplayName); - }} - buttonText={t("welcomeMessage.tourBtnText")} - buttonIcon={Icon.GLYPHS.tour} - /> - - { - handleClose(false); - setShouldOpenHelp(true); - }} - /> - + {!viewState.useSmallScreenInterface && ( + <> + { + handleClose(false); + // not sure if we should wait for the exit animation, + // if we don't, we have a flicker due to the difference + // in overlay darkness - but if we wait, it goes + // dark -> light -> dark anyway.. + setShouldTakeTour(true); + viewState.setTourIndex(0); + viewState.setShowTour(true); + viewState.setTopElement(TourPortalDisplayName); + }} + buttonText={t("welcomeMessage.tourBtnText")} + buttonIcon={Icon.GLYPHS.tour} + /> + + { + handleClose(false); + setShouldOpenHelp(true); + }} + /> + + )} { )} - - - + {!viewState.useSmallScreenInterface && } diff --git a/lib/ReactViews/Workbench/Controls/TimerSection.jsx b/lib/ReactViews/Workbench/Controls/TimerSection.jsx index e6a0d07399f..f72abafe627 100644 --- a/lib/ReactViews/Workbench/Controls/TimerSection.jsx +++ b/lib/ReactViews/Workbench/Controls/TimerSection.jsx @@ -110,7 +110,7 @@ class TimerSection extends React.Component { const { t } = this.props; return ( <> - + {this.isEnabled() && (
    - + )} ); } From 33dc01bda6f79fc1b26cacc644121ed0963a7808 Mon Sep 17 00:00:00 2001 From: Nick Forbes-Smith Date: Fri, 6 Oct 2023 21:02:48 +1100 Subject: [PATCH 13/53] Fix WMS allowFeaturePicking --- CHANGES.md | 1 + .../Catalog/Ows/WebMapServiceCatalogItem.ts | 9 ++- .../Ows/WebMapServiceCatalogItemSpec.ts | 81 +++++++++++++++++++ 3 files changed, 88 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 490d3bb5d76..839f0941e5f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,7 @@ #### next release (8.3.7) +- Fix `WebMapServiceCatalogItem` `allowFeaturePicking` - [The next improvement] #### 8.3.6 - 2023-10-03 diff --git a/lib/Models/Catalog/Ows/WebMapServiceCatalogItem.ts b/lib/Models/Catalog/Ows/WebMapServiceCatalogItem.ts index 3ce6fd42aa7..0ef921f6ff3 100644 --- a/lib/Models/Catalog/Ows/WebMapServiceCatalogItem.ts +++ b/lib/Models/Catalog/Ows/WebMapServiceCatalogItem.ts @@ -398,7 +398,9 @@ class WebMapServiceCatalogItem return undefined; } - imageryProvider.enablePickFeatures = true; + // Reset feature picking for the current imagery layer. + // We disable feature picking for the next imagery layer. + imageryProvider.enablePickFeatures = this.allowFeaturePicking; return { imageryProvider, @@ -422,6 +424,7 @@ class WebMapServiceCatalogItem return undefined; } + // Disable feature picking for the next imagery layer. imageryProvider.enablePickFeatures = false; return { @@ -574,8 +577,8 @@ class WebMapServiceCatalogItem tilingScheme: this.tilingScheme, maximumLevel: this.getMaximumLevel(true) ?? this.maximumLevel, minimumLevel: this.minimumLevel, - credit: this.attribution, - enablePickFeatures: this.allowFeaturePicking + credit: this.attribution + // Note: we set enablePickFeatures in _currentImageryParts and _nextImageryParts }; if (isDefined(this.getFeatureInfoFormat?.type)) { diff --git a/test/Models/Catalog/Ows/WebMapServiceCatalogItemSpec.ts b/test/Models/Catalog/Ows/WebMapServiceCatalogItemSpec.ts index 05541195379..925f094bd5a 100644 --- a/test/Models/Catalog/Ows/WebMapServiceCatalogItemSpec.ts +++ b/test/Models/Catalog/Ows/WebMapServiceCatalogItemSpec.ts @@ -562,6 +562,87 @@ describe("WebMapServiceCatalogItem", function () { ); }); + it('creates "next" imagery provider when animating', async function () { + const terria = new Terria(); + const wmsItem = new WebMapServiceCatalogItem("some-layer", terria); + runInAction(() => { + wmsItem.setTrait(CommonStrata.definition, "url", "http://example.com"); + wmsItem.setTrait( + CommonStrata.definition, + "getCapabilitiesUrl", + "test/WMS/styles_and_dimensions.xml" + ); + wmsItem.setTrait(CommonStrata.definition, "layers", "C"); + wmsItem.setTrait( + CommonStrata.definition, + "currentTime", + "2002-01-01T00:00:00.000Z" + ); + }); + + terria.timelineStack.addToTop(wmsItem); + terria.timelineStack.activate(); + + (await wmsItem.loadMapItems()).throwIfError(); + + expect(wmsItem.mapItems.length).toBe(1); + expect(wmsItem.isPaused).toBe(true); + + runInAction(() => { + wmsItem.setTrait(CommonStrata.definition, "isPaused", false); + }); + + expect(wmsItem.mapItems.length).toBe(2); + expect(wmsItem.isPaused).toBe(false); + + const currentImageryProvider = wmsItem.mapItems[0].imageryProvider; + expect(currentImageryProvider instanceof WebMapServiceImageryProvider).toBe( + true + ); + if (currentImageryProvider instanceof WebMapServiceImageryProvider) { + expect(currentImageryProvider.enablePickFeatures).toBe(true); + } + + const nextMapItem = wmsItem.mapItems[1]; + const nextImageryProvider = nextMapItem.imageryProvider; + expect(nextImageryProvider instanceof WebMapServiceImageryProvider).toBe( + true + ); + if (nextImageryProvider instanceof WebMapServiceImageryProvider) { + expect(nextImageryProvider.enablePickFeatures).toBe(false); + expect(nextMapItem.alpha).toBe(0); + expect(nextMapItem.show).toBe(true); + } + }); + + it("sets enableFeaturePicking to false", async function () { + const terria = new Terria(); + const wmsItem = new WebMapServiceCatalogItem("some-layer", terria); + runInAction(() => { + wmsItem.setTrait(CommonStrata.definition, "url", "http://example.com"); + wmsItem.setTrait(CommonStrata.definition, "allowFeaturePicking", false); + wmsItem.setTrait( + CommonStrata.definition, + "getCapabilitiesUrl", + "test/WMS/styles_and_dimensions.xml" + ); + wmsItem.setTrait(CommonStrata.definition, "layers", "C"); + }); + + (await wmsItem.loadMetadata()).throwIfError(); + + expect(wmsItem.mapItems.length).toBe(1); + expect(wmsItem.allowFeaturePicking).toBe(false); + + const imageryProvider = wmsItem.mapItems[0].imageryProvider; + expect( + imageryProvider instanceof WebMapServiceImageryProvider + ).toBeTruthy(); + if (imageryProvider instanceof WebMapServiceImageryProvider) { + expect(imageryProvider.enablePickFeatures).toBe(false); + } + }); + it("dimensions and styles for a 'real' WMS layer", function (done) { const terria = new Terria(); const wmsItem = new WebMapServiceCatalogItem("some-layer", terria); From dc7e602d8ae5f9058dd4c6b68f4e768c93fa3342 Mon Sep 17 00:00:00 2001 From: Yusuke Kiuchi <4221178-yusuke.kiuchi@users.noreply.gitlab.com> Date: Tue, 10 Oct 2023 13:58:33 +0900 Subject: [PATCH 14/53] Fix erratic translation keys --- lib/Models/Workflows/TableStylingWorkflow.ts | 6 +++--- wwwroot/languages/en/translation.json | 10 +++++++--- wwwroot/languages/ja/translation.json | 10 +++++++--- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/lib/Models/Workflows/TableStylingWorkflow.ts b/lib/Models/Workflows/TableStylingWorkflow.ts index 4eeaf228f68..68e627c28b5 100644 --- a/lib/Models/Workflows/TableStylingWorkflow.ts +++ b/lib/Models/Workflows/TableStylingWorkflow.ts @@ -521,7 +521,7 @@ export default class TableStylingWorkflow id: "table-style", name: i18next.t( - "models.tableStyling.data.selectableDimensions.tableStyle.dataset" + "models.tableStyling.data.selectableDimensions.tableStyle.name" ), selectedId: this.tableStyle.id, options: this.item.tableStyles.map((style) => ({ @@ -2287,7 +2287,7 @@ export default class TableStylingWorkflow id: `${id}-color`, name: i18next.t( - "models.tableStyling.outline.selectableDimensions.color" + "models.tableStyling.outline.selectableDimensions.color.name" ), allowUndefined: true, value: outlineTraits.color ?? nullValues.color, @@ -2300,7 +2300,7 @@ export default class TableStylingWorkflow id: `${id}-width`, name: i18next.t( - "models.tableStyling.outline.selectableDimensions.width" + "models.tableStyling.outline.selectableDimensions.width.name" ), value: outlineTraits.width ?? nullValues.width, setDimensionValue: (stratumId, value) => { diff --git a/wwwroot/languages/en/translation.json b/wwwroot/languages/en/translation.json index 8810fd7529a..0e7d6bce3c4 100644 --- a/wwwroot/languages/en/translation.json +++ b/wwwroot/languages/en/translation.json @@ -1536,7 +1536,7 @@ "name": "Dataset" }, "tableStyle": { - "dataset": "Style" + "name": "Style" }, "tableStyleType": { "name": "Symbology", @@ -1897,8 +1897,12 @@ "outline": { "name": "Outline style", "selectableDimensions": { - "color": "Color", - "width": "Width" + "color": { + "name": "Color" + }, + "width": { + "name": "Width" + } } }, "label": { diff --git a/wwwroot/languages/ja/translation.json b/wwwroot/languages/ja/translation.json index f6e4628150b..fd99b4dd3e7 100644 --- a/wwwroot/languages/ja/translation.json +++ b/wwwroot/languages/ja/translation.json @@ -1535,7 +1535,7 @@ "name": "データセット" }, "tableStyle": { - "dataset": "スタイル" + "name": "スタイル" }, "tableStyleType": { "name": "シンボル設定", @@ -1896,8 +1896,12 @@ "outline": { "name": "線", "selectableDimensions": { - "color": "色", - "width": "太さ" + "color": { + "name": "色" + }, + "width": { + "name": "太さ" + } } }, "label": { From 271396bfaf94e3d43fdb3922f7b641454d7a4a4b Mon Sep 17 00:00:00 2001 From: Nick Forbes-Smith Date: Wed, 11 Oct 2023 20:11:48 +1100 Subject: [PATCH 15/53] Tweak ArcGis WMS getFeatureInfoFormat --- CHANGES.md | 4 + .../Ows/WebMapServiceCapabilitiesStratum.ts | 21 +- .../Ows/WebMapServiceCatalogItemSpec.ts | 54 +++ wwwroot/test/WMS/wms_esri.xml | 150 ++++++++ wwwroot/test/WMS/wms_esri_2.xml | 328 ++++++++++++++++++ 5 files changed, 555 insertions(+), 2 deletions(-) create mode 100644 wwwroot/test/WMS/wms_esri.xml create mode 100644 wwwroot/test/WMS/wms_esri_2.xml diff --git a/CHANGES.md b/CHANGES.md index 47acbcbb217..047dd022636 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,10 @@ - Allow translation of TableStylingWorkflow. - Fix "Remove all" not removing selected/picked features +- WMS `isEsri` default value will now check for case-insensitive `mapserver/wmsserver` (instead of `MapServer/WMSServer`) +- Tweak ArcGis MapServer WMS `GetFeatureInfo` default behaviour + - Add `application/geo+json` and `application/vnd.geo+json` default `GetFeatureInfo` (after `application/json` in priority list) + - Add `application/xml` default `GetFeatureInfo`. (if `isEsri` is true, then this will be used before `text/html`) - [The next improvement] #### 8.3.6 - 2023-10-03 diff --git a/lib/Models/Catalog/Ows/WebMapServiceCapabilitiesStratum.ts b/lib/Models/Catalog/Ows/WebMapServiceCapabilitiesStratum.ts index 8cb7bff5b01..32b8737cc18 100644 --- a/lib/Models/Catalog/Ows/WebMapServiceCapabilitiesStratum.ts +++ b/lib/Models/Catalog/Ows/WebMapServiceCapabilitiesStratum.ts @@ -712,7 +712,9 @@ export default class WebMapServiceCapabilitiesStratum extends LoadableStratum( @computed get isEsri(): boolean { if (this.catalogItem.url !== undefined) - return this.catalogItem.url.indexOf("MapServer/WMSServer") > -1; + return ( + this.catalogItem.url.toLowerCase().indexOf("mapserver/wmsserver") > -1 + ); return false; } @@ -831,9 +833,11 @@ export default class WebMapServiceCapabilitiesStratum extends LoadableStratum( } /** Prioritize format of GetFeatureInfo: - * - JSON + * - JSON/GeoJSON + * - If ESRI, then we prioritise XML next * - HTML * - GML + * - XML * - Plain text * * If no matching format can be found in GetCapabilities, then Cesium will use defaults (see `WebMapServiceImageryProvider.DefaultGetFeatureInfoFormats`) @@ -852,10 +856,23 @@ export default class WebMapServiceCapabilitiesStratum extends LoadableStratum( if (formatsArray.includes("application/json")) return { format: "application/json", type: "json" }; + if (formatsArray.includes("application/geo+json")) + return { format: "application/geo+json", type: "json" }; + if (formatsArray.includes("application/vnd.geo+json")) + return { format: "application/vnd.geo+json", type: "json" }; + + // Special case for Esri WMS, use XML before HTML + // as HTML includes with rowbg that is hard to read + if (this.isEsri && formatsArray.includes("text/xml")) { + return { format: "text/xml", type: "xml" }; + } if (formatsArray.includes("text/html")) return { format: "text/html", type: "html" }; if (formatsArray.includes("application/vnd.ogc.gml")) return { format: "application/vnd.ogc.gml", type: "xml" }; + if (formatsArray.includes("text/xml")) { + return { format: "text/xml", type: "xml" }; + } if (formatsArray.includes("text/plain")) return { format: "text/plain", type: "text" }; } diff --git a/test/Models/Catalog/Ows/WebMapServiceCatalogItemSpec.ts b/test/Models/Catalog/Ows/WebMapServiceCatalogItemSpec.ts index 05541195379..a037149fa86 100644 --- a/test/Models/Catalog/Ows/WebMapServiceCatalogItemSpec.ts +++ b/test/Models/Catalog/Ows/WebMapServiceCatalogItemSpec.ts @@ -836,6 +836,60 @@ describe("WebMapServiceCatalogItem", function () { .catch(done.fail); }); + it("sets isEsri from URL", async function () { + let wms: WebMapServiceCatalogItem; + const terria = new Terria(); + wms = new WebMapServiceCatalogItem("test", terria); + runInAction(() => { + wms.setTrait( + CommonStrata.definition, + "url", + "http://gaservices.ga.gov.au/site_1/services/Geomorphology_Landform_Type_WM/MapServer/WMSServer?request=GetCapabilities&service=WMS" + ); + wms.setTrait( + CommonStrata.definition, + "getCapabilitiesUrl", + "test/WMS/wms_esri.xml" + ); + wms.setTrait(CommonStrata.definition, "layers", "0"); + }); + + await wms.loadMetadata(); + + expect(wms.isEsri).toBe(true); + expect(wms.getFeatureInfoFormat.type).toBe("json"); + expect(wms.getFeatureInfoFormat.format).toBe("application/geo+json"); + }); + + it("sets isEsri from URL - and uses XML over HTML", async function () { + let wms: WebMapServiceCatalogItem; + const terria = new Terria(); + wms = new WebMapServiceCatalogItem("test", terria); + runInAction(() => { + wms.setTrait( + CommonStrata.definition, + "url", + "http://gaservices.ga.gov.au/site_1/services/Geomorphology_Landform_Type_WM/MapServer/WMSServer?request=GetCapabilities&service=WMS" + ); + wms.setTrait( + CommonStrata.definition, + "getCapabilitiesUrl", + "test/WMS/wms_esri_2.xml" + ); + wms.setTrait( + CommonStrata.definition, + "layers", + "Topographic_Maps_Index_100k" + ); + }); + + await wms.loadMetadata(); + + expect(wms.isEsri).toBe(true); + expect(wms.getFeatureInfoFormat.type).toBe("xml"); + expect(wms.getFeatureInfoFormat.format).toBe("text/xml"); + }); + describe("imageryProvider", () => { let item: WebMapServiceCatalogItem; let imageryProvider: WebMapServiceImageryProvider; diff --git a/wwwroot/test/WMS/wms_esri.xml b/wwwroot/test/WMS/wms_esri.xml new file mode 100644 index 00000000000..69855cc3b20 --- /dev/null +++ b/wwwroot/test/WMS/wms_esri.xml @@ -0,0 +1,150 @@ + + + + + WMS + WMS + + + + + + + + + + + + +
    + + + + +
    + + + +
    + + + 4096 + 4096 +
    + + + + application/vnd.ogc.wms_xml + text/xml + + + + + + + + + + image/bmp + image/jpeg + image/tiff + image/png + image/png8 + image/png24 + image/png32 + image/gif + image/svg+xml + + + + + + + + + + application/vnd.esri.wms_raw_xml + application/vnd.esri.wms_featureinfo_xml + application/vnd.ogc.wms_xml + application/geo+json + text/xml + text/html + text/plain + + + + + + + + + + application/vnd.ogc.sld+xml + + + + + + + + + + + application/vnd.ogc.se_xml + application/vnd.ogc.se_inimage + application/vnd.ogc.se_blank + text/xml + XML + + + <![CDATA[National Broadband Network - Connections by technology type – July 2020]]> + CRS:84 + EPSG:4326 + EPSG:3857 + + EPSG:102100 + + 96.807660 + 168.005803 + -43.751975 + -9.210950 + + + + + + + 0 + <![CDATA[NBN - Satellite]]> + Test Abstract + CRS:84 + EPSG:4326 + EPSG:3857 + + EPSG:102100 + + 96.807660 + 168.005803 + -43.751975 + -9.210950 + + + + + + + + + +
    diff --git a/wwwroot/test/WMS/wms_esri_2.xml b/wwwroot/test/WMS/wms_esri_2.xml new file mode 100644 index 00000000000..685f116e8f8 --- /dev/null +++ b/wwwroot/test/WMS/wms_esri_2.xml @@ -0,0 +1,328 @@ + + + + + WMS + Topographic Map Indexes + Test Abstract + + + Map Index + topographic + 250k + 100k + 1 Million + web service + Australia + + + + + + Geoscience Australia + + + + Postal +
    GPO Box 378
    + Canberra + ACT + 2601 + Australia +
    + +61 2 6249 9111 + + clientservices@ga.gov.au +
    + NONE + © Commonwealth of Australia (Geoscience Australia) 2023. This product is released under the Creative Commons Attribution 4.0 International Licence. http://creativecommons.org/licenses/by/4.0/legalcode + 4096 + 4096 +
    + + + + application/vnd.ogc.wms_xml + text/xml + + + + + + + + + + image/bmp + image/jpeg + image/tiff + image/png + image/png8 + image/png24 + image/png32 + image/gif + image/svg+xml + + + + + + + + + + application/vnd.esri.wms_raw_xml + application/vnd.esri.wms_featureinfo_xml + application/vnd.ogc.wms_xml + text/xml + text/html + text/plain + + + + + + + + + + application/vnd.ogc.sld+xml + + + + + + + + + + + application/vnd.ogc.se_xml + application/vnd.ogc.se_inimage + application/vnd.ogc.se_blank + text/xml + XML + + + Topographic Map Indexes + EPSG:4283 + EPSG:4326 + CRS:84 + EPSG:3857 + EPSG:28348 + EPSG:28349 + EPSG:28350 + EPSG:28351 + EPSG:28352 + EPSG:28353 + EPSG:28354 + EPSG:28355 + EPSG:28356 + EPSG:28357 + EPSG:28358 + EPSG:32748 + EPSG:32749 + EPSG:32750 + EPSG:32751 + EPSG:32752 + EPSG:32753 + EPSG:32754 + EPSG:32755 + EPSG:32756 + EPSG:32757 + EPSG:32758 + EPSG:3031 + EPSG:3032 + EPSG:102100 + + + 108.000001 + 155.999999 + -43.999988 + -7.999985 + + + + + + + Topographic_Maps_Index_100k + Topographic Maps Index 100k + + EPSG:4283 + EPSG:4326 + CRS:84 + EPSG:3857 + EPSG:28348 + EPSG:28349 + EPSG:28350 + EPSG:28351 + EPSG:28352 + EPSG:28353 + EPSG:28354 + EPSG:28355 + EPSG:28356 + EPSG:28357 + EPSG:28358 + EPSG:32748 + EPSG:32749 + EPSG:32750 + EPSG:32751 + EPSG:32752 + EPSG:32753 + EPSG:32754 + EPSG:32755 + EPSG:32756 + EPSG:32757 + EPSG:32758 + EPSG:3031 + EPSG:3032 + EPSG:102100 + + + 112.500009 + 154.000008 + -43.849986 + -8.999986 + + + + + + + text/html + + + + 14174107.142857 + + + Topographic_Maps_Index_250k + Topographic Maps Index 250k + + EPSG:4283 + EPSG:4326 + CRS:84 + EPSG:3857 + EPSG:28348 + EPSG:28349 + EPSG:28350 + EPSG:28351 + EPSG:28352 + EPSG:28353 + EPSG:28354 + EPSG:28355 + EPSG:28356 + EPSG:28357 + EPSG:28358 + EPSG:32748 + EPSG:32749 + EPSG:32750 + EPSG:32751 + EPSG:32752 + EPSG:32753 + EPSG:32754 + EPSG:32755 + EPSG:32756 + EPSG:32757 + EPSG:32758 + EPSG:3031 + EPSG:3032 + EPSG:102100 + + + 112.883339 + 154.100008 + -43.999985 + -8.933316 + + + + + + + text/html + + + + 566964.285714 + + + AUSTopo_Australian_Digital_Map_Series_Index_250k + AUSTopo Australian Digital Map Series Index 250k + + Test Abstract + + EPSG:4283 + EPSG:4326 + CRS:84 + EPSG:3857 + EPSG:28348 + EPSG:28349 + EPSG:28350 + EPSG:28351 + EPSG:28352 + EPSG:28353 + EPSG:28354 + EPSG:28355 + EPSG:28356 + EPSG:28357 + EPSG:28358 + EPSG:32748 + EPSG:32749 + EPSG:32750 + EPSG:32751 + EPSG:32752 + EPSG:32753 + EPSG:32754 + EPSG:32755 + EPSG:32756 + EPSG:32757 + EPSG:32758 + EPSG:3031 + EPSG:3032 + EPSG:102100 + + + 112.883339 + 154.000008 + -43.999988 + -8.999986 + + + + + + + text/html + + + + 566964.285714 + + + +
    From 41419db579a6701c2762578bc8c8253fcc2695fb Mon Sep 17 00:00:00 2001 From: Nick Forbes-Smith Date: Thu, 12 Oct 2023 12:19:06 +1100 Subject: [PATCH 16/53] make test more robust --- .../Ows/WebMapServiceCatalogItemSpec.ts | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/test/Models/Catalog/Ows/WebMapServiceCatalogItemSpec.ts b/test/Models/Catalog/Ows/WebMapServiceCatalogItemSpec.ts index 925f094bd5a..75f6289d816 100644 --- a/test/Models/Catalog/Ows/WebMapServiceCatalogItemSpec.ts +++ b/test/Models/Catalog/Ows/WebMapServiceCatalogItemSpec.ts @@ -595,24 +595,22 @@ describe("WebMapServiceCatalogItem", function () { expect(wmsItem.mapItems.length).toBe(2); expect(wmsItem.isPaused).toBe(false); - const currentImageryProvider = wmsItem.mapItems[0].imageryProvider; + const currentImageryProvider = wmsItem.mapItems[0] + .imageryProvider as WebMapServiceImageryProvider; expect(currentImageryProvider instanceof WebMapServiceImageryProvider).toBe( true ); - if (currentImageryProvider instanceof WebMapServiceImageryProvider) { - expect(currentImageryProvider.enablePickFeatures).toBe(true); - } + expect(currentImageryProvider.enablePickFeatures).toBe(false); const nextMapItem = wmsItem.mapItems[1]; - const nextImageryProvider = nextMapItem.imageryProvider; + const nextImageryProvider = + nextMapItem.imageryProvider as WebMapServiceImageryProvider; expect(nextImageryProvider instanceof WebMapServiceImageryProvider).toBe( true ); - if (nextImageryProvider instanceof WebMapServiceImageryProvider) { - expect(nextImageryProvider.enablePickFeatures).toBe(false); - expect(nextMapItem.alpha).toBe(0); - expect(nextMapItem.show).toBe(true); - } + expect(nextImageryProvider.enablePickFeatures).toBe(false); + expect(nextMapItem.alpha).toBe(0); + expect(nextMapItem.show).toBe(true); }); it("sets enableFeaturePicking to false", async function () { @@ -634,13 +632,13 @@ describe("WebMapServiceCatalogItem", function () { expect(wmsItem.mapItems.length).toBe(1); expect(wmsItem.allowFeaturePicking).toBe(false); - const imageryProvider = wmsItem.mapItems[0].imageryProvider; + const imageryProvider = wmsItem.mapItems[0] + .imageryProvider as WebMapServiceImageryProvider; expect( imageryProvider instanceof WebMapServiceImageryProvider ).toBeTruthy(); - if (imageryProvider instanceof WebMapServiceImageryProvider) { - expect(imageryProvider.enablePickFeatures).toBe(false); - } + + expect(imageryProvider.enablePickFeatures).toBe(false); }); it("dimensions and styles for a 'real' WMS layer", function (done) { From 34490a64774846ba76cb42c3e031d3e9a8795a8a Mon Sep 17 00:00:00 2001 From: Nick Forbes-Smith Date: Thu, 12 Oct 2023 13:11:44 +1100 Subject: [PATCH 17/53] fix test --- test/Models/Catalog/Ows/WebMapServiceCatalogItemSpec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Models/Catalog/Ows/WebMapServiceCatalogItemSpec.ts b/test/Models/Catalog/Ows/WebMapServiceCatalogItemSpec.ts index 75f6289d816..54284a78533 100644 --- a/test/Models/Catalog/Ows/WebMapServiceCatalogItemSpec.ts +++ b/test/Models/Catalog/Ows/WebMapServiceCatalogItemSpec.ts @@ -600,7 +600,7 @@ describe("WebMapServiceCatalogItem", function () { expect(currentImageryProvider instanceof WebMapServiceImageryProvider).toBe( true ); - expect(currentImageryProvider.enablePickFeatures).toBe(false); + expect(currentImageryProvider.enablePickFeatures).toBe(true); const nextMapItem = wmsItem.mapItems[1]; const nextImageryProvider = From 5dc00330a5859b056e34f80f6544a2ffdbe2048e Mon Sep 17 00:00:00 2001 From: Lawrence Owen Date: Thu, 5 Oct 2023 15:21:45 +1000 Subject: [PATCH 18/53] Replace usages of construct --- .../Analytics/RegionDataParameterEditor.jsx | 8 +- .../Custom/Chart/BottomDockChart.jsx | 8 +- .../Custom/Chart/MomentPointsChart.jsx | 4 +- lib/ReactViews/Custom/Chart/Tooltip.jsx | 8 +- lib/ReactViews/DataCatalog/DataCatalog.jsx | 37 ++++---- .../DataCatalog/DataCatalogGroup.jsx | 7 +- lib/ReactViews/ExplorerWindow/Tabs.jsx | 4 +- .../Tabs/MyDataTab/MyDataTab.jsx | 4 +- lib/ReactViews/Generic/Dropdown.jsx | 6 +- lib/ReactViews/Map/MenuBar/MenuBar.jsx | 14 ++- .../Map/Panels/HelpPanel/HelpPanel.jsx | 7 +- .../Map/Panels/HelpPanel/StyledHtml.jsx | 90 +++++++++---------- lib/ReactViews/Mobile/MobileMenu.jsx | 8 +- .../Preview/DataPreviewSections.jsx | 4 +- lib/ReactViews/Preview/Description.jsx | 82 ++++++++--------- lib/ReactViews/Preview/MetadataTable.jsx | 4 +- lib/ReactViews/Search/Breadcrumbs.jsx | 75 ++++++++-------- lib/ReactViews/Search/SearchBoxAndResults.jsx | 43 +++++---- 18 files changed, 203 insertions(+), 210 deletions(-) diff --git a/lib/ReactViews/Analytics/RegionDataParameterEditor.jsx b/lib/ReactViews/Analytics/RegionDataParameterEditor.jsx index e9879f8075a..ff35de5c814 100644 --- a/lib/ReactViews/Analytics/RegionDataParameterEditor.jsx +++ b/lib/ReactViews/Analytics/RegionDataParameterEditor.jsx @@ -190,11 +190,7 @@ const RegionDataParameterEditor = createReactClass({ return (
      - + {this.catalogItemsWithMatchingRegion().map((catalogItem, i) => ( {this.renderItemChildren(catalogItem)} - + ))}
    ); diff --git a/lib/ReactViews/Custom/Chart/BottomDockChart.jsx b/lib/ReactViews/Custom/Chart/BottomDockChart.jsx index 9dcaf4444b8..b46ff3e545e 100644 --- a/lib/ReactViews/Custom/Chart/BottomDockChart.jsx +++ b/lib/ReactViews/Custom/Chart/BottomDockChart.jsx @@ -281,15 +281,15 @@ class Chart extends React.Component { scale={this.xScale} label={xAxis.units || (xAxis.scale === "time" && "Date")} /> - + {this.yAxes.map((y, i) => ( 1 ? y.color : defaultGridColor} offset={i * 50} /> - - + ))} + {this.yAxes.map((y, i) => ( 1 ? y.color : defaultGridColor} lineStyle={{ opacity: 0.3 }} /> - + ))} - + {this.points.map((p, i) => ( - + ))} ); } diff --git a/lib/ReactViews/Custom/Chart/Tooltip.jsx b/lib/ReactViews/Custom/Chart/Tooltip.jsx index 75e68e744cd..35288c9565c 100644 --- a/lib/ReactViews/Custom/Chart/Tooltip.jsx +++ b/lib/ReactViews/Custom/Chart/Tooltip.jsx @@ -94,13 +94,13 @@ class Tooltip extends React.Component { >
    {this.title}
    - + {this.groups.map((group) => ( 1 ? group.name : undefined} items={group.items} /> - + ))}
    @@ -119,9 +119,9 @@ class TooltipGroup extends React.PureComponent { return (
    {name &&
    {name}
    } - + {items.map((item) => ( - + ))}
    ); } diff --git a/lib/ReactViews/DataCatalog/DataCatalog.jsx b/lib/ReactViews/DataCatalog/DataCatalog.jsx index cf0fe0a197b..e0f10c0cc9f 100644 --- a/lib/ReactViews/DataCatalog/DataCatalog.jsx +++ b/lib/ReactViews/DataCatalog/DataCatalog.jsx @@ -50,24 +50,25 @@ class DataCatalog extends React.Component { /> )} - - {item !== this.props.terria.catalog.userAddedDataGroup && ( - - )} - + {items.map( + (item) => + item !== this.props.terria.catalog.userAddedDataGroup && ( + + ) + )} ); } diff --git a/lib/ReactViews/DataCatalog/DataCatalogGroup.jsx b/lib/ReactViews/DataCatalog/DataCatalogGroup.jsx index 95a4eb54c8b..db6135185f5 100644 --- a/lib/ReactViews/DataCatalog/DataCatalogGroup.jsx +++ b/lib/ReactViews/DataCatalog/DataCatalogGroup.jsx @@ -134,8 +134,8 @@ class DataCatalogGroup extends React.Component { this.props.terria )} > - {this.isOpen() && ( - + {this.isOpen() && + group.memberModels.map((item) => ( - - )} + ))} ); } diff --git a/lib/ReactViews/ExplorerWindow/Tabs.jsx b/lib/ReactViews/ExplorerWindow/Tabs.jsx index fc7ec3814cb..021414241ca 100644 --- a/lib/ReactViews/ExplorerWindow/Tabs.jsx +++ b/lib/ReactViews/ExplorerWindow/Tabs.jsx @@ -143,7 +143,7 @@ class Tabs extends React.Component { background-color: ${(p) => p.theme.colorPrimary}; `} > - + {tabs.map((item, i) => (
  • -
    + ))}
    - + {tabs.map((tab) => (
  • -
    + ))} ); } diff --git a/lib/ReactViews/Generic/Dropdown.jsx b/lib/ReactViews/Generic/Dropdown.jsx index a5b43dc16b7..f352d1422e4 100644 --- a/lib/ReactViews/Generic/Dropdown.jsx +++ b/lib/ReactViews/Generic/Dropdown.jsx @@ -138,7 +138,7 @@ const Dropdown = createReactClass({ [isOpenStyle]: this.state.isOpen })} > - + {this.props.options.map((option, i) => (
  • @@ -164,14 +164,14 @@ const Dropdown = createReactClass({ this.props.theme.btnOption || "", { [Styles.isSelected]: option === this.props.selected } )} - onClick={() => this.select(option, index)} + onClick={() => this.select(option, i)} > {option[this.props.textProperty]}
  • -
    + ))} ); diff --git a/lib/ReactViews/Map/MenuBar/MenuBar.jsx b/lib/ReactViews/Map/MenuBar/MenuBar.jsx index 80831e80cc2..52d6ab42eeb 100644 --- a/lib/ReactViews/Map/MenuBar/MenuBar.jsx +++ b/lib/ReactViews/Map/MenuBar/MenuBar.jsx @@ -56,13 +56,12 @@ const MenuBar = observer((props) => { )} - {!viewState.useSmallScreenInterface && ( - + {!viewState.useSmallScreenInterface && + props.menuLeftItems.map((element, i) => (
  • {element}
  • -
    - )} + ))}
    @@ -103,13 +102,12 @@ const MenuBar = observer((props) => { /> - {!viewState.useSmallScreenInterface && ( - + {!viewState.useSmallScreenInterface && + menuItems.map((element, i) => (
  • {element}
  • -
    - )} + ))}
    ); diff --git a/lib/ReactViews/Map/Panels/HelpPanel/HelpPanel.jsx b/lib/ReactViews/Map/Panels/HelpPanel/HelpPanel.jsx index aa6e72ee181..6d31dba92ab 100644 --- a/lib/ReactViews/Map/Panels/HelpPanel/HelpPanel.jsx +++ b/lib/ReactViews/Map/Panels/HelpPanel/HelpPanel.jsx @@ -139,16 +139,15 @@ class HelpPanel extends React.Component { - {helpItems && ( - + {helpItems && + helpItems.map((item, i) => ( - - )} + ))} ); diff --git a/lib/ReactViews/Map/Panels/HelpPanel/StyledHtml.jsx b/lib/ReactViews/Map/Panels/HelpPanel/StyledHtml.jsx index 88c4fb495b3..496cd6bf9b2 100644 --- a/lib/ReactViews/Map/Panels/HelpPanel/StyledHtml.jsx +++ b/lib/ReactViews/Map/Panels/HelpPanel/StyledHtml.jsx @@ -20,21 +20,19 @@ const Numbers = styled(Text)` `; const renderOrderedList = function (contents) { - return ( - - - - - {i + 1} - - - - - {content} - + return contents.map((content, i) => ( + + + + {i + 1} + + - - ); + + {content} + + + )); }; export class StyledHtmlRaw extends React.Component { @@ -73,42 +71,42 @@ export class StyledHtmlRaw extends React.Component { return (
    - {content?.map && ( - - {item && ( - - {/* Either a header or paragraph tag */} - - - {item.props.children} - - - - {renderOrderedList( - item.props.children.map((point) => point.props.children) - )} - - - - {/* If it's none of the above tags, just render as + {content?.map && + content.map( + (item, i) => + item && ( + + {/* Either a header or paragraph tag */} + + + {item.props.children} + + + + {renderOrderedList( + item.props.children.map((point) => point.props.children) + )} + + + + {/* If it's none of the above tags, just render as {/* If it's none of the above tags, just render as {/* If it's none of the above tags, just render as normal html but with the same text formatting. We can style more tags as necessary */} - - {item} - - - - )} - - )} + + {item} + + + + ) + )}
    ); } diff --git a/lib/ReactViews/Mobile/MobileMenu.jsx b/lib/ReactViews/Mobile/MobileMenu.jsx index 35ed2de201c..319aabeace5 100644 --- a/lib/ReactViews/Mobile/MobileMenu.jsx +++ b/lib/ReactViews/Mobile/MobileMenu.jsx @@ -116,14 +116,14 @@ class MobileMenu extends React.Component { [Styles.mobileNavHidden]: !this.props.viewState.mobileMenuVisible })} > - + {this.props.menuLeftItems.map((menuItem) => (
    this.hideMenu()} key={menuItem ? menuItem.key : undefined} > {menuItem}
    -
    + ))}
    this.hideMenu()}>
    - + {this.props.menuItems.map((menuItem) => (
    this.hideMenu()} key={menuItem ? menuItem.key : undefined} > {menuItem}
    -
    + ))} {mapUserGuide && } {this.props.showFeedback && ( - + {this.sortInfoSections(items).map((item, i) => ( - + ))} ); } diff --git a/lib/ReactViews/Preview/Description.jsx b/lib/ReactViews/Preview/Description.jsx index 444b71a5316..c98208321b4 100644 --- a/lib/ReactViews/Preview/Description.jsx +++ b/lib/ReactViews/Preview/Description.jsx @@ -64,7 +64,7 @@ class Description extends React.Component { {metadataUrls && metadataUrls.length > 0 && ( <>

    {t("description.metadataUrls")}

    - + {metadataUrls.map((metadataUrl, i) => ( - + ))} )} @@ -183,18 +183,19 @@ class Description extends React.Component { {dataUrls && dataUrls.length > 0 && ( <>

    {t("description.dataUrl")}

    - - - - {dataUrl.type?.startsWith("wfs") && - parseCustomMarkdownToReact( - t("description.useLinkBelow", { - link: ` + {dataUrls.map((dataUrl, i) => ( + <> + + + {dataUrl.type?.startsWith("wfs") && + parseCustomMarkdownToReact( + t("description.useLinkBelow", { + link: `
    ` - }) - )} - {dataUrl.type?.startsWith("wcs") && - parseCustomMarkdownToReact( - t("description.useLinkBelow", { - link: ` + }) + )} + {dataUrl.type?.startsWith("wcs") && + parseCustomMarkdownToReact( + t("description.useLinkBelow", { + link: ` ` - }) + }) + )} + + + + p.theme.colorPrimary}; + `} + > + {dataUrl.title && ( + )} - - - - p.theme.colorPrimary}; - `} - > - {dataUrl.title && ( - - )} - {!dataUrl.title ? dataUrl.url : null} - - -
    + {!dataUrl.title ? dataUrl.url : null} + + {" "} + + ))} )} diff --git a/lib/ReactViews/Preview/MetadataTable.jsx b/lib/ReactViews/Preview/MetadataTable.jsx index 1f270582971..7ca9cbba847 100644 --- a/lib/ReactViews/Preview/MetadataTable.jsx +++ b/lib/ReactViews/Preview/MetadataTable.jsx @@ -36,7 +36,7 @@ const MetadataTable = createReactClass({ )} 0 && !isArr}> - + {keys.map((key, i) => (
    - + ))} diff --git a/lib/ReactViews/Search/Breadcrumbs.jsx b/lib/ReactViews/Search/Breadcrumbs.jsx index c863f43054d..12b464daeef 100644 --- a/lib/ReactViews/Search/Breadcrumbs.jsx +++ b/lib/ReactViews/Search/Breadcrumbs.jsx @@ -69,45 +69,46 @@ class Breadcrumbs extends React.Component { /> - {parentGroups && ( - - - {/* No link when it's the current member */} - - - {parent} - - - {/* The first and last two groups use the full name */} - = parentGroups.length - 2}> - - this.openInCatalog(ancestors.slice(i, i + 1)) - } - > - + {parentGroups && + parentGroups.map((parent, i) => ( + <> + + {/* No link when it's the current member */} + + {parent} - - - - {/* The remainder are just '..' to prevent/minimise overflowing */} - 1 && i < parentGroups.length - 2}> - - {"..."} - - - + + + {/* The first and last two groups use the full name */} + = parentGroups.length - 2}> + + this.openInCatalog(ancestors.slice(i, i + 1)) + } + > + + {parent} + + + + {/* The remainder are just '..' to prevent/minimise overflowing */} + 1 && i < parentGroups.length - 2}> + + {"..."} + + + - {i !== parentGroups.length - 1 && ( - - - {">"} - - - )} - - )} + {i !== parentGroups.length - 1 && ( + + + {">"} + + + )} + + ))} ); diff --git a/lib/ReactViews/Search/SearchBoxAndResults.jsx b/lib/ReactViews/Search/SearchBoxAndResults.jsx index 73de17a905e..2116884da06 100644 --- a/lib/ReactViews/Search/SearchBoxAndResults.jsx +++ b/lib/ReactViews/Search/SearchBoxAndResults.jsx @@ -197,28 +197,27 @@ export class SearchBoxAndResultsRaw extends React.Component { overflow-y: auto; `} > - - { - addMarker(this.props.terria, result); - result.clickAction(); - runInAction(() => { - searchState.showLocationSearchResults = false; - }); - }} - isWaitingForSearchToStart={ - searchState.isWaitingToStartLocationSearch - } - /> - + {this.props.viewState.searchState.locationSearchResults.map( + (search) => ( + { + addMarker(this.props.terria, result); + result.clickAction(); + runInAction(() => { + searchState.showLocationSearchResults = false; + }); + }} + isWaitingForSearchToStart={ + searchState.isWaitingToStartLocationSearch + } + /> + ) + )} )} From 7e53ae0852257f249ada5880a23a16b6ca5ea542 Mon Sep 17 00:00:00 2001 From: Lawrence Owen Date: Thu, 5 Oct 2023 16:54:36 +1000 Subject: [PATCH 19/53] Remove unused import --- lib/ReactViews/Preview/DataPreviewSections.jsx | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/ReactViews/Preview/DataPreviewSections.jsx b/lib/ReactViews/Preview/DataPreviewSections.jsx index 4cae014bd95..f7f3e8277b3 100644 --- a/lib/ReactViews/Preview/DataPreviewSections.jsx +++ b/lib/ReactViews/Preview/DataPreviewSections.jsx @@ -8,7 +8,6 @@ import { withTranslation } from "react-i18next"; import isDefined from "../../Core/isDefined"; import CommonStrata from "../../Models/Definition/CommonStrata"; import Box from "../../Styled/Box"; -import { item } from "../Custom/Chart/tooltip.scss"; import Collapsible from "../Custom/Collapsible/Collapsible"; import parseCustomMarkdownToReact from "../Custom/parseCustomMarkdownToReact"; import MetadataTable from "./MetadataTable"; From 7df27d749660fc23d84e9dece4980247c7dc3eda Mon Sep 17 00:00:00 2001 From: Lawrence Owen Date: Thu, 12 Oct 2023 15:46:25 +1000 Subject: [PATCH 20/53] Deprecate use of - Add unit test for CatalogGroup component Where single path or exclusive conditions replace with && Where two paths use ternary operator ? : For more paths extract out into sub render function --- lib/ReactViews/DataCatalog/CatalogGroup.jsx | 19 +- lib/ReactViews/Disclaimer.jsx | 13 +- lib/ReactViews/Generic/Dropdown.jsx | 57 +++-- .../Map/Panels/HelpPanel/StyledHtml.jsx | 69 +++--- lib/ReactViews/Mobile/MobileHeader.jsx | 76 ++++--- lib/ReactViews/Preview/DataPreview.jsx | 137 ++++++------ lib/ReactViews/Preview/DataPreviewMap.jsx | 24 +-- .../Preview/DataPreviewSections.jsx | 17 +- lib/ReactViews/Preview/Description.jsx | 200 +++++++++--------- lib/ReactViews/Preview/GroupPreview.jsx | 13 +- lib/ReactViews/Preview/MetadataTable.jsx | 73 +++---- lib/ReactViews/Search/Breadcrumbs.jsx | 69 +++--- .../customizable/ResponsiveSwitch.jsx | 13 +- .../DataCatalog/CatalogGroupSpec.tsx | 53 +++++ 14 files changed, 428 insertions(+), 405 deletions(-) create mode 100644 test/ReactViews/DataCatalog/CatalogGroupSpec.tsx diff --git a/lib/ReactViews/DataCatalog/CatalogGroup.jsx b/lib/ReactViews/DataCatalog/CatalogGroup.jsx index 8307c38d53e..4028e0f082b 100644 --- a/lib/ReactViews/DataCatalog/CatalogGroup.jsx +++ b/lib/ReactViews/DataCatalog/CatalogGroup.jsx @@ -124,21 +124,22 @@ function CatalogGroup(props) { [Styles.catalogGroupLowerLevel]: !props.topLevel })} > - - -
  • - -
  • -
    - + {props.loading && ( +
  • + +
  • + )} + {props.loading === false && + props.children.length === 0 && + props.emptyMessage && (
  • {props.emptyMessage}
  • -
    -
    + )} + {props.children} )} diff --git a/lib/ReactViews/Disclaimer.jsx b/lib/ReactViews/Disclaimer.jsx index 656ec1ef8f7..a6b4479c0f1 100644 --- a/lib/ReactViews/Disclaimer.jsx +++ b/lib/ReactViews/Disclaimer.jsx @@ -144,14 +144,11 @@ class Disclaimer extends React.Component { {disclaimerDeny} )} - - - - - - - - + {useSmallScreenInterface ? ( + + ) : ( + + )} this.confirm(disclaimer.confirmAction)} fullWidth={useSmallScreenInterface || !renderDenyButton} diff --git a/lib/ReactViews/Generic/Dropdown.jsx b/lib/ReactViews/Generic/Dropdown.jsx index f352d1422e4..8fa71647881 100644 --- a/lib/ReactViews/Generic/Dropdown.jsx +++ b/lib/ReactViews/Generic/Dropdown.jsx @@ -140,36 +140,33 @@ const Dropdown = createReactClass({ > {this.props.options.map((option, i) => (
  • - - - - {option[this.props.textProperty]} - - - - - - + {option.href ? ( + + {option[this.props.textProperty]} + + ) : ( + + )}
  • ))} diff --git a/lib/ReactViews/Map/Panels/HelpPanel/StyledHtml.jsx b/lib/ReactViews/Map/Panels/HelpPanel/StyledHtml.jsx index 496cd6bf9b2..f1a019e774f 100644 --- a/lib/ReactViews/Map/Panels/HelpPanel/StyledHtml.jsx +++ b/lib/ReactViews/Map/Panels/HelpPanel/StyledHtml.jsx @@ -72,41 +72,42 @@ export class StyledHtmlRaw extends React.Component { return (
    {content?.map && - content.map( - (item, i) => - item && ( - - {/* Either a header or paragraph tag */} - - - {item.props.children} - - - - {renderOrderedList( - item.props.children.map((point) => point.props.children) - )} - - - - {/* If it's none of the above tags, just render as - {/* If it's none of the above tags, just render as - {/* If it's none of the above tags, just render as + content.map((item, i) => { + if (!item) return null; + + /* Either a header or paragraph tag */ + if (/(h[0-6]|p)/i.test(item.type)) { + return ( + + {item.props.children} + + ); + } else if (item.type === "ol") { + return ( + <> + {renderOrderedList( + item.props.children.map((point) => point.props.children) + )} + + + ); + /* If it's none of the above tags, just render as normal html but with the same text formatting. - We can style more tags as necessary */} - - {item} - - - - ) - )} + We can style more tags as necessary */ + } else { + return ( + + {item} + + ); + } + })}
    ); } diff --git a/lib/ReactViews/Mobile/MobileHeader.jsx b/lib/ReactViews/Mobile/MobileHeader.jsx index 0c24824cace..b95adb30105 100644 --- a/lib/ReactViews/Mobile/MobileHeader.jsx +++ b/lib/ReactViews/Mobile/MobileHeader.jsx @@ -126,6 +126,35 @@ class MobileHeader extends React.Component { }); } + renderSearch() { + const { t } = this.props; + + const searchState = this.props.viewState.searchState; +
    + {searchState.showMobileLocationSearch && ( + + )} + {searchState.showMobileCatalogSearch && ( + + )} +
    ; + } + render() { const searchState = this.props.viewState.searchState; const { t } = this.props; @@ -143,13 +172,9 @@ class MobileHeader extends React.Component { paddedRatio={1} backgroundColor={this.props.theme.dark} > - - + {!searchState.showMobileLocationSearch && + !searchState.showMobileCatalogSearch ? ( + <> - - -
    - - - - - - - - -
    -
    -
    + + ) : ( + this.renderSearch() + )} - - -
    -

    {previewed.name}

    - -
    -
    - -
    - -
    -
    - -
    -

    {previewed.name}

    -

    {t("preview.doesNotContainGeospatialData")}

    -
    - {/* TODO: Show a preview chart - - */} -
    - -
    -
    - +

    {previewed.name}

    + + + ); + } else if (previewed && previewed.isMappable) { + return ( +
    + +
    + ); + } else if (chartData) { +
    +

    {previewed.name}

    +

    {t("preview.doesNotContainGeospatialData")}

    +
    + {/* TODO: Show a preview chart + + */} +
    + +
    ; + } else if (previewed && CatalogFunctionMixin.isMixedInto(previewed)) { + return ( + + ); + } else if (previewed && previewed.isGroup) { + return ( +
    + +
    + ); + } else { +
    + +

    Select a dataset to see a preview

    +

    - OR -

    + -
    -
    - -
    - - ); + Go to the map + + + ; + } + } + + render() { + return
    {this.renderInner()}
    ; } renderUnloadedReference() { diff --git a/lib/ReactViews/Preview/DataPreviewMap.jsx b/lib/ReactViews/Preview/DataPreviewMap.jsx index 0886628e410..19381be68a7 100644 --- a/lib/ReactViews/Preview/DataPreviewMap.jsx +++ b/lib/ReactViews/Preview/DataPreviewMap.jsx @@ -271,20 +271,16 @@ class DataPreviewMap extends React.Component { }; return (
    - - -
    - - -
    - - - + {this.props.showMap ? ( +
    + ) : ( +
    + )} diff --git a/lib/ReactViews/Preview/DataPreviewSections.jsx b/lib/ReactViews/Preview/DataPreviewSections.jsx index f7f3e8277b3..5f8d52f88e5 100644 --- a/lib/ReactViews/Preview/DataPreviewSections.jsx +++ b/lib/ReactViews/Preview/DataPreviewSections.jsx @@ -100,16 +100,13 @@ class DataPreviewSections extends React.Component { } bodyTextProps={{ medium: true }} > - - 0}> - {renderSection(item)} - - - - - - - + {item.content?.length > 0 + ? renderSection(item) + : item.contentAsObject !== undefined && ( + + + + )} ))} diff --git a/lib/ReactViews/Preview/Description.jsx b/lib/ReactViews/Preview/Description.jsx index c98208321b4..60b36068698 100644 --- a/lib/ReactViews/Preview/Description.jsx +++ b/lib/ReactViews/Preview/Description.jsx @@ -24,6 +24,45 @@ class Description extends React.Component { t: PropTypes.func.isRequired }; + renderDescription(catalogItem) { + if (catalogItem.type === "wms") { + return ( +

    + + This is a + + WMS service + + , which generates map images on request. It can be used in GIS + software with this URL: + +

    + ); + } else if (catalogItem.type === "wfs") { + return ( +

    + + This is a + + WFS service + + , which transfers raw spatial data on request. It can be used in GIS + software with this URL: + +

    + ); + } + return null; + } + render() { const { t } = this.props; const catalogItem = this.props.item; @@ -101,97 +140,53 @@ class Description extends React.Component { {catalogItem.url && ( <>

    {catalogItem.typeName} URL

    - - -

    - - This is a - - WMS service - - , which generates map images on request. It can be used - in GIS software with this URL: - -

    -
    - -

    - - This is a - - WFS service - - , which transfers raw spatial data on request. It can be - used in GIS software with this URL: - -

    -
    -
    - - - {catalogItem.url} - - - e.target.select()} - /> - - + {this.renderDescription(catalogItem)} + + {this.props.printView ? ( + {catalogItem.url} + ) : ( + e.target.select()} + /> + )} - - -

    - {t("description.layerName")} - {(catalogItem.layers || "").split(",").length > 1 - ? "s" - : ""} - : {catalogItem.layers} -

    -
    - -

    - {t("description.typeName")} - {(catalogItem.typeNames || "").split(",").length > 1 - ? "s" - : ""} - : {catalogItem.typeNames} -

    -
    -
    + {catalogItem.type === "wms" || + (catalogItem.type === "esri-mapServer" && + defined(catalogItem.layers) && ( +

    + {t("description.layerName")} + {(catalogItem.layers || "").split(",").length > 1 + ? "s" + : ""} + : {catalogItem.layers} +

    + ))} + + {catalogItem.type === "wfs" && ( +

    + {t("description.typeName")} + {(catalogItem.typeNames || "").split(",").length > 1 + ? "s" + : ""} + : {catalogItem.typeNames} +

    + )} )} {dataUrls && dataUrls.length > 0 && ( <>

    {t("description.dataUrl")}

    - {dataUrls.map((dataUrl, i) => ( - <> - - + {dataUrls.map( + (dataUrl, i) => + (dataUrl.type?.startsWith("wfs") || + dataUrl.type?.startsWith("wcs")) && ( + <> {dataUrl.type?.startsWith("wfs") && parseCustomMarkdownToReact( t("description.useLinkBelow", { @@ -222,26 +217,25 @@ class Description extends React.Component { ` }) )} - - - - p.theme.colorPrimary}; - `} - > - {dataUrl.title && ( - - )} - {!dataUrl.title ? dataUrl.url : null} - - {" "} - - ))} + + p.theme.colorPrimary}; + `} + > + {dataUrl.title && ( + + )} + {!dataUrl.title ? dataUrl.url : null} + + {" "} + + ) + )} )} diff --git a/lib/ReactViews/Preview/GroupPreview.jsx b/lib/ReactViews/Preview/GroupPreview.jsx index 65f49d82c88..38b0c80442d 100644 --- a/lib/ReactViews/Preview/GroupPreview.jsx +++ b/lib/ReactViews/Preview/GroupPreview.jsx @@ -88,13 +88,8 @@ class GroupPreview extends React.Component { )}
    - - 0 - } - > + {this.props.previewed.description && + this.props.previewed.description.length > 0 && (

    {t("description.name")}

    {parseCustomMarkdownToReact( @@ -102,9 +97,7 @@ class GroupPreview extends React.Component { { catalogItem: this.props.previewed } )}
    -
    -
    - + )} {metadataItem.dataCustodian && ( diff --git a/lib/ReactViews/Preview/MetadataTable.jsx b/lib/ReactViews/Preview/MetadataTable.jsx index 7ca9cbba847..4dbafe69c60 100644 --- a/lib/ReactViews/Preview/MetadataTable.jsx +++ b/lib/ReactViews/Preview/MetadataTable.jsx @@ -1,9 +1,7 @@ import React from "react"; -import { isObservableArray } from "mobx"; import createReactClass from "create-react-class"; - +import { isObservableArray } from "mobx"; import PropTypes from "prop-types"; - import Styles from "./metadata-table.scss"; /** @@ -16,6 +14,31 @@ const MetadataTable = createReactClass({ metadataItem: PropTypes.object.isRequired // A MetadataItem instance. }, + renderDataCell(metadataItem, key) { + if (typeof metadataItem[key] === "object") { + return ; + } else if ( + Array.isArray(metadataItem[key]) || + isObservableArray(metadataItem[key]) + ) { + return metadataItem[key].length > 0 && isJoinable(metadataItem[key]) + ? metadataItem[key].join(", ") + : null; + } else return metadataItem[key]; + }, + + renderObjectItemRow(key, i) { + const metadataItem = this.props.metadataItem; + return ( +
    + + + + ); + }, + render() { const metadataItem = this.props.metadataItem; const keys = Object.keys(metadataItem); @@ -27,41 +50,15 @@ const MetadataTable = createReactClass({
    {key} @@ -59,7 +59,7 @@ const MetadataTable = createReactClass({
    {key} + {this.renderDataCell(metadataItem, key)} +
    - - - {metadataItem.length > 0 && isJoinable(metadataItem) && ( - - - - )} - - 0 && !isArr}> - {keys.map((key, i) => ( - - - - - ))} - - + {isArr && metadataItem.length > 0 && isJoinable(metadataItem) && ( + + + + )} + + {!isArr && + keys.length > 0 && + keys.map((key, i) => this.renderObjectItemRow(key, i))}
    {metadataItem.join(", ")}
    {key} - - - - - - {metadataItem[key].length > 0 && - isJoinable(metadataItem[key]) - ? metadataItem[key].join(", ") - : null} - - {metadataItem[key]} - -
    {metadataItem.join(", ")}
    diff --git a/lib/ReactViews/Search/Breadcrumbs.jsx b/lib/ReactViews/Search/Breadcrumbs.jsx index 12b464daeef..c13284549be 100644 --- a/lib/ReactViews/Search/Breadcrumbs.jsx +++ b/lib/ReactViews/Search/Breadcrumbs.jsx @@ -44,13 +44,47 @@ class Breadcrumbs extends React.Component { this.props.viewState.changeSearchState(""); } + renderCrumb(parent, i, parentGroups) { + const ancestors = getAncestors(this.props.previewed).map((ancestor) => + getDereferencedIfExists(ancestor) + ); + + /* No link when it's the current member */ + if (i === parentGroups.length - 1) { + return ( + + {parent} + + ); + /* The first and last two groups use the full name */ + } else if (i <= 1 || i >= parentGroups.length - 2) { + return ( + this.openInCatalog(ancestors.slice(i, i + 1))} + > + + {parent} + + + ); + /* The remainder are just '..' to prevent/minimise overflowing */ + } else if (i > 1 && i < parentGroups.length - 2) { + return ( + + {"..."} + + ); + } + + return null; + } + render() { const parentGroups = this.props.previewed ? getParentGroups(this.props.previewed) : undefined; - const ancestors = getAncestors(this.props.previewed).map((ancestor) => - getDereferencedIfExists(ancestor) - ); + return ( // Note: should it reset the text if a person deletes current search and starts a new search? ( <> - - {/* No link when it's the current member */} - - - {parent} - - - {/* The first and last two groups use the full name */} - = parentGroups.length - 2}> - - this.openInCatalog(ancestors.slice(i, i + 1)) - } - > - - {parent} - - - - {/* The remainder are just '..' to prevent/minimise overflowing */} - 1 && i < parentGroups.length - 2}> - - {"..."} - - - - + {this.renderCrumb(parent, i, parentGroups)} {i !== parentGroups.length - 1 && ( diff --git a/lib/ReactViews/StandardUserInterface/customizable/ResponsiveSwitch.jsx b/lib/ReactViews/StandardUserInterface/customizable/ResponsiveSwitch.jsx index 0952345bc37..5414458697c 100644 --- a/lib/ReactViews/StandardUserInterface/customizable/ResponsiveSwitch.jsx +++ b/lib/ReactViews/StandardUserInterface/customizable/ResponsiveSwitch.jsx @@ -9,15 +9,10 @@ import PropTypes from "prop-types"; export default (LargeScreenComponent, SmallScreenComponent) => { // eslint-disable-next-line require-jsdoc function ResponsiveSwitch(props) { - return ( - - - - - - - - + return props.smallScreen ? ( + + ) : ( + ); } diff --git a/test/ReactViews/DataCatalog/CatalogGroupSpec.tsx b/test/ReactViews/DataCatalog/CatalogGroupSpec.tsx new file mode 100644 index 00000000000..8aa83fb516c --- /dev/null +++ b/test/ReactViews/DataCatalog/CatalogGroupSpec.tsx @@ -0,0 +1,53 @@ +import React from "react"; +import CatalogGroup from "../../../lib/ReactViews/DataCatalog/CatalogGroup"; +import Loader from "../../../lib/ReactViews/Loader"; +import { ThemeProvider } from "styled-components"; +import { terriaTheme } from "../../../lib/ReactViews/StandardUserInterface"; +import { create } from "react-test-renderer"; +import { act } from "react-dom/test-utils"; + +fdescribe("CatalogGroup", () => { + let testRenderer: ReturnType; + + describe("Loading", () => { + it("Shows loader", () => { + act(() => { + testRenderer = create( + + {}} + loading={true} + > + + ); + }); + expect(testRenderer.root.findByType(Loader)).toBeTruthy(); + expect(testRenderer.root.findAllByProps({ key: "empty" }).length).toEqual( + 0 + ); + }); + }); + describe("Empty", () => { + it("Shows empty message", () => { + act(() => { + testRenderer = create( + {}} + open={true} + emptyMessage="nothing here" + loading={false} + children={[]} + > + ); + }); + + expect( + testRenderer.root + .findAllByType("li") + .some((e) => e.children[0] === "nothing here") + ).toBe(true); + expect(testRenderer.root.findAllByType(Loader).length).toBe(0); + }); + }); +}); From d9d7473256c29d5286327ecba33379bdff793d3b Mon Sep 17 00:00:00 2001 From: Stephen Davies Date: Mon, 16 Oct 2023 12:52:26 +1100 Subject: [PATCH 21/53] Fix truncating branch name not working --- buildprocess/ci-deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildprocess/ci-deploy.sh b/buildprocess/ci-deploy.sh index d878ab4b7a3..22d951cad0a 100644 --- a/buildprocess/ci-deploy.sh +++ b/buildprocess/ci-deploy.sh @@ -10,7 +10,7 @@ if [[ $GITHUB_BRANCH =~ ^greenkeeper/ ]]; then fi # A version of the branch name that can be used as a DNS name once we prepend and append some stuff. -SAFE_BRANCH_NAME=$(printf '%s' "${GITHUB_BRANCH,,:0:40}" | sed 's/[^-a-z0-9]/-/g') +SAFE_BRANCH_NAME=$(printf '%s' "${GITHUB_BRANCH:0:40}" | sed -e 's/./\L&/g' -e 's/[^-a-z0-9]/-/g') gh api /repos/${GITHUB_REPOSITORY}/statuses/${GITHUB_SHA} -f state=pending -f context=deployment -f target_url=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID} From 67e87b6f649bc8264946ce2091a6e0c7fd17bcb1 Mon Sep 17 00:00:00 2001 From: Stephen Davies Date: Mon, 16 Oct 2023 14:48:12 +1100 Subject: [PATCH 22/53] Change branch name substring length to 32 as 40 character branch names still have problems --- buildprocess/ci-cleanup.js | 2 +- buildprocess/ci-deploy.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/buildprocess/ci-cleanup.js b/buildprocess/ci-cleanup.js index be06458c747..0fd6099c280 100644 --- a/buildprocess/ci-cleanup.js +++ b/buildprocess/ci-cleanup.js @@ -51,7 +51,7 @@ function makeSafeName(name) { return name .toLowerCase() .replace(/[^-a-z0-9]/g, "-") - .substring(0, 40); + .substring(0, 32); } function createIngress(branches) { diff --git a/buildprocess/ci-deploy.sh b/buildprocess/ci-deploy.sh index 22d951cad0a..b2c217782ba 100644 --- a/buildprocess/ci-deploy.sh +++ b/buildprocess/ci-deploy.sh @@ -10,7 +10,7 @@ if [[ $GITHUB_BRANCH =~ ^greenkeeper/ ]]; then fi # A version of the branch name that can be used as a DNS name once we prepend and append some stuff. -SAFE_BRANCH_NAME=$(printf '%s' "${GITHUB_BRANCH:0:40}" | sed -e 's/./\L&/g' -e 's/[^-a-z0-9]/-/g') +SAFE_BRANCH_NAME=$(printf '%s' "${GITHUB_BRANCH:0:32}" | sed -e 's/./\L&/g' -e 's/[^-a-z0-9]/-/g') gh api /repos/${GITHUB_REPOSITORY}/statuses/${GITHUB_SHA} -f state=pending -f context=deployment -f target_url=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID} From 76b2a0b7831898c835af68280f849a6a442cd2c4 Mon Sep 17 00:00:00 2001 From: Stephen Davies Date: Mon, 16 Oct 2023 15:17:14 +1100 Subject: [PATCH 23/53] Remove trailing dashes --- buildprocess/ci-cleanup.js | 3 ++- buildprocess/ci-deploy.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/buildprocess/ci-cleanup.js b/buildprocess/ci-cleanup.js index 0fd6099c280..071c11cf2df 100644 --- a/buildprocess/ci-cleanup.js +++ b/buildprocess/ci-cleanup.js @@ -51,7 +51,8 @@ function makeSafeName(name) { return name .toLowerCase() .replace(/[^-a-z0-9]/g, "-") - .substring(0, 32); + .substring(0, 32) + .replace(/-*$/, ""); } function createIngress(branches) { diff --git a/buildprocess/ci-deploy.sh b/buildprocess/ci-deploy.sh index b2c217782ba..c356eebc2d4 100644 --- a/buildprocess/ci-deploy.sh +++ b/buildprocess/ci-deploy.sh @@ -10,7 +10,7 @@ if [[ $GITHUB_BRANCH =~ ^greenkeeper/ ]]; then fi # A version of the branch name that can be used as a DNS name once we prepend and append some stuff. -SAFE_BRANCH_NAME=$(printf '%s' "${GITHUB_BRANCH:0:32}" | sed -e 's/./\L&/g' -e 's/[^-a-z0-9]/-/g') +SAFE_BRANCH_NAME=$(printf '%s' "${GITHUB_BRANCH:0:32}" | sed -e 's/./\L&/g' -e 's/[^-a-z0-9]/-/g' -e 's/-*$//') gh api /repos/${GITHUB_REPOSITORY}/statuses/${GITHUB_SHA} -f state=pending -f context=deployment -f target_url=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID} From c5fd9b7911e81e6354b296f69204ee5599c806cc Mon Sep 17 00:00:00 2001 From: Stephen Davies Date: Mon, 16 Oct 2023 16:33:57 +1100 Subject: [PATCH 24/53] Fix CI links for unsafe branch names --- buildprocess/ci-cleanup.js | 2 +- buildprocess/ci-deploy.sh | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/buildprocess/ci-cleanup.js b/buildprocess/ci-cleanup.js index 071c11cf2df..325a265b1ac 100644 --- a/buildprocess/ci-cleanup.js +++ b/buildprocess/ci-cleanup.js @@ -74,7 +74,7 @@ function createIngress(branches) { host: "ci.terria.io", http: { paths: branches.map((branch) => ({ - path: "/" + branch.name + "(/|$)(.*)", + path: "/" + makeSafeName(branch.name) + "(/|$)(.*)", pathType: "ImplementationSpecific", backend: { service: { diff --git a/buildprocess/ci-deploy.sh b/buildprocess/ci-deploy.sh index c356eebc2d4..06ff60bc1b0 100644 --- a/buildprocess/ci-deploy.sh +++ b/buildprocess/ci-deploy.sh @@ -12,6 +12,8 @@ fi # A version of the branch name that can be used as a DNS name once we prepend and append some stuff. SAFE_BRANCH_NAME=$(printf '%s' "${GITHUB_BRANCH:0:32}" | sed -e 's/./\L&/g' -e 's/[^-a-z0-9]/-/g' -e 's/-*$//') +[[ $SAFE_BRANCH_NAME != $GITHUB_BRANCH ]] && echo "::warning file=buildprocess/ci-deploy.sh::Branch name sanitised to '${SAFE_BRANCH_NAME}' for kubernetes resources. This may work, however using branch names less than 32 characters long with [a-z0-9] and hyphen separators are preferred" + gh api /repos/${GITHUB_REPOSITORY}/statuses/${GITHUB_SHA} -f state=pending -f context=deployment -f target_url=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID} # Install some tools we need from npm From 76dae0b0732c0916abd8ccc07354b37df9a275d0 Mon Sep 17 00:00:00 2001 From: Lawrence Owen Date: Thu, 12 Oct 2023 16:21:09 +1000 Subject: [PATCH 25/53] Remove jsx-control-flow-statements - Breadcrumbs.jsx: Fix missing key in Fragment - DataCatalogGroup.jsx: Explicit null to pass propType validation --- .babelrc | 1 - .eslintrc | 9 ++----- CHANGES.md | 1 + architecture/0001-babel-and-ts-loader.md | 2 +- buildprocess/configureWebpack.js | 1 - doc/contributing/frontend-style-guide.md | 2 -- .../DataCatalog/DataCatalogGroup.jsx | 25 ++++++++++--------- lib/ReactViews/Search/Breadcrumbs.jsx | 4 +-- package.json | 2 -- 9 files changed, 19 insertions(+), 28 deletions(-) diff --git a/.babelrc b/.babelrc index 36ddeb06e18..fcc5468eca1 100644 --- a/.babelrc +++ b/.babelrc @@ -11,7 +11,6 @@ ["@babel/typescript", { "allowNamespaces": true }] ], "plugins": [ - "babel-plugin-jsx-control-statements", "@babel/plugin-transform-modules-commonjs", ["@babel/plugin-proposal-decorators", { "legacy": true }], "@babel/plugin-proposal-class-properties", diff --git a/.eslintrc b/.eslintrc index 76596bb585b..c0d2b2cc5f3 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,9 +1,5 @@ { - "extends": [ - "eslint:recommended", - "plugin:react/recommended", - "plugin:jsx-control-statements/recommended" - ], + "extends": ["eslint:recommended", "plugin:react/recommended"], "parser": "@babel/eslint-parser", "parserOptions": { "requireConfigFile": false, @@ -19,7 +15,7 @@ "commonjs": true, "es6": true }, - "plugins": ["react", "jsx-control-statements"], + "plugins": ["react"], "globals": { "process": true }, @@ -29,7 +25,6 @@ } }, "rules": { - "jsx-control-statements/jsx-use-if-tag": 0, "react/jsx-no-undef": 0, /*Possible Errors */ diff --git a/CHANGES.md b/CHANGES.md index 490d3bb5d76..77f44582a37 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,7 @@ #### next release (8.3.7) - [The next improvement] +- Remove `jsx-control-statements` dependency #### 8.3.6 - 2023-10-03 diff --git a/architecture/0001-babel-and-ts-loader.md b/architecture/0001-babel-and-ts-loader.md index 6f1688c6011..457ab66f66e 100644 --- a/architecture/0001-babel-and-ts-loader.md +++ b/architecture/0001-babel-and-ts-loader.md @@ -24,7 +24,7 @@ support for it covers everything we need to use it in terriajs, including build times. - Using _only_ ts-loader is out of the question, as we rely on tools inside the - babel ecosystem including jsx-control-statements & styled-components to name a + babel ecosystem including styled-components to name a few. - Using _only_ babel - Using babel _with_ ts-loader in `transpileOnly` mode, if there are TypeScript diff --git a/buildprocess/configureWebpack.js b/buildprocess/configureWebpack.js index 32320e1d38b..b4ca392a087 100644 --- a/buildprocess/configureWebpack.js +++ b/buildprocess/configureWebpack.js @@ -130,7 +130,6 @@ function configureWebpack( ["@babel/typescript", { allowNamespaces: true }] ], plugins: [ - "babel-plugin-jsx-control-statements", "@babel/plugin-transform-modules-commonjs", ["@babel/plugin-proposal-decorators", { legacy: true }], "@babel/plugin-proposal-class-properties", diff --git a/doc/contributing/frontend-style-guide.md b/doc/contributing/frontend-style-guide.md index 4e78d106dc4..afcd37c2eff 100644 --- a/doc/contributing/frontend-style-guide.md +++ b/doc/contributing/frontend-style-guide.md @@ -167,5 +167,3 @@ const BoxSpan: any = require("../../../Styled/Box").BoxSpan; Components written in TypeScript will not need `PropTypes` defined on them, as type errors on props will be caught at compilation rather than a runtime check. - -All jsx-control-statements should be removed when migrating a .jsx file to .tsx. diff --git a/lib/ReactViews/DataCatalog/DataCatalogGroup.jsx b/lib/ReactViews/DataCatalog/DataCatalogGroup.jsx index db6135185f5..626069488e0 100644 --- a/lib/ReactViews/DataCatalog/DataCatalogGroup.jsx +++ b/lib/ReactViews/DataCatalog/DataCatalogGroup.jsx @@ -134,18 +134,19 @@ class DataCatalogGroup extends React.Component { this.props.terria )} > - {this.isOpen() && - group.memberModels.map((item) => ( - - ))} + {this.isOpen() + ? group.memberModels.map((item) => ( + + )) + : null} ); } diff --git a/lib/ReactViews/Search/Breadcrumbs.jsx b/lib/ReactViews/Search/Breadcrumbs.jsx index c13284549be..90d8c0c2e20 100644 --- a/lib/ReactViews/Search/Breadcrumbs.jsx +++ b/lib/ReactViews/Search/Breadcrumbs.jsx @@ -105,7 +105,7 @@ class Breadcrumbs extends React.Component { {parentGroups && parentGroups.map((parent, i) => ( - <> + {this.renderCrumb(parent, i, parentGroups)} {i !== parentGroups.length - 1 && ( @@ -114,7 +114,7 @@ class Breadcrumbs extends React.Component { )} - + ))}
    diff --git a/package.json b/package.json index 35fc2b61343..0b982e71840 100644 --- a/package.json +++ b/package.json @@ -82,7 +82,6 @@ "@visx/tooltip": "^2.1.0", "assimpjs": "^0.0.7", "babel-loader": "^8.2.3", - "babel-plugin-jsx-control-statements": "^4.0.0", "babel-plugin-lodash": "^3.3.4", "bottleneck": "^2.19.5", "catalog-converter": "^0.0.9", @@ -194,7 +193,6 @@ "@types/webpack": "4.41.33", "babel-plugin-styled-components": "^1.10.7", "eslint": "^7.20.0", - "eslint-plugin-jsx-control-statements": "^2.2.1", "eslint-plugin-react": "^7.19.0", "fork-ts-checker-notifier-webpack-plugin": "^6.0.0", "fork-ts-checker-webpack-plugin": "^6.0.0", From 49d259f97bd56216051313b7312cd9170beef7b0 Mon Sep 17 00:00:00 2001 From: Lawrence Owen Date: Tue, 17 Oct 2023 10:39:49 +1000 Subject: [PATCH 26/53] Update architecture/0001-babel-and-ts-loader.md Co-authored-by: Stephen Davies --- architecture/0001-babel-and-ts-loader.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/architecture/0001-babel-and-ts-loader.md b/architecture/0001-babel-and-ts-loader.md index 457ab66f66e..4e2255ee8c1 100644 --- a/architecture/0001-babel-and-ts-loader.md +++ b/architecture/0001-babel-and-ts-loader.md @@ -24,7 +24,7 @@ support for it covers everything we need to use it in terriajs, including build times. - Using _only_ ts-loader is out of the question, as we rely on tools inside the - babel ecosystem including styled-components to name a + babel ecosystem including ~jsx-control-statements~ (removed 2023-10-16) & styled-components to name a few. - Using _only_ babel - Using babel _with_ ts-loader in `transpileOnly` mode, if there are TypeScript From 18e8eb0a6a07305766ccb2878133bccc3a290924 Mon Sep 17 00:00:00 2001 From: Lawrence Owen Date: Tue, 17 Oct 2023 10:47:32 +1000 Subject: [PATCH 27/53] Fix: nullish check on loading prop --- lib/ReactViews/DataCatalog/CatalogGroup.jsx | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/lib/ReactViews/DataCatalog/CatalogGroup.jsx b/lib/ReactViews/DataCatalog/CatalogGroup.jsx index 4028e0f082b..ceddfb2a093 100644 --- a/lib/ReactViews/DataCatalog/CatalogGroup.jsx +++ b/lib/ReactViews/DataCatalog/CatalogGroup.jsx @@ -129,16 +129,14 @@ function CatalogGroup(props) { )} - {props.loading === false && - props.children.length === 0 && - props.emptyMessage && ( -
  • - {props.emptyMessage} -
  • - )} + {!props.loading && props.children.length === 0 && props.emptyMessage && ( +
  • + {props.emptyMessage} +
  • + )} {props.children} From d6074d6085a800023a9dceb6b28db040ce688f7d Mon Sep 17 00:00:00 2001 From: Nick Forbes-Smith Date: Mon, 23 Oct 2023 21:28:26 +1100 Subject: [PATCH 28/53] Add geojson/protomaps time-series support --- CHANGES.md | 3 + .../ProtomapsImageryProvider.ts | 90 +++++++++++-------- lib/ModelMixins/GeojsonMixin.ts | 69 +++++++++++--- lib/Table/TableStyle.ts | 33 ++++--- 4 files changed, 135 insertions(+), 60 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index e3233e787d2..f382297869f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,9 @@ - Fix `WebMapServiceCatalogItem` `allowFeaturePicking` - Allow translation of TableStylingWorkflow. - Fix "Remove all" not removing selected/picked features +- Fix crash on empty GeoJSON features +- Add `tableFeatureInfoContext` support to `GeoJsonMixin.createProtomapsImageryProvider` +- Fix `GeoJsonMixin` timeline animation for lines/polygons - [The next improvement] #### 8.3.6 - 2023-10-03 diff --git a/lib/Map/ImageryProvider/ProtomapsImageryProvider.ts b/lib/Map/ImageryProvider/ProtomapsImageryProvider.ts index b4a7a546144..cf29e8f651a 100644 --- a/lib/Map/ImageryProvider/ProtomapsImageryProvider.ts +++ b/lib/Map/ImageryProvider/ProtomapsImageryProvider.ts @@ -96,6 +96,10 @@ interface Options { /** The name of the property that is a unique ID for features */ idProperty?: string; + + processPickedFeatures?: ( + features: ImageryLayerFeatureInfo[] + ) => Promise; } /** Buffer (in pixels) used when rendering (and generating - through geojson-vt) vector tiles */ @@ -288,11 +292,14 @@ export default class ProtomapsImageryProvider // Protomaps properties /** Data object from constructor options (this is transformed into `source`) */ private readonly data: ProtomapsData; - readonly maximumNativeZoom: number; private readonly labelers: Labelers; private readonly view: View | undefined; - readonly idProperty: string; + private readonly processPickedFeatures?: ( + features: ImageryLayerFeatureInfo[] + ) => Promise; + readonly maximumNativeZoom: number; + readonly idProperty: string; readonly source: Source; readonly paintRules: PaintRule[]; readonly labelRules: LabelRule[]; @@ -399,6 +406,8 @@ export default class ProtomapsImageryProvider 16, () => undefined ); + + this.processPickedFeatures = options.processPickedFeatures; } getTileCredits(x: number, y: number, level: number): Credit[] { @@ -490,6 +499,7 @@ export default class ProtomapsImageryProvider longitude: number, latitude: number ): Promise { + const featureInfos: ImageryLayerFeatureInfo[] = []; // If view is set - this means we are using actual vector tiles (that is not GeoJson object) // So we use this.view.queryFeatures if (this.view) { @@ -498,37 +508,36 @@ export default class ProtomapsImageryProvider (r) => r.dataLayer ); - return filterOutUndefined( - this.view - .queryFeatures( - CesiumMath.toDegrees(longitude), - CesiumMath.toDegrees(latitude), - level + this.view + .queryFeatures( + CesiumMath.toDegrees(longitude), + CesiumMath.toDegrees(latitude), + level + ) + .forEach((f) => { + // Only create FeatureInfo for visible features with properties + if ( + !f.feature.props || + isEmpty(f.feature.props) || + !renderedLayers.includes(f.layerName) ) - .map((f) => { - // Only create FeatureInfo for visible features with properties - if ( - !f.feature.props || - isEmpty(f.feature.props) || - !renderedLayers.includes(f.layerName) - ) - return; - - const featureInfo = new ImageryLayerFeatureInfo(); - - // Add Layer name property - featureInfo.properties = Object.assign( - { [LAYER_NAME_PROP]: f.layerName }, - f.feature.props ?? {} - ); - featureInfo.position = new Cartographic(longitude, latitude); + return; - featureInfo.configureDescriptionFromProperties(f.feature.props); - featureInfo.configureNameFromProperties(f.feature.props); + const featureInfo = new ImageryLayerFeatureInfo(); + + // Add Layer name property + featureInfo.properties = Object.assign( + { [LAYER_NAME_PROP]: f.layerName }, + f.feature.props ?? {} + ); + featureInfo.position = new Cartographic(longitude, latitude); + + featureInfo.configureDescriptionFromProperties(f.feature.props); + featureInfo.configureNameFromProperties(f.feature.props); + + featureInfos.push(featureInfo); + }); - return featureInfo; - }) - ); // No view is set and we have geoJSON object // So we pick features manually } else if ( @@ -556,12 +565,12 @@ export default class ProtomapsImageryProvider const bufferBbox = bbox(buffer); // Get array of all features - let features: Feature[] = this.source.geojsonObject.features; + let geojsonFeatures: Feature[] = this.source.geojsonObject.features; const pickedFeatures: Feature[] = []; - for (let index = 0; index < features.length; index++) { - const feature = features[index]; + for (let index = 0; index < geojsonFeatures.length; index++) { + const feature = geojsonFeatures[index]; if (!feature.bbox) { feature.bbox = bbox(feature); } @@ -591,7 +600,7 @@ export default class ProtomapsImageryProvider } // Convert pickedFeatures to ImageryLayerFeatureInfos - return pickedFeatures.map((f) => { + pickedFeatures.forEach((f) => { const featureInfo = new ImageryLayerFeatureInfo(); featureInfo.data = f; @@ -611,10 +620,15 @@ export default class ProtomapsImageryProvider featureInfo.configureDescriptionFromProperties(f.properties); featureInfo.configureNameFromProperties(f.properties); - return featureInfo; + featureInfos.push(featureInfo); }); } - return []; + + if (this.processPickedFeatures) { + return await this.processPickedFeatures(featureInfos); + } + + return featureInfos; } private clone(options?: Partial) { @@ -655,7 +669,9 @@ export default class ProtomapsImageryProvider rectangle: options?.rectangle ?? this.rectangle, credit: options?.credit ?? this.credit, paintRules: options?.paintRules ?? this.paintRules, - labelRules: options?.labelRules ?? this.labelRules + labelRules: options?.labelRules ?? this.labelRules, + processPickedFeatures: + options?.processPickedFeatures ?? this.processPickedFeatures }); } diff --git a/lib/ModelMixins/GeojsonMixin.ts b/lib/ModelMixins/GeojsonMixin.ts index 902b133fa09..6ce753bd160 100644 --- a/lib/ModelMixins/GeojsonMixin.ts +++ b/lib/ModelMixins/GeojsonMixin.ts @@ -18,21 +18,21 @@ import { action, computed, IReactionDisposer, + makeObservable, observable, onBecomeObserved, onBecomeUnobserved, + override, reaction, runInAction, - toJS, - makeObservable, - override + toJS } from "mobx"; import { createTransformer } from "mobx-utils"; import { - Feature as ProtomapsFeature, GeomType, LineSymbolizer, - PolygonSymbolizer + PolygonSymbolizer, + Feature as ProtomapsFeature } from "protomaps"; import Cartesian2 from "terriajs-cesium/Source/Core/Cartesian2"; import Cartesian3 from "terriajs-cesium/Source/Core/Cartesian3"; @@ -58,12 +58,14 @@ import PolygonGraphics from "terriajs-cesium/Source/DataSources/PolygonGraphics" import PolylineGraphics from "terriajs-cesium/Source/DataSources/PolylineGraphics"; import Property from "terriajs-cesium/Source/DataSources/Property"; import HeightReference from "terriajs-cesium/Source/Scene/HeightReference"; +import ImageryLayerFeatureInfo from "terriajs-cesium/Source/Scene/ImageryLayerFeatureInfo"; import AbstractConstructor from "../Core/AbstractConstructor"; import filterOutUndefined from "../Core/filterOutUndefined"; import formatPropertyValue from "../Core/formatPropertyValue"; import hashFromString from "../Core/hashFromString"; import isDefined from "../Core/isDefined"; import { + isJsonArray, isJsonNumber, isJsonObject, isJsonString, @@ -73,8 +75,8 @@ import { isJson } from "../Core/loadBlob"; import StandardCssColors from "../Core/StandardCssColors"; import TerriaError, { networkRequestError } from "../Core/TerriaError"; import ProtomapsImageryProvider, { - GeojsonSource, GEOJSON_SOURCE_LAYER_NAME, + GeojsonSource, ProtomapsData } from "../Map/ImageryProvider/ProtomapsImageryProvider"; import Reproject from "../Map/Vector/Reproject"; @@ -90,7 +92,7 @@ import { ViewingControl } from "../Models/ViewingControls"; import TableStylingWorkflow from "../Models/Workflows/TableStylingWorkflow"; import createLongitudeLatitudeFeaturePerRow from "../Table/createLongitudeLatitudeFeaturePerRow"; import TableAutomaticStylesStratum from "../Table/TableAutomaticStylesStratum"; -import TableStyle from "../Table/TableStyle"; +import TableStyle, { createRowGroupId } from "../Table/TableStyle"; import { isConstantStyleMap } from "../Table/TableStyleMap"; import { GeoJsonTraits } from "../Traits/TraitsClasses/GeoJsonTraits"; import { RectangleTraits } from "../Traits/TraitsClasses/MappableTraits"; @@ -100,6 +102,7 @@ import { ExportData } from "./ExportableMixin"; import FeatureInfoUrlTemplateMixin from "./FeatureInfoUrlTemplateMixin"; import { isDataSource } from "./MappableMixin"; import TableMixin from "./TableMixin"; +import { TerriaFeatureData } from "../Models/Feature/FeatureData"; export const FEATURE_ID_PROP = "_id_"; @@ -295,7 +298,7 @@ function GeoJsonMixin>(Base: T) { () => [ this.useTableStylingAndProtomaps, this.readyData, - this.currentTimeAsJulianDate, + this.currentDiscreteTimeIndex, this.activeTableStyle.timeIntervals, this.activeTableStyle.colorMap, this.activeTableStyle.pointSizeMap, @@ -502,6 +505,7 @@ function GeoJsonMixin>(Base: T) { const features = geoJsonWgs84.features; geoJsonWgs84.features = []; + let currentFeatureId = 0; for (let i = 0; i < features.length; i++) { const feature = features[i]; @@ -509,6 +513,13 @@ function GeoJsonMixin>(Base: T) { if (!isJsonObject(feature.geometry, false) || !feature.geometry.type) continue; + // Ignore features with invalid coordinates + if ( + !isJsonArray(feature.geometry.coordinates, false) || + feature.geometry.coordinates.length === 0 + ) + continue; + if (!feature.properties) { feature.properties = {}; } @@ -528,7 +539,7 @@ function GeoJsonMixin>(Base: T) { // Add feature index to FEATURE_ID_PROP ("_id_") feature property // This is used to refer to each feature in TableMixin (as row ID) const properties = feature.properties!; - properties[FEATURE_ID_PROP] = i; + properties[FEATURE_ID_PROP] = currentFeatureId; // Count features types if (feature.geometry.type === "Point") { @@ -553,11 +564,17 @@ function GeoJsonMixin>(Base: T) { } featureCounts.total++; + // Note it is important to increment currentFeatureId only if we are including the feature - as this needs to match the row ID in TableMixin (through dataColumnMajor) + currentFeatureId++; } runInAction(() => { this.featureCounts = featureCounts; - this._readyData = geoJsonWgs84; + if (featureCounts.total === 0) { + this._readyData = undefined; + } else { + this._readyData = geoJsonWgs84; + } }); if (isDefined(czmlTemplate)) { @@ -800,7 +817,37 @@ function GeoJsonMixin>(Base: T) { } // See `createPoints` for Point features - they are handled by Cesium ], - labelRules: [] + labelRules: [], + + // Process picked features to add terriaFeatureData (with rowIds) + // This is used by tableFeatureInfoContext to add time-series chart + processPickedFeatures: async (features) => { + if (!currentTimeRows) return features; + const processedFeatures: ImageryLayerFeatureInfo[] = []; + features.forEach((f) => { + const rowId = f.properties?.[FEATURE_ID_PROP]; + + if (isDefined(rowId) && currentTimeRows?.includes(rowId)) { + // To find rowIds for all features in a row group: + // re-create the rowGroupId and then look up in the activeTableStyle.rowGroups + const rowGroupId = createRowGroupId( + rowId, + this.activeTableStyle.groupByColumns + ); + const terriaFeatureData: TerriaFeatureData = { + ...f.data, + type: "terriaFeatureData", + rowIds: this.activeTableStyle.rowGroups.find( + (group) => group[0] === rowGroupId + )?.[1] + }; + f.data = terriaFeatureData; + + processedFeatures.push(f); + } + }); + return processedFeatures; + } }); provider = this.wrapImageryPickFeatures(provider); diff --git a/lib/Table/TableStyle.ts b/lib/Table/TableStyle.ts index e6d26a1b0e2..77a7bd6dc41 100644 --- a/lib/Table/TableStyle.ts +++ b/lib/Table/TableStyle.ts @@ -605,9 +605,9 @@ export default class TableStyle { return finishDates; } - /** Get rows grouped by id. Id will be calculated using idColumns, latitude/longitude columns or region column + /** Columns used in rowGroups - idColumns, latitude/longitude columns or region column */ - @computed get rowGroups() { + @computed get groupByColumns() { let groupByCols = this.idColumns; if (!groupByCols) { @@ -618,22 +618,18 @@ export default class TableStyle { } else if (this.regionColumn) groupByCols = [this.regionColumn]; } - if (!groupByCols) groupByCols = []; + return groupByCols ?? []; + } + /** Get rows grouped by id. + */ + @computed get rowGroups() { const tableRowIds = this.tableModel.rowIds; return ( Object.entries( groupBy(tableRowIds, (rowId) => - groupByCols! - .map((col) => { - // If using region column as ID - only use valid regions - if (col.type === TableColumnType.region) { - return col.valuesAsRegions.regionIds[rowId]; - } - return col.values[rowId]; - }) - .join("-") + createRowGroupId(rowId, this.groupByColumns) ) ) // Filter out bad IDs @@ -746,6 +742,19 @@ export default class TableStyle { } } +/** Create row group ID by concatenating values for columns */ +export function createRowGroupId(rowId: number, columns: TableColumn[]) { + return columns + .map((col) => { + // If using region column as ID - only use valid regions + if (col.type === TableColumnType.region) { + return col.valuesAsRegions.regionIds[rowId]; + } + return col.values[rowId]; + }) + .join("-"); +} + /** * Returns an array of sorted unique dates */ From fca4c8e511cec9356c191f709a98c4afdfceaa17 Mon Sep 17 00:00:00 2001 From: Nick Forbes-Smith Date: Mon, 23 Oct 2023 21:36:05 +1100 Subject: [PATCH 29/53] add to changes --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index f382297869f..c97179ae786 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,6 +8,7 @@ - Fix crash on empty GeoJSON features - Add `tableFeatureInfoContext` support to `GeoJsonMixin.createProtomapsImageryProvider` - Fix `GeoJsonMixin` timeline animation for lines/polygons +- Fix bug in mismatched GeoJSON Feature `_id_` and TableMixin `rowId` - this was causing incorrect styling when using `filterByProperties` or features had `null` geometry - [The next improvement] #### 8.3.6 - 2023-10-03 From f98b8d7121a8c262d46d93d3819e1a26b7ab04a2 Mon Sep 17 00:00:00 2001 From: Nick Forbes-Smith Date: Tue, 24 Oct 2023 13:52:02 +1100 Subject: [PATCH 30/53] Fix geojson splitter --- CHANGES.md | 1 + lib/Table/TableAutomaticStylesStratum.ts | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index c97179ae786..b435f7cf136 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,6 +9,7 @@ - Add `tableFeatureInfoContext` support to `GeoJsonMixin.createProtomapsImageryProvider` - Fix `GeoJsonMixin` timeline animation for lines/polygons - Fix bug in mismatched GeoJSON Feature `_id_` and TableMixin `rowId` - this was causing incorrect styling when using `filterByProperties` or features had `null` geometry +- Fix splitter for `GeoJsonMixin` (lines and polygon features only) - [The next improvement] #### 8.3.6 - 2023-10-03 diff --git a/lib/Table/TableAutomaticStylesStratum.ts b/lib/Table/TableAutomaticStylesStratum.ts index 0e111331f89..6c4705efe4e 100644 --- a/lib/Table/TableAutomaticStylesStratum.ts +++ b/lib/Table/TableAutomaticStylesStratum.ts @@ -18,6 +18,7 @@ import TableStyleTraits from "../Traits/TraitsClasses/Table/StyleTraits"; import TableTimeStyleTraits from "../Traits/TraitsClasses/Table/TimeStyleTraits"; import TableTraits from "../Traits/TraitsClasses/Table/TableTraits"; import TableColumnType from "./TableColumnType"; +import { ImageryParts } from "../ModelMixins/MappableMixin"; const DEFAULT_ID_COLUMN = "id"; @@ -55,9 +56,7 @@ export default class TableAutomaticStylesStratum extends LoadableStratum( @computed get disableSplitter() { - return !isDefined(this.catalogItem.activeTableStyle.regionColumn) - ? true - : undefined; + return !this.catalogItem.mapItems.find(ImageryParts.is) ? true : undefined; } /** From 5154c420baf1842cf9e191b81a80bcdc96df1ca0 Mon Sep 17 00:00:00 2001 From: Nick Forbes-Smith Date: Tue, 24 Oct 2023 16:28:56 +1100 Subject: [PATCH 31/53] Add tests --- .../CatalogItems/GeoJsonCatalogItemSpec.ts | 292 +++++++++++++++++- wwwroot/test/GeoJSON/empty-geoms.geojson | 124 ++++++++ .../time-based-automatic-styles.geojson | 220 ++++++++++--- 3 files changed, 577 insertions(+), 59 deletions(-) create mode 100644 wwwroot/test/GeoJSON/empty-geoms.geojson diff --git a/test/Models/Catalog/CatalogItems/GeoJsonCatalogItemSpec.ts b/test/Models/Catalog/CatalogItems/GeoJsonCatalogItemSpec.ts index a2c62a71caf..3326b0705d4 100644 --- a/test/Models/Catalog/CatalogItems/GeoJsonCatalogItemSpec.ts +++ b/test/Models/Catalog/CatalogItems/GeoJsonCatalogItemSpec.ts @@ -1,11 +1,11 @@ -import { runInAction } from "mobx"; +import { reaction, runInAction } from "mobx"; import { GeomType, LineSymbolizer, PolygonSymbolizer } from "protomaps"; import { CustomDataSource } from "terriajs-cesium"; import Cartesian2 from "terriajs-cesium/Source/Core/Cartesian2"; import Cartesian3 from "terriajs-cesium/Source/Core/Cartesian3"; -import createGuid from "terriajs-cesium/Source/Core/createGuid"; import Iso8601 from "terriajs-cesium/Source/Core/Iso8601"; import JulianDate from "terriajs-cesium/Source/Core/JulianDate"; +import createGuid from "terriajs-cesium/Source/Core/createGuid"; import Entity from "terriajs-cesium/Source/DataSources/Entity"; import GeoJsonDataSource from "terriajs-cesium/Source/DataSources/GeoJsonDataSource"; import HeightReference from "terriajs-cesium/Source/Scene/HeightReference"; @@ -20,12 +20,19 @@ import { FEATURE_ID_PROP, getColor } from "../../../../lib/ModelMixins/GeojsonMixin"; -import { isDataSource } from "../../../../lib/ModelMixins/MappableMixin"; +import { + ImageryParts, + isDataSource +} from "../../../../lib/ModelMixins/MappableMixin"; import GeoJsonCatalogItem from "../../../../lib/Models/Catalog/CatalogItems/GeoJsonCatalogItem"; import SplitItemReference from "../../../../lib/Models/Catalog/CatalogReferences/SplitItemReference"; import CommonStrata from "../../../../lib/Models/Definition/CommonStrata"; import updateModelFromJson from "../../../../lib/Models/Definition/updateModelFromJson"; import TerriaFeature from "../../../../lib/Models/Feature/Feature"; +import { + TerriaFeatureData, + isTerriaFeatureData +} from "../../../../lib/Models/Feature/FeatureData"; import Terria from "../../../../lib/Models/Terria"; describe("GeoJsonCatalogItemSpec", () => { @@ -497,9 +504,7 @@ describe("GeoJsonCatalogItemSpec", () => { expect(entities.length).toEqual(1); const entity1 = entities[0]; - console.log( - entity1.properties?.getValue(terria.timelineClock.currentTime).year - ); + expect( entity1.properties?.getValue(terria.timelineClock.currentTime).year ).toBe(2019); @@ -823,6 +828,8 @@ describe("GeoJsonCatalogItemSpec", () => { ?.getValue(terria.timelineClock.currentTime) ?.toCssColorString() ).toBe("rgb(103,0,13)"); + + expect(geojson.disableSplitter).toBeTruthy(); }); it("Supports LegendOwnerTraits to override TableMixin.legends", async () => { @@ -922,12 +929,13 @@ describe("GeoJsonCatalogItemSpec", () => { geojson.setTrait( CommonStrata.user, "geoJsonString", - `{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"stroke":"#555555","stroke-width":2,"stroke-opacity":1,"fill":"#ff0051","fill-opacity":0.5},"geometry":{"type":"Polygon","coordinates":[[[35.859375,53.54030739150022],[11.25,40.17887331434696],[15.1171875,14.604847155053898],[53.4375,44.84029065139799],[35.859375,53.54030739150022]]]}},{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[85.4296875,66.93006025862448],[53.4375,43.83452678223682],[89.296875,34.88593094075317],[91.40625,50.958426723359935],[85.4296875,66.93006025862448]]]}},{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[119.17968749999999,66.79190947341796],[100.1953125,53.74871079689897],[109.3359375,47.517200697839414],[119.17968749999999,66.79190947341796]]]}},{"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[30.585937499999996,-2.108898659243126]}},{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[71.015625,-2.811371193331128],[99.49218749999999,-2.811371193331128],[99.49218749999999,18.646245142670608],[71.015625,18.646245142670608],[71.015625,-2.811371193331128]]]}},{"type":"Feature","properties":{},"geometry":{"type":"LineString","coordinates":[[140.9765625,19.642587534013032],[134.296875,-17.978733095556155],[88.9453125,-36.597889133070204],[119.53125,15.961329081596647],[130.078125,27.371767300523047]]}}]}` + `{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"stroke":"#555555","stroke-width":2,"stroke-opacity":1,"fill":"#ff0051","fill-opacity":0.5},"geometry":{"type":"Polygon","coordinates":[[[35.859375,53.54030739150022],[11.25,40.17887331434696],[15.1171875,14.604847155053898],[53.4375,44.84029065139799],[35.859375,53.54030739150022]]]}},{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[85.4296875,66.93006025862448],[53.4375,43.83452678223682],[89.296875,34.88593094075317],[91.40625,50.958426723359935],[85.4296875,66.93006025862448]]]}},{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[119.17968749999999,66.79190947341796],[100.1953125,53.74871079689897],[109.3359375,47.517200697839414],[119.17968749999999,66.79190947341796]]]}},{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[71.015625,-2.811371193331128],[99.49218749999999,-2.811371193331128],[99.49218749999999,18.646245142670608],[71.015625,18.646245142670608],[71.015625,-2.811371193331128]]]}},{"type":"Feature","properties":{},"geometry":{"type":"LineString","coordinates":[[140.9765625,19.642587534013032],[134.296875,-17.978733095556155],[88.9453125,-36.597889133070204],[119.53125,15.961329081596647],[130.078125,27.371767300523047]]}}]}` ); await geojson.loadMapItems(); expect(geojson.mapItems[0] instanceof GeoJsonDataSource).toBeFalsy(); expect(geojson.useTableStylingAndProtomaps).toBeTruthy(); expect(geojson.legends.length).toBe(1); + expect(geojson.disableSplitter).toBeFalsy(); }); it("Disabled protomaps - More than 50% features detected", async () => { @@ -942,6 +950,143 @@ describe("GeoJsonCatalogItemSpec", () => { expect(geojson.useTableStylingAndProtomaps).toBeFalsy(); expect(geojson.legends.length).toBe(0); + expect(geojson.disableSplitter).toBeTruthy(); + }); + + it("correctly matches feature _id_ with table rowId - with features with empty geoms", async () => { + geojson.setTrait( + CommonStrata.user, + "url", + "test/GeoJSON/empty-geoms.geojson" + ); + + await geojson.loadMapItems(); + expect(geojson.readyData?.features.length).toBe(4); + // Check _id_ vs rowIds + expect( + geojson.readyData?.features.map((f) => f.properties?.[FEATURE_ID_PROP]) + ).toEqual(geojson.rowIds); + // Check "someOtherProp" column + expect( + geojson.readyData?.features.map((f) => f.properties?.someOtherProp) + ).toEqual( + geojson.tableColumns.find((c) => c.name === "someOtherProp") + ?.values as string[] + ); + }); + + it("correctly matches feature _id_ with table rowId - with filterByProperties", async () => { + geojson.setTrait( + CommonStrata.user, + "url", + "test/GeoJSON/time-based.geojson" + ); + geojson.setTrait(CommonStrata.user, "filterByProperties", { + year: 2019 + }); + await geojson.loadMapItems(); + + expect(geojson.readyData?.features.length).toBe(1); + expect( + geojson.readyData?.features.map((f) => f.properties?.[FEATURE_ID_PROP]) + ).toEqual(geojson.rowIds); + }); + + it("supports time", async function () { + geojson.setTrait( + CommonStrata.definition, + "url", + "test/GeoJSON/time-based-automatic-styles.geojson" + ); + + updateModelFromJson(geojson, CommonStrata.definition, { + currentTime: "2018-01-01", + defaultStyle: { + time: { timeColumn: "date", idColumns: ["idProperty"] } + } + }); + + const observeMapItems = reaction( + () => [geojson.mapItems], + () => {} + ); + + (await geojson.loadMapItems()).throwIfError(); + + expect(geojson.activeTableStyle.timeColumn?.name).toBe("date"); + + const firstProtomapsImageryProvider = + "imageryProvider" in geojson.mapItems[0] + ? (geojson.mapItems[0].imageryProvider as ProtomapsImageryProvider) + : undefined; + + if (!firstProtomapsImageryProvider) throw "protomaps should be defined"; + + const testFeature = { + props: {}, + geomType: GeomType.Polygon, + numVertices: 0, + geom: [], + bbox: { minX: 0, minY: 0, maxX: 0, maxY: 0 } + }; + + const firstFilter = firstProtomapsImageryProvider.paintRules[0].filter; + + if (!firstFilter) { + throw "filter should be defined"; + } + + // Current time is 2018-01-01 + // First feature maps to 2018-01-01 + testFeature.props = { [FEATURE_ID_PROP]: 0 }; + expect(firstFilter(0, testFeature)).toBeTruthy(); + + // Second feature maps to 2019-01-01 + testFeature.props = { [FEATURE_ID_PROP]: 1 }; + expect(firstFilter(0, testFeature)).toBeFalsy(); + + // Change time to 2019-01-01 + geojson.setTrait(CommonStrata.definition, "currentTime", "2019-01-01"); + + // Check new imagery provider + const nextProtomapsImageryProvider = + "imageryProvider" in geojson.mapItems[0] + ? (geojson.mapItems[0].imageryProvider as ProtomapsImageryProvider) + : undefined; + + if (!nextProtomapsImageryProvider) throw "protomaps should be defined"; + + const nextFilter = nextProtomapsImageryProvider.paintRules[0].filter; + + if (!nextFilter) { + throw "filter should be defined"; + } + + testFeature.props = { [FEATURE_ID_PROP]: 0 }; + expect(nextFilter(0, testFeature)).toBeFalsy(); + testFeature.props = { [FEATURE_ID_PROP]: 1 }; + expect(nextFilter(0, testFeature)).toBeTruthy(); + + expect( + firstProtomapsImageryProvider === nextProtomapsImageryProvider + ).toBeFalsy(); + + // Now change the currentTime to 2019- g01-02 - this should not trigger a new imagery provider - as it within the current time interval + geojson.setTrait(CommonStrata.definition, "currentTime", "2019-01-02"); + + // Check new imagery provider + const lastProtomapsImageryProvider = + "imageryProvider" in geojson.mapItems[0] + ? (geojson.mapItems[0].imageryProvider as ProtomapsImageryProvider) + : undefined; + + if (!lastProtomapsImageryProvider) throw "protomaps should be defined"; + + expect( + nextProtomapsImageryProvider === lastProtomapsImageryProvider + ).toBeTruthy(); + + observeMapItems(); }); }); @@ -986,12 +1131,14 @@ describe("GeoJsonCatalogItemSpec", () => { geojson = new GeoJsonCatalogItem("test-geojson", terria); }); - it("protomaps-mvt", async function () { + it("protomaps-mvt - polygons/lines", async function () { terria.addModel(geojson); - const geojsonString = await loadText("test/GeoJSON/cemeteries.geojson"); + const geojsonString = await loadText("test/GeoJSON/time-based.geojson"); geojson.setTrait(CommonStrata.user, "geoJsonString", geojsonString); await geojson.loadMapItems(); + expect(geojson.disableSplitter).toBeFalsy(); + const split = new SplitItemReference(createGuid(), terria); split.setTrait( CommonStrata.definition, @@ -1009,6 +1156,15 @@ describe("GeoJsonCatalogItemSpec", () => { (await (split.target as GeoJsonCatalogItem).loadMapItems()).error ).toBeUndefined(); }); + + it("cesium - points - splitter disabled", async function () { + terria.addModel(geojson); + const geojsonString = await loadText("test/GeoJSON/cemeteries.geojson"); + geojson.setTrait(CommonStrata.user, "geoJsonString", geojsonString); + await geojson.loadMapItems(); + + expect(geojson.disableSplitter).toBeTruthy(); + }); }); describe("geojson handles reprojection", function () { @@ -1218,5 +1374,123 @@ describe("GeoJsonCatalogItemSpec", () => { throw "Invalid geojson.mapItems"; } }); + + it("ProtomapsImageryProvider pickFeatures", async function () { + const geojsonData = { + type: "FeatureCollection", + features: [ + { + type: "Feature", + properties: {}, + geometry: { + type: "Polygon", + coordinates: [ + [ + [145.5908203125, -40.17887331434695], + [143.349609375, -42.08191667830631], + [146.35986328124997, -44.040218713142124], + [149.08447265625, -42.859859815062784], + [148.55712890625, -41.36031866306708], + [145.5908203125, -40.17887331434695] + ] + ] + } + }, + { + type: "Feature", + properties: {}, + geometry: { + type: "Polygon", + coordinates: [ + [ + [75.9375, 51.069016659603896], + [59.94140624999999, 39.095962936305476], + [79.453125, 42.032974332441405], + [80.15625, 46.800059446787316], + [75.673828125, 51.45400691005982], + [75.9375, 51.069016659603896] + ] + ] + } + } + ] + }; + geojson.setTrait( + CommonStrata.definition, + "geoJsonString", + JSON.stringify(geojsonData) + ); + + (await geojson.loadMapItems()).throwIfError(); + + const imagery = geojson.mapItems[0] as ImageryParts; + + expect( + imagery.imageryProvider instanceof ProtomapsImageryProvider + ).toBeTruthy(); + + const spyOnProcessPickedFeatures = spyOn( + imagery.imageryProvider, + "pickFeatures" + ).and.callThrough(); + + const features = + (await imagery.imageryProvider.pickFeatures( + 1, + 1, + 3, + 1.2946797849754814, + 0.7826107094181278 + )) ?? []; + + expect(spyOnProcessPickedFeatures).toHaveBeenCalledTimes(1); + expect(features.length).toBe(1); + expect(features[0].data.geometry).toEqual( + geojsonData.features[1].geometry + ); + }); + + it("ProtomapsImageryProvider pickFeatures - with time", async function () { + geojson.setTrait( + CommonStrata.definition, + "url", + "test/GeoJSON/time-based-automatic-styles.geojson" + ); + + updateModelFromJson(geojson, CommonStrata.definition, { + defaultStyle: { + time: { timeColumn: "date", idColumns: ["idProperty"] } + } + }); + + (await geojson.loadMapItems()).throwIfError(); + + const imagery = geojson.mapItems[0] as ImageryParts; + + expect( + imagery.imageryProvider instanceof ProtomapsImageryProvider + ).toBeTruthy(); + + const spyOnProcessPickedFeatures = spyOn( + imagery.imageryProvider, + "pickFeatures" + ).and.callThrough(); + + const features = + (await imagery.imageryProvider.pickFeatures( + 59166, + 40202, + 16, + 2.5309053894540012, + -0.6590723957845167 + )) ?? []; + + expect(spyOnProcessPickedFeatures).toHaveBeenCalledTimes(1); + expect(features.length).toBe(1); + expect(isTerriaFeatureData(features[0].data)).toBeTruthy(); + + const terriaFeatureData = features[0].data as TerriaFeatureData; + expect(terriaFeatureData.rowIds).toEqual([4, 5, 6, 7, 8]); + }); }); }); diff --git a/wwwroot/test/GeoJSON/empty-geoms.geojson b/wwwroot/test/GeoJSON/empty-geoms.geojson new file mode 100644 index 00000000000..ea0050ec794 --- /dev/null +++ b/wwwroot/test/GeoJSON/empty-geoms.geojson @@ -0,0 +1,124 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "height": 10, + "radius": 10, + "someOtherProp": "what" + }, + "geometry": { + "type": "Point", + "coordinates": [ + 144.91734981536865, + -37.824700770115996 + ] + } + }, + { + "type": "Feature", + "properties": { + "height": 20, + "radius": 5, + "someOtherProp": "ok" + }, + "geometry": { + "type": "Point", + "coordinates": [ + 144.92305755615234, + -37.82453127776299 + ] + } + }, + { + "type": "Feature", + "properties": { + "someProperty": 10, + "someOtherProp": "hey" + }, + "geometry": { + "type": "Polygon", + "coordinates": [] + } + }, + { + "type": "Feature", + "properties": { + "someProperty": 10, + "someOtherProp": "yo" + }, + "geometry": null + }, + { + "type": "Feature", + "properties": { + "someProperty": 20, + "someOtherProp": "what" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + 145.0100040435791, + -37.76080849651723 + ], + [ + 145.00873804092407, + -37.76342088777352 + ], + [ + 145.0157332420349, + -37.76292895101701 + ], + [ + 145.0100040435791, + -37.76080849651723 + ] + ] + ] + } + }, + { + "type": "Feature", + "bbox": [ + -10.0, + -10.0, + 10.0, + 10.0 + ], + "properties": { + "foo": "hi", + "bar": "bye", + "stroke-width": 1, + "someOtherProp": "is" + }, + "geometry": { + "type": "MultiLineString", + "coordinates": [ + [ + [ + 100.0, + 0.0 + ], + [ + 101.0, + 1.0 + ] + ], + [ + [ + 102.0, + 2.0 + ], + [ + 103.0, + 3.0 + ] + ] + ] + } + } + ] +} \ No newline at end of file diff --git a/wwwroot/test/GeoJSON/time-based-automatic-styles.geojson b/wwwroot/test/GeoJSON/time-based-automatic-styles.geojson index cda41a1888a..4e9d8791a9d 100644 --- a/wwwroot/test/GeoJSON/time-based-automatic-styles.geojson +++ b/wwwroot/test/GeoJSON/time-based-automatic-styles.geojson @@ -6,17 +6,32 @@ "properties": { "date": 2018, "someProperty": 3, - "id": 0 + "idProperty": 0 }, "geometry": { "type": "Polygon", "coordinates": [ [ - [145.0130295753479, -37.77042639061412], - [145.0200891494751, -37.77042639061412], - [145.0200891494751, -37.76543949054887], - [145.0130295753479, -37.76543949054887], - [145.0130295753479, -37.77042639061412] + [ + 145.0130295753479, + -37.77042639061412 + ], + [ + 145.0200891494751, + -37.77042639061412 + ], + [ + 145.0200891494751, + -37.76543949054887 + ], + [ + 145.0130295753479, + -37.76543949054887 + ], + [ + 145.0130295753479, + -37.77042639061412 + ] ] ] } @@ -26,17 +41,32 @@ "properties": { "date": 2019, "someProperty": 6, - "id": 0 + "idProperty": 0 }, "geometry": { "type": "Polygon", "coordinates": [ [ - [145.0130295753479, -37.77042639061412], - [145.0200891494751, -37.77042639061412], - [145.0200891494751, -37.76543949054887], - [145.0130295753479, -37.76543949054887], - [145.0130295753479, -37.77042639061412] + [ + 145.0130295753479, + -37.77042639061412 + ], + [ + 145.0200891494751, + -37.77042639061412 + ], + [ + 145.0200891494751, + -37.76543949054887 + ], + [ + 145.0130295753479, + -37.76543949054887 + ], + [ + 145.0130295753479, + -37.77042639061412 + ] ] ] } @@ -46,17 +76,32 @@ "properties": { "date": 2020, "someProperty": 10, - "id": 0 + "idProperty": 0 }, "geometry": { "type": "Polygon", "coordinates": [ [ - [145.0130295753479, -37.77042639061412], - [145.0200891494751, -37.77042639061412], - [145.0200891494751, -37.76543949054887], - [145.0130295753479, -37.76543949054887], - [145.0130295753479, -37.77042639061412] + [ + 145.0130295753479, + -37.77042639061412 + ], + [ + 145.0200891494751, + -37.77042639061412 + ], + [ + 145.0200891494751, + -37.76543949054887 + ], + [ + 145.0130295753479, + -37.76543949054887 + ], + [ + 145.0130295753479, + -37.77042639061412 + ] ] ] } @@ -66,17 +111,32 @@ "properties": { "date": 2021, "someProperty": 0, - "id": 0 + "idProperty": 0 }, "geometry": { "type": "Polygon", "coordinates": [ [ - [145.0130295753479, -37.77042639061412], - [145.0200891494751, -37.77042639061412], - [145.0200891494751, -37.76543949054887], - [145.0130295753479, -37.76543949054887], - [145.0130295753479, -37.77042639061412] + [ + 145.0130295753479, + -37.77042639061412 + ], + [ + 145.0200891494751, + -37.77042639061412 + ], + [ + 145.0200891494751, + -37.76543949054887 + ], + [ + 145.0130295753479, + -37.76543949054887 + ], + [ + 145.0130295753479, + -37.77042639061412 + ] ] ] } @@ -86,16 +146,28 @@ "properties": { "date": 2018, "someProperty": 3, - "id": 1 + "idProperty": 1 }, "geometry": { "type": "Polygon", "coordinates": [ [ - [145.0100040435791, -37.76080849651723], - [145.00873804092407, -37.76342088777352], - [145.0157332420349, -37.76292895101701], - [145.0100040435791, -37.76080849651723] + [ + 145.0100040435791, + -37.76080849651723 + ], + [ + 145.00873804092407, + -37.76342088777352 + ], + [ + 145.0157332420349, + -37.76292895101701 + ], + [ + 145.0100040435791, + -37.76080849651723 + ] ] ] } @@ -105,16 +177,28 @@ "properties": { "date": 2019, "someProperty": 4, - "id": 1 + "idProperty": 1 }, "geometry": { "type": "Polygon", "coordinates": [ [ - [145.0100040435791, -37.76080849651723], - [145.00873804092407, -37.76342088777352], - [145.0157332420349, -37.76292895101701], - [145.0100040435791, -37.76080849651723] + [ + 145.0100040435791, + -37.76080849651723 + ], + [ + 145.00873804092407, + -37.76342088777352 + ], + [ + 145.0157332420349, + -37.76292895101701 + ], + [ + 145.0100040435791, + -37.76080849651723 + ] ] ] } @@ -124,16 +208,28 @@ "properties": { "date": 2020, "someProperty": 1, - "id": 1 + "idProperty": 1 }, "geometry": { "type": "Polygon", "coordinates": [ [ - [145.0100040435791, -37.76080849651723], - [145.00873804092407, -37.76342088777352], - [145.0157332420349, -37.76292895101701], - [145.0100040435791, -37.76080849651723] + [ + 145.0100040435791, + -37.76080849651723 + ], + [ + 145.00873804092407, + -37.76342088777352 + ], + [ + 145.0157332420349, + -37.76292895101701 + ], + [ + 145.0100040435791, + -37.76080849651723 + ] ] ] } @@ -143,16 +239,28 @@ "properties": { "date": 2021, "someProperty": 10, - "id": 1 + "idProperty": 1 }, "geometry": { "type": "Polygon", "coordinates": [ [ - [145.0100040435791, -37.76080849651723], - [145.00873804092407, -37.76342088777352], - [145.0157332420349, -37.76292895101701], - [145.0100040435791, -37.76080849651723] + [ + 145.0100040435791, + -37.76080849651723 + ], + [ + 145.00873804092407, + -37.76342088777352 + ], + [ + 145.0157332420349, + -37.76292895101701 + ], + [ + 145.0100040435791, + -37.76080849651723 + ] ] ] } @@ -162,19 +270,31 @@ "properties": { "date": 2022, "someProperty": 7, - "id": 1 + "idProperty": 1 }, "geometry": { "type": "Polygon", "coordinates": [ [ - [145.0100040435791, -37.76080849651723], - [145.00873804092407, -37.76342088777352], - [145.0157332420349, -37.76292895101701], - [145.0100040435791, -37.76080849651723] + [ + 145.0100040435791, + -37.76080849651723 + ], + [ + 145.00873804092407, + -37.76342088777352 + ], + [ + 145.0157332420349, + -37.76292895101701 + ], + [ + 145.0100040435791, + -37.76080849651723 + ] ] ] } } ] -} +} \ No newline at end of file From 735b1bda646f672edc5823c7000496816c148909 Mon Sep 17 00:00:00 2001 From: Nick Forbes-Smith Date: Tue, 24 Oct 2023 16:34:30 +1100 Subject: [PATCH 32/53] prettier --- wwwroot/test/GeoJSON/empty-geoms.geojson | 59 ++--- .../time-based-automatic-styles.geojson | 202 ++++-------------- 2 files changed, 53 insertions(+), 208 deletions(-) diff --git a/wwwroot/test/GeoJSON/empty-geoms.geojson b/wwwroot/test/GeoJSON/empty-geoms.geojson index ea0050ec794..f327c7ae095 100644 --- a/wwwroot/test/GeoJSON/empty-geoms.geojson +++ b/wwwroot/test/GeoJSON/empty-geoms.geojson @@ -10,10 +10,7 @@ }, "geometry": { "type": "Point", - "coordinates": [ - 144.91734981536865, - -37.824700770115996 - ] + "coordinates": [144.91734981536865, -37.824700770115996] } }, { @@ -25,10 +22,7 @@ }, "geometry": { "type": "Point", - "coordinates": [ - 144.92305755615234, - -37.82453127776299 - ] + "coordinates": [144.92305755615234, -37.82453127776299] } }, { @@ -60,34 +54,17 @@ "type": "Polygon", "coordinates": [ [ - [ - 145.0100040435791, - -37.76080849651723 - ], - [ - 145.00873804092407, - -37.76342088777352 - ], - [ - 145.0157332420349, - -37.76292895101701 - ], - [ - 145.0100040435791, - -37.76080849651723 - ] + [145.0100040435791, -37.76080849651723], + [145.00873804092407, -37.76342088777352], + [145.0157332420349, -37.76292895101701], + [145.0100040435791, -37.76080849651723] ] ] } }, { "type": "Feature", - "bbox": [ - -10.0, - -10.0, - 10.0, - 10.0 - ], + "bbox": [-10.0, -10.0, 10.0, 10.0], "properties": { "foo": "hi", "bar": "bye", @@ -98,27 +75,15 @@ "type": "MultiLineString", "coordinates": [ [ - [ - 100.0, - 0.0 - ], - [ - 101.0, - 1.0 - ] + [100.0, 0.0], + [101.0, 1.0] ], [ - [ - 102.0, - 2.0 - ], - [ - 103.0, - 3.0 - ] + [102.0, 2.0], + [103.0, 3.0] ] ] } } ] -} \ No newline at end of file +} diff --git a/wwwroot/test/GeoJSON/time-based-automatic-styles.geojson b/wwwroot/test/GeoJSON/time-based-automatic-styles.geojson index 4e9d8791a9d..8cd654ffe39 100644 --- a/wwwroot/test/GeoJSON/time-based-automatic-styles.geojson +++ b/wwwroot/test/GeoJSON/time-based-automatic-styles.geojson @@ -12,26 +12,11 @@ "type": "Polygon", "coordinates": [ [ - [ - 145.0130295753479, - -37.77042639061412 - ], - [ - 145.0200891494751, - -37.77042639061412 - ], - [ - 145.0200891494751, - -37.76543949054887 - ], - [ - 145.0130295753479, - -37.76543949054887 - ], - [ - 145.0130295753479, - -37.77042639061412 - ] + [145.0130295753479, -37.77042639061412], + [145.0200891494751, -37.77042639061412], + [145.0200891494751, -37.76543949054887], + [145.0130295753479, -37.76543949054887], + [145.0130295753479, -37.77042639061412] ] ] } @@ -47,26 +32,11 @@ "type": "Polygon", "coordinates": [ [ - [ - 145.0130295753479, - -37.77042639061412 - ], - [ - 145.0200891494751, - -37.77042639061412 - ], - [ - 145.0200891494751, - -37.76543949054887 - ], - [ - 145.0130295753479, - -37.76543949054887 - ], - [ - 145.0130295753479, - -37.77042639061412 - ] + [145.0130295753479, -37.77042639061412], + [145.0200891494751, -37.77042639061412], + [145.0200891494751, -37.76543949054887], + [145.0130295753479, -37.76543949054887], + [145.0130295753479, -37.77042639061412] ] ] } @@ -82,26 +52,11 @@ "type": "Polygon", "coordinates": [ [ - [ - 145.0130295753479, - -37.77042639061412 - ], - [ - 145.0200891494751, - -37.77042639061412 - ], - [ - 145.0200891494751, - -37.76543949054887 - ], - [ - 145.0130295753479, - -37.76543949054887 - ], - [ - 145.0130295753479, - -37.77042639061412 - ] + [145.0130295753479, -37.77042639061412], + [145.0200891494751, -37.77042639061412], + [145.0200891494751, -37.76543949054887], + [145.0130295753479, -37.76543949054887], + [145.0130295753479, -37.77042639061412] ] ] } @@ -117,26 +72,11 @@ "type": "Polygon", "coordinates": [ [ - [ - 145.0130295753479, - -37.77042639061412 - ], - [ - 145.0200891494751, - -37.77042639061412 - ], - [ - 145.0200891494751, - -37.76543949054887 - ], - [ - 145.0130295753479, - -37.76543949054887 - ], - [ - 145.0130295753479, - -37.77042639061412 - ] + [145.0130295753479, -37.77042639061412], + [145.0200891494751, -37.77042639061412], + [145.0200891494751, -37.76543949054887], + [145.0130295753479, -37.76543949054887], + [145.0130295753479, -37.77042639061412] ] ] } @@ -152,22 +92,10 @@ "type": "Polygon", "coordinates": [ [ - [ - 145.0100040435791, - -37.76080849651723 - ], - [ - 145.00873804092407, - -37.76342088777352 - ], - [ - 145.0157332420349, - -37.76292895101701 - ], - [ - 145.0100040435791, - -37.76080849651723 - ] + [145.0100040435791, -37.76080849651723], + [145.00873804092407, -37.76342088777352], + [145.0157332420349, -37.76292895101701], + [145.0100040435791, -37.76080849651723] ] ] } @@ -183,22 +111,10 @@ "type": "Polygon", "coordinates": [ [ - [ - 145.0100040435791, - -37.76080849651723 - ], - [ - 145.00873804092407, - -37.76342088777352 - ], - [ - 145.0157332420349, - -37.76292895101701 - ], - [ - 145.0100040435791, - -37.76080849651723 - ] + [145.0100040435791, -37.76080849651723], + [145.00873804092407, -37.76342088777352], + [145.0157332420349, -37.76292895101701], + [145.0100040435791, -37.76080849651723] ] ] } @@ -214,22 +130,10 @@ "type": "Polygon", "coordinates": [ [ - [ - 145.0100040435791, - -37.76080849651723 - ], - [ - 145.00873804092407, - -37.76342088777352 - ], - [ - 145.0157332420349, - -37.76292895101701 - ], - [ - 145.0100040435791, - -37.76080849651723 - ] + [145.0100040435791, -37.76080849651723], + [145.00873804092407, -37.76342088777352], + [145.0157332420349, -37.76292895101701], + [145.0100040435791, -37.76080849651723] ] ] } @@ -245,22 +149,10 @@ "type": "Polygon", "coordinates": [ [ - [ - 145.0100040435791, - -37.76080849651723 - ], - [ - 145.00873804092407, - -37.76342088777352 - ], - [ - 145.0157332420349, - -37.76292895101701 - ], - [ - 145.0100040435791, - -37.76080849651723 - ] + [145.0100040435791, -37.76080849651723], + [145.00873804092407, -37.76342088777352], + [145.0157332420349, -37.76292895101701], + [145.0100040435791, -37.76080849651723] ] ] } @@ -276,25 +168,13 @@ "type": "Polygon", "coordinates": [ [ - [ - 145.0100040435791, - -37.76080849651723 - ], - [ - 145.00873804092407, - -37.76342088777352 - ], - [ - 145.0157332420349, - -37.76292895101701 - ], - [ - 145.0100040435791, - -37.76080849651723 - ] + [145.0100040435791, -37.76080849651723], + [145.00873804092407, -37.76342088777352], + [145.0157332420349, -37.76292895101701], + [145.0100040435791, -37.76080849651723] ] ] } } ] -} \ No newline at end of file +} From 4b61b00d0d0c37587a20d3514fd80037dad0e5fa Mon Sep 17 00:00:00 2001 From: Nick Forbes-Smith Date: Tue, 24 Oct 2023 16:44:53 +1100 Subject: [PATCH 33/53] replace currentDiscreteTimeIndex with currentDiscreteJulianDate --- lib/ModelMixins/GeojsonMixin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ModelMixins/GeojsonMixin.ts b/lib/ModelMixins/GeojsonMixin.ts index 6ce753bd160..df72d0fe261 100644 --- a/lib/ModelMixins/GeojsonMixin.ts +++ b/lib/ModelMixins/GeojsonMixin.ts @@ -298,7 +298,7 @@ function GeoJsonMixin>(Base: T) { () => [ this.useTableStylingAndProtomaps, this.readyData, - this.currentDiscreteTimeIndex, + this.currentDiscreteJulianDate, this.activeTableStyle.timeIntervals, this.activeTableStyle.colorMap, this.activeTableStyle.pointSizeMap, From 728840214f62e3684286efca7dbaf0878500b560 Mon Sep 17 00:00:00 2001 From: Nick Forbes-Smith Date: Tue, 24 Oct 2023 17:51:50 +1100 Subject: [PATCH 34/53] Fix share links with picked features for protomaps --- CHANGES.md | 1 + .../ProtomapsImageryProvider.ts | 29 ++++++++++++------- lib/ModelMixins/GeojsonMixin.ts | 4 ++- .../MapboxVectorTileCatalogItem.ts | 1 + 4 files changed, 24 insertions(+), 11 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index b435f7cf136..1ee97136874 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -10,6 +10,7 @@ - Fix `GeoJsonMixin` timeline animation for lines/polygons - Fix bug in mismatched GeoJSON Feature `_id_` and TableMixin `rowId` - this was causing incorrect styling when using `filterByProperties` or features had `null` geometry - Fix splitter for `GeoJsonMixin` (lines and polygon features only) +- Fix share links with picked features from `ProtomapsImageryProvider` - [The next improvement] #### 8.3.6 - 2023-10-03 diff --git a/lib/Map/ImageryProvider/ProtomapsImageryProvider.ts b/lib/Map/ImageryProvider/ProtomapsImageryProvider.ts index cf29e8f651a..20fd81084c6 100644 --- a/lib/Map/ImageryProvider/ProtomapsImageryProvider.ts +++ b/lib/Map/ImageryProvider/ProtomapsImageryProvider.ts @@ -5,36 +5,35 @@ import circle from "@turf/circle"; import { Feature } from "@turf/helpers"; import i18next from "i18next"; import { cloneDeep, isEmpty } from "lodash-es"; -import { action, observable, runInAction, makeObservable } from "mobx"; +import { action, makeObservable, observable, runInAction } from "mobx"; import { Bbox, - Feature as ProtomapsFeature, GeomType, - Labelers, LabelRule, + Labelers, LineSymbolizer, - painter, + Rule as PaintRule, PmtilesSource, PreparedTile, - Rule as PaintRule, + Feature as ProtomapsFeature, TileCache, TileSource, View, Zxy, - ZxySource + ZxySource, + painter } from "protomaps"; import Cartographic from "terriajs-cesium/Source/Core/Cartographic"; import Credit from "terriajs-cesium/Source/Core/Credit"; -import defaultValue from "terriajs-cesium/Source/Core/defaultValue"; import DeveloperError from "terriajs-cesium/Source/Core/DeveloperError"; import CesiumEvent from "terriajs-cesium/Source/Core/Event"; import CesiumMath from "terriajs-cesium/Source/Core/Math"; import Rectangle from "terriajs-cesium/Source/Core/Rectangle"; import WebMercatorTilingScheme from "terriajs-cesium/Source/Core/WebMercatorTilingScheme"; +import defaultValue from "terriajs-cesium/Source/Core/defaultValue"; import ImageryLayerFeatureInfo from "terriajs-cesium/Source/Scene/ImageryLayerFeatureInfo"; -import filterOutUndefined from "../../Core/filterOutUndefined"; -import isDefined from "../../Core/isDefined"; import TerriaError from "../../Core/TerriaError"; +import isDefined from "../../Core/isDefined"; import { FeatureCollectionWithCrs, FEATURE_ID_PROP as GEOJSON_FEATURE_ID_PROP, @@ -85,6 +84,8 @@ export type ProtomapsData = string | FeatureCollectionWithCrs | Source; interface Options { terria: Terria; + /** This must be defined to support pickedFeatures in share links */ + id?: string; data: ProtomapsData; minimumZoom?: number; maximumZoom?: number; @@ -272,6 +273,10 @@ export default class ProtomapsImageryProvider readonly errorEvent = new CesiumEvent(); readonly ready = true; readonly credit: Credit; + /** This is only used for Terria feature picking - as we track ImageryProvider feature picking by url (See PickedFeatures/Cesium._attachProviderCoordHooks). This URL is never called. + * This is set using the `id` property in the constructor options + */ + readonly url?: string; // Set values to please poor cesium types readonly defaultNightAlpha = undefined; @@ -349,6 +354,7 @@ export default class ProtomapsImageryProvider } this.errorEvent = new CesiumEvent(); + this.url = options.id; this.ready = true; @@ -544,10 +550,12 @@ export default class ProtomapsImageryProvider this.source instanceof GeojsonSource && this.source.geojsonObject ) { + // Get rough meters per pixel (at equator) for given zoom level + const zoomMeters = 156543 / Math.pow(2, level); // Create circle with 10 pixel radius to pick features const buffer = circle( [CesiumMath.toDegrees(longitude), CesiumMath.toDegrees(latitude)], - 10 * this.terria.mainViewer.scale, + 10 * zoomMeters, { steps: 10, units: "meters" @@ -662,6 +670,7 @@ export default class ProtomapsImageryProvider return new ProtomapsImageryProvider({ terria: options?.terria ?? this.terria, + id: options?.id ?? this.url, data, minimumZoom: options?.minimumZoom ?? this.minimumLevel, maximumZoom: options?.maximumZoom ?? this.maximumLevel, diff --git a/lib/ModelMixins/GeojsonMixin.ts b/lib/ModelMixins/GeojsonMixin.ts index df72d0fe261..8a5ca3e7169 100644 --- a/lib/ModelMixins/GeojsonMixin.ts +++ b/lib/ModelMixins/GeojsonMixin.ts @@ -88,6 +88,7 @@ import LoadableStratum from "../Models/Definition/LoadableStratum"; import Model, { BaseModel } from "../Models/Definition/Model"; import StratumOrder from "../Models/Definition/StratumOrder"; import TerriaFeature from "../Models/Feature/Feature"; +import { TerriaFeatureData } from "../Models/Feature/FeatureData"; import { ViewingControl } from "../Models/ViewingControls"; import TableStylingWorkflow from "../Models/Workflows/TableStylingWorkflow"; import createLongitudeLatitudeFeaturePerRow from "../Table/createLongitudeLatitudeFeaturePerRow"; @@ -102,7 +103,6 @@ import { ExportData } from "./ExportableMixin"; import FeatureInfoUrlTemplateMixin from "./FeatureInfoUrlTemplateMixin"; import { isDataSource } from "./MappableMixin"; import TableMixin from "./TableMixin"; -import { TerriaFeatureData } from "../Models/Feature/FeatureData"; export const FEATURE_ID_PROP = "_id_"; @@ -775,6 +775,8 @@ function GeoJsonMixin>(Base: T) { let provider = new ProtomapsImageryProvider({ terria: this.terria, data: protomapsData, + // Note: this URL is only used for Terria feature picking (see PickedFeatures.ProviderCoordsMap) + id: this.uniqueId, paintRules: [ // Polygon features { diff --git a/lib/Models/Catalog/CatalogItems/MapboxVectorTileCatalogItem.ts b/lib/Models/Catalog/CatalogItems/MapboxVectorTileCatalogItem.ts index 7e9ee34aefa..6d21833590f 100644 --- a/lib/Models/Catalog/CatalogItems/MapboxVectorTileCatalogItem.ts +++ b/lib/Models/Catalog/CatalogItems/MapboxVectorTileCatalogItem.ts @@ -206,6 +206,7 @@ class MapboxVectorTileCatalogItem extends MappableMixin( return new ProtomapsImageryProvider({ terria: this.terria, + id: this.uniqueId, data: this.url, minimumZoom: this.minimumZoom, maximumNativeZoom: this.maximumNativeZoom, From dc01dff1b4d865de3ce0549a38f9b8ca57f03326 Mon Sep 17 00:00:00 2001 From: Nick Forbes-Smith Date: Wed, 25 Oct 2023 11:32:20 +1100 Subject: [PATCH 35/53] Remove comment --- lib/ModelMixins/GeojsonMixin.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/ModelMixins/GeojsonMixin.ts b/lib/ModelMixins/GeojsonMixin.ts index 8a5ca3e7169..14684953008 100644 --- a/lib/ModelMixins/GeojsonMixin.ts +++ b/lib/ModelMixins/GeojsonMixin.ts @@ -775,7 +775,6 @@ function GeoJsonMixin>(Base: T) { let provider = new ProtomapsImageryProvider({ terria: this.terria, data: protomapsData, - // Note: this URL is only used for Terria feature picking (see PickedFeatures.ProviderCoordsMap) id: this.uniqueId, paintRules: [ // Polygon features From 33a90239b2adee4a87308d8bac74afc93ca49947 Mon Sep 17 00:00:00 2001 From: Stephen Davies Date: Wed, 25 Oct 2023 14:19:53 +1100 Subject: [PATCH 36/53] Add attribution on screen and google logo for Google Photorealistic 3D Tiles --- lib/Models/Cesium.ts | 110 +++++++++++------- lib/ReactViews/BottomDock/MapDataCount.tsx | 5 +- .../Map/BottomLeftBar/BottomLeftBar.tsx | 73 ++++++++++-- .../TraitsClasses/Cesium3dTilesTraits.ts | 7 ++ wwwroot/images/google_on_non_white_hdpi.png | Bin 0 -> 11448 bytes 5 files changed, 136 insertions(+), 59 deletions(-) create mode 100644 wwwroot/images/google_on_non_white_hdpi.png diff --git a/lib/Models/Cesium.ts b/lib/Models/Cesium.ts index 4ddda5ab67a..f54115c838b 100644 --- a/lib/Models/Cesium.ts +++ b/lib/Models/Cesium.ts @@ -94,6 +94,11 @@ import { setViewerMode } from "./ViewerMode"; //import Cesium3DTilesInspector from "terriajs-cesium/Source/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector"; +type CreditDisplayElement = { + credit: Credit; + count: number; +}; + // Intermediary var cartesian3Scratch = new Cartesian3(); var enuToFixedScratch = new Matrix4(); @@ -129,7 +134,10 @@ export default class Cesium extends GlobeOrMap { | MappableMixin.Instance | /*TODO Cesium.Cesium3DTileset*/ any; + // Lightbox and on screen attributions from CreditDisplay private cesiumDataAttributions: IObservableArray = observable([]); + // Public because this is accessed from BottomLeftBar.tsx + cesiumScreenDataAttributions: IObservableArray = observable([]); // When true, feature picking is paused. This is useful for temporarily // disabling feature picking when some other interaction mode wants to take @@ -490,6 +498,7 @@ export default class Cesium extends GlobeOrMap { const creditDisplay: CreditDisplay & { _currentFrameCredits?: { lightboxCredits: AssociativeArray; + screenCredits: AssociativeArray; }; } = this.scene.frameState.creditDisplay; const creditDisplayOldDestroy = creditDisplay.destroy; @@ -505,48 +514,16 @@ export default class Cesium extends GlobeOrMap { creditDisplayOldEndFrame.bind(creditDisplay)(); runInAction(() => { - const creditDisplayElements: { - credit: Credit; - count: number; - }[] = creditDisplay._currentFrameCredits!.lightboxCredits.values; - - // sort credits by count (number of times they are added to map) - const credits = creditDisplayElements - .sort((credit1, credit2) => { - return credit2.count - credit1.count; - }) - .map(({ credit }) => credit.html); - - if (isEqual(credits, toJS(this.cesiumDataAttributions))) return; - - // first remove ones that are not on the map anymore - // Iterate backwards because we're removing items. - for (let i = this.cesiumDataAttributions.length - 1; i >= 0; i--) { - const attribution = this.cesiumDataAttributions[i]; - if (!credits.includes(attribution)) { - this.cesiumDataAttributions.remove(attribution); - } - } - - // then go through all credits and add them or update their position - for (const [index, credit] of credits.entries()) { - const attributionIndex = this.cesiumDataAttributions.indexOf(credit); - - if (attributionIndex === index) { - // it is already on correct position in the list - continue; - } else if (attributionIndex === -1) { - // it is not on the list yet so we add it to the list - this.cesiumDataAttributions.splice(index, 0, credit); - } else { - // it is on the list but not in the right place so we move it - this.cesiumDataAttributions.splice( - index, - 0, - this.cesiumDataAttributions.splice(attributionIndex, 1)[0] - ); - } - } + syncCesiumCreditsToAttributions( + creditDisplay._currentFrameCredits!.lightboxCredits + .values as CreditDisplayElement[], + this.cesiumDataAttributions + ); + syncCesiumCreditsToAttributions( + creditDisplay._currentFrameCredits!.screenCredits + .values as CreditDisplayElement[], + this.cesiumScreenDataAttributions + ); }); }; } @@ -1033,11 +1010,11 @@ export default class Cesium extends GlobeOrMap { : undefined; if (!center) { - /** In cases where the horizon is not visible, we cannot calculate a center using a pick ray, + /** In cases where the horizon is not visible, we cannot calculate a center using a pick ray, but we need to return a useful CameraView that works in 3D mode and 2D mode. - In this case we can return the correct definition for the cesium camera, with position, direction, and up, + In this case we can return the correct definition for the cesium camera, with position, direction, and up, but we need to calculate a bounding box on the ellipsoid too to be used in 2D mode. - + To do this we clone the camera, rotate it to point straight down, and project the camera view from that position onto the ellipsoid. **/ @@ -1851,3 +1828,46 @@ function flyToBoundingSpherePromise( }); }); } + +function syncCesiumCreditsToAttributions( + creditsElements: CreditDisplayElement[], + dataAttributionsObservable: IObservableArray +) { + // sort credits by count (number of times they are added to map) + const credits = creditsElements + .sort((credit1, credit2) => { + return credit2.count - credit1.count; + }) + .map(({ credit }) => credit.html); + + if (isEqual(credits, toJS(dataAttributionsObservable))) return; + + // first remove ones that are not on the map anymore + // Iterate backwards because we're removing items. + for (let i = dataAttributionsObservable.length - 1; i >= 0; i--) { + const attribution = dataAttributionsObservable[i]; + if (!credits.includes(attribution)) { + dataAttributionsObservable.remove(attribution); + } + } + + // then go through all credits and add them or update their position + for (const [index, credit] of credits.entries()) { + const attributionIndex = dataAttributionsObservable.indexOf(credit); + + if (attributionIndex === index) { + // it is already on correct position in the list + continue; + } else if (attributionIndex === -1) { + // it is not on the list yet so we add it to the list + dataAttributionsObservable.splice(index, 0, credit); + } else { + // it is on the list but not in the right place so we move it + dataAttributionsObservable.splice( + index, + 0, + dataAttributionsObservable.splice(attributionIndex, 1)[0] + ); + } + } +} diff --git a/lib/ReactViews/BottomDock/MapDataCount.tsx b/lib/ReactViews/BottomDock/MapDataCount.tsx index 0468faa962a..e10e54db3e5 100644 --- a/lib/ReactViews/BottomDock/MapDataCount.tsx +++ b/lib/ReactViews/BottomDock/MapDataCount.tsx @@ -39,10 +39,7 @@ const MapDataCount = observer(function (props: Props) { : t("countDatasets.noMapDataEnabled"); return ( - // Should we even provide a wrapper Box? makes sense not to, but most of the - // components as they stand come with their own "wrapper" via scss - // - + props.theme.mobile}px) { bottom: 35px; } + display: flex; +`; + +// Use padding to avoid other UI elements +const AttributionsContainer = styled(Text)` + text-shadow: 0 0 2px #000000; + padding-left: 8px; + padding-right: 56px; + @media (max-width: ${(props) => props.theme.mobile}px) { + padding-right: 8px; + padding-bottom: 32px; + } `; + const shouldShowPlayStoryButton = (viewState: ViewState) => viewState.terria.configParameters.storyEnabled && defined(viewState.terria.stories) && viewState.terria.stories.length > 0 && viewState.useSmallScreenInterface; -const BottomLeftBar: FC = () => { +const BottomLeftBar: FC = observer(() => { const { t } = useTranslation(); const theme = useTheme(); const viewState = useViewState(); + const screenDataAttributions = + viewState.terria.cesium?.cesiumScreenDataAttributions; + const isNotificationActive = viewState.terria.notificationState.currentNotification; + const isUsingGooglePhotorealistic3dTiles = + viewState.terria.mainViewer.viewerMode === ViewerMode.Cesium && + viewState.terria.workbench.items + .filter((i): i is Cesium3DTilesCatalogItem => i.type === "3d-tiles") + .some( + (i) => + i.url?.startsWith( + "https://tile.googleapis.com/v1/3dtiles/root.json" + ) && i.show + ); + return ( { ) : null} + {/* Google Logo. Needed for Google Photorealistic 3D Tiles + */} + {isUsingGooglePhotorealistic3dTiles && ( + + )} + {/* On screen data attributions. At the moment, this supports only Cesium viewer. + Needed for Google Photorealistic 3D Tiles + */} + {!!screenDataAttributions?.length && ( + + {screenDataAttributions + .flatMap((attributionHtml, i) => [ + + {parseCustomHtmlToReact(attributionHtml)} + , + + ]) + .slice(0, -1)} + + )} ); -}; +}); export default BottomLeftBar; diff --git a/lib/Traits/TraitsClasses/Cesium3dTilesTraits.ts b/lib/Traits/TraitsClasses/Cesium3dTilesTraits.ts index f98dd03086f..b3e88b8b9cb 100644 --- a/lib/Traits/TraitsClasses/Cesium3dTilesTraits.ts +++ b/lib/Traits/TraitsClasses/Cesium3dTilesTraits.ts @@ -101,6 +101,13 @@ export class OptionsTraits extends ModelTraits { description: "Point cloud shading parameters" }) pointCloudShading?: PointCloudShadingTraits; + + @primitiveTrait({ + type: "boolean", + name: "Show credits on screen", + description: "Whether to display the credits of this tileset on screen." + }) + showCreditsOnScreen: boolean = false; } export default class Cesium3DTilesTraits extends mixTraits( diff --git a/wwwroot/images/google_on_non_white_hdpi.png b/wwwroot/images/google_on_non_white_hdpi.png new file mode 100644 index 0000000000000000000000000000000000000000..393d03005d5bd544bd8655319844fca20fc10fc2 GIT binary patch literal 11448 zcmeHscTkht)_3SdX@Vd9lF%Xa7J63#1PCpZP^I@GO(}wabm>h51q4J?5TuJB zAWeEvse%Gu^qhO{x%0g<-`tt+{qJPvDSPj=etWIoT6<0Qvl9{e8WiMAsd$c*Z$m8 zn(xBYc6W()@g|(-5WE^u9Zxz838#W|k!XKAQ2)+m7uLGEy|FuDZLxmv{rrOW>d!BS zyeHivKQNb`a16unJ$pHRu91bzWoJCCON|^J1E%m(685Wd!*5$3lvhS~WH+|z$Pu_e!ZJf+$WpvRT_A*5{rNx-{;qiE(@y}=3 zU-e}>p9QoI=LRg6ihGG=^(bEWT^?RJslKif7~6TP*24S_xzr$H?Jy@TBg3m(Sy;43 zF)aMt@Fp#zP*Ss%BlYwVv`=7(ic3>;ERl+yO;P^F#|yRyBJZtUdle9Yqj1?Z*RR6r zu2D+<*C3X`x=;}?wRYkIwb%JZ+|u$}lOg4?Cu0^MQQ4a$L;djLZl-69=)1M~SB@rp z9>qCnapxGhqRVp(o%AF>7`b_v7Rgw<&O8}+b*pO|b25-W8F#}xKN(w3;Ka*AO^&Iv zI}8m#c{K_{Ztq7z&27-DrgPObbzQIX)K4v1?ceA5F-rx^p`+P5_F8|i-7fUvE5By| zJ!+X4kvTAOm45aB^X#Z~_RG@)=cz9A`Ro_Peyi_J!d<$X(Ywx5fk%;-vT*8ry45=| zYB>aq7;QWv)+~ty)nUV2%zwiT6YREwtSw|%=+ALuPMl!hoR=kZ>JXf z=BwcA>mGoVPuRjnFv;WAR@h05H?s3nc5GhgjuTY@^ zpZFy1G}j*$t8Xnx@_-fe8WdBW>3PrITl0I&UpJdQT~jqWw>r<-wSijmQiXS%H$=fI^y)1*(_s=d(<+I@wGd9;+?ZRWzS&%)D=sCmO$ldDMX* z-kelliuGj4&8y;l(yH%p5IJ(3Awu;0CH@y5JqHwd-Lsnf?wx9dz<0xFDVNf0_vf#g zQ_D?eDB$ieP_+>udh@nnV0S+(1tE)dB_yPb7a?_Sc!lt1&GhR2z6CQQ92|h=l2Ei#%tvrq%rW7kP zR|#3gG4=;*+tdX751St9K+fJ}!ZTui+>&qaevT)Cg*}MbnY}&Oy3$PG{qQ+ICeKaC zUg;>GHjry~a=sX-!AF;Sce{#4o_-ul75>E*at<_&{5T>3EN5s+S$y>zXki<2!$`wjg!8DP_B$@_`xTLh_Pjb_s+fsb@1y1)($0RZX)O{Y#% zR=QRLrti%LNKTG0ev#&zsjd<)mnL=Ynz zg!)lLY0+_|-xb*;)dwnhA13y5DLokRs~d{l_B|qE#A0EGUVKsv6gP-j19ddac1?x* z3h-!j^|h^q0#|n+#R505aMDV1pRlr&Dqr%me3=I%w~qG|*xzOdUn^WQFW7U zGTO{lPY2tUwWRo?DXZd$?zY2qik|f;ABv^V5iZm=s{*-Mncnt51U3Pp=rQf0cex#= z+Qsn-ff-!^z#E?1YudKac95O!GD-;HSYDBLJxM^+*S6t%EaR!3tXI{Y-$XXYQ(8%T zI|-HG`|C!L8g4$OfQ=l3zRH`s$0{MLsUl>X<6Om(8t_MBQ+b*v@o0cXS*i1Mn{`Hs zJTdxiNl9rO={yh7j?77U&I8K5R^Fc8mdfwaYoqLz=As%TL5oGw4BsEppUcaoP@8`U z*I?CN9`;++o;Kd2imjK9F$js3I#=@C%w60^F}zS#Ig8W1W*U&r#n&e+zdrS`%51+I z=4C^^L4CYI#%+uy*``HA?1}6KD7oQ5#YHzL1@E7TefX@oMsM$)9fm(m98Ia!w8MM% zBwe(+@6eVY)jv#-K?j1!wBoL)`!u5zzkTKcP3ALOk8n`wAhDahV5LE9PtrR^>=Clv zr9{I?LY)sYR*J{jQPt88WzdS$?lqV8A!!oj>RJxeTo7Z9Ma^50uA*n6@hQA`_ zBci1L+8xNz)y^ay6IwhqCNaR+lS1U1Z(~G_Ujf&62}uNtU8tX=6wd7nlk!lBCaT_? z>!AvsAuJ4e70JdP5lVFWHTpQV`(q3?<650@oUDF1*yJmKRV>oHv~o*DZe=%vTV(hS z8Ml~KjiVu94RK4nR6Fw$r~Al;?RRUJ!v=+wi$f09t(P>`ca&$Y(}DNOZY0{*n*u#m>@Gp`?KteQM3OG2Y1?$?df>Bohq> z4XaF#OZg^HIVTae$P~LC1dFBYeH1#XqW9M6w7nbNX&f=EB0UfxGflrb z$>)G2pf7QaWPXFqtDKmv=wds&;eFH~E@XB_ORiw%WNe-NMCtWBdQcB<#l*&BrmeT4 zc!Mk#q4?r>YKlbRi?==>&I`C1n-5q!dHQ7(@&=Y>B>USTtiO)1MvD;PM`vNnS+(R%p8o^kve$8Vl9;5!=l9kk52EV6~{4eFsG)vLfM`qA&6!>P#<*YWn%oZwN3^VjOD1Va!CPS-L~h@ z>%Vi>BE(G6?6vPu{vm!46LntH9Hq*BgyF9#KM2{q0yCWLpgvHl*#FdooS;q;Qa_@s z1}ZXjs*gk}#;Ix07|L-H!|`0AN!3irXwHJ8>WPXzIjT~Oygh@>_7u_)`qWXXz3v8Q zeF_a{$&~YF|K>Njzv*y~0v)5@8^u9EBn&T9b*E=3&pz?F--&P#Wy!h_FzvDFL=s!D zkmcX^01!y%A@NaI0eg}w9w$_~_0BLV(Cq2cCvBPQQ$T4J?soQAM%u{KjRuOBx-BDb zi3;;+2l4n9-633FEd%|B)l_&Tn)g7#dE4Q59aM&RPl_ela{~*O)e?NFDd6s0&lH=+K>~mh{ z`QBH*M-LCTy6c5k!N_jPjL=c)y3cwul<&pq?%Uq0Gh8O-;{ub*J+YPK8DBM#AjGCg zJoAs8%LAXHxzQFTes=PXL0t$@rMwyTdVTS!GxGeJA8a+C>FJ)l)0hbRI)oBTk9 z3HfIZ^{`V#AbFHp97d7tQ8SX~XH?9A+s@Z~7H~eeBgkRG-+RB^dg|&fx@RWBi)&XY z`FXj(_3tAQ>lu>4{Z~U94C$0eT%^cd)1O$)v>`fNdmdBfUFZ>d4)^VQ+`rf9(VH4U ztJ^~cr&daKU9=NxCAiVckddHjI8TdBA)48$O<=lzJ>YKRZ8sVjAgMG>C6>yay0so8 zPg&Ua$oz<&{m~vxGPj)*oMk8Ki~c(k5}xLRv)9zFq`=R?4r1`g_e-pS7LKY>3pX@x zkaYL7Z4+yK0ybRjazEAEx5}jAj>-3rnDH$|KKcG>en@jVRdXQv_+h!rF>%wXSMzHg zd>^jH=?F}X7C)KTrb&|k6J^g*6SOa^Se$0MW_=LP(3dZuC?gA$>^*>dLscDd7hZb{ zMz2WNt!i&B(Un~iO-o#4PfLdS&dDXTFF}hhR}%+gSzD-5aoNJl{L$9?b^T4)qD2S$ zQhVWD&ZA1Y$$J>4rqmN2iu19rIj*}6nv-P+0>o@&sI8O|jUyIoo8W8sDcfl4rrB`u z!_)pL$XxSuZr+AHK4)-0Gc{HI`r|`JAIQ6_VZopPAUAfgtmuV0xepgiC&mT_NW81) z=n4GpIOHYEI_O=gNFJ@iCCRKrBpT7K`{t>W&8`bSP|ZG%Jr&eVtLv$GgFyt?chP&(w@2FEA3oSxqyHYt+Yr1m(9pwd8R|6E-Sxpl+va|@`Sx3 zf{afk&&c*DlqK(l8p{qSqFtIw&eL^g5tDlNjZ-d7jo_~VZZnOjJP=H>R9+b+7o~@-#-qo<<6pv5!};)# zmy`{WKJd}T+uDO35fD@t82xzGK4C^+Bi#WYX^#oXmKxch8KRrsTE&imN9XUB^yQWE zrPcWMGuj_$1GypB$W5mBU35r|8;j--4aGC@FTQa|mV`br>{d$oLNZbln$fPYz;1L! z5nKLAG|`aSPLg&DGIHE>O%V0gmqqe*@TngKI0K)tx`Pc^`NYf-uVhSqXFK6^bjXMS+!wyLX{R1 z8^@MiS;lqcVe*@ctMY6&WFfS|Y?8D#eWWJuiKes%xBLkx>R+U|W4oRD94|kSHQ#zC zsK9;VQaXW9b#GaE%dKBptecba^|VRhdR$-2s=)PlA*ue7oBE@f%GvZG@7j%`iQI}e z+K1Xmk+%J-jR7X z_WfzxRyyldi{1{V4^G8&wo^NFq{|N^+kV&} z+$p)_!)%%-Y277Cd;rnw3@n8TdR;lqP$Ip&N^TLR7cdUsZx?VSEsQ-E2n45uLbslZ zd0e?}wQ_?6h$zgviFAG&O;RS}L?=X_8fXi6lawc7X;MZt@WGVRmb#eSenTR)RB}>C ziVj9^^Ky9J+*TKohSeSoQFYC|^8I^s8gpK!IYkF-FwE$Xy#B+s-V0tNkz;AZ=9K&dNrPQ z-?Z>DKCz0xtSy|AameDUMjNuIlj`{gzX5a#GsCjGL#|{$*fuad$MwRtrG0_ktARv; z72y}o-Vr5Z`8FesqYouCvC5Q9`uQc5qxX;6+dR}HgQGlw_VZS&B!DKru}y?52Y%#o z6Qt)BIcehu(=gk_+EGH+m(%pz;{CcnK^1`%iy%fMiRZd>49R3e|F_$Ci;`k*^`8ah z0Dx<)KRW=#E7Ipkb<>A zP!y(gjL%Zq$L>{f#*d_n%|sq0f|nBzft07>JF>0<#m}bSRzast#X9-r3C+XiD}s4O znfM9xpV=A5t-YvDIf~dTeL31|WN#1;)r%&3BtpKK3bcJ)dmoE;Pn1cX!W~A!^{Su# z4nd$w!8RLjE}tDyo!Volk`?FXOzcX8rM=sv`NDNP0H+?QfRRgo$f7bQvqO{Z`-|85 z3v95|(AI=0R{*Rwnv(13Q|+sgo&FTh3kI0SCK@#uWQyM|%#AEwjHOV8%Vn!Fy6M{} zU74?3!6IwwVOq$H6j?H5{+*>UU-Dlq6TV@Nn!pSe^uGa^7~C4rGJE}cy;&ps zni7jk;M6^0g)-T9YkSOmndMDOT`oqBg7ugxU&(fMzRju`(EhPN^!_^AgN_Ur(dOvS z6D^G`dlkwcAUW@$!WczgQ64P&ANS1J2~+E$cZZ?W~Z^IA9cs75b}8M zotv?op$J8_HCiFR7SCY5z1U4i59zqz$Do?S&zt{Zi7w4^GveoH571Gz`xDRpU}=Tp zr;bbF>KB2I$%_~U0055@t*VO9QdRxe*L~bK{rrOTCheC9y0~tWCN*rjHi>utqLr8U zJsnfhD3v?cYxU80?Zp#0wD`LsF(p(J%G4o*>`E_YF4aj$9tSRc4QClXy}T{jvcsi2 zxN58UxZ3Od#fA?S)wbX=Q94Lm02DfiTrU_6RJhf2r|U4q{9x{(Gk4M;q8))k-ZZh> zO)dz^Vm50El0Bq)MP)Cm{aEuS*Qdns{>GW32}k;iz`WVoS2M4kZPv7UL)Yl29*9d+ zaG4yI=fX5(cC>8C@%Q-2%E_97eczePC1^vRu_VNS<|{ZbHNyv);OsXhH+hy)O$vFa z4!RfI*qx6m-dlfGrkSkcHgy9>o@iLGE1xi$H83~Bx)-LzRwgAbLsl4`gAfMBZr^X= z4oQO1xWf<&Jzbas#zO?@h_OeB1bTSk4od(4ImJLPq=Op@3$#Z$qdnz8Upl%$K(wPg z$XrrSOwUUd<$~4>_CXm3>zg>K2XMFt9c`f~n)_yYru@^$b*dtuQSPv9?1 zq&>zDD-QzU#)1E`&%;Yk?=N^y-#=Nv@gW+B^b!>p5fkthW!fM zAJ!Q7pmAA=bpN|mzn~m(Q1%c>87KsT6qZ2BK!qV-F-Kt;aYr#>Cus=@2{AFSq$Je- zHa7Wpet zaR9$HaL&L~eNad&#>WJMahC`EvI+Q0^RHn&+vr* zNWmmzgmF!=zsX}9(N01CFX>;a2PpRk%bI9k-26emyZ%^G#whPUT7NX%(ZAOc5cqpl zz>p4qxZsQQNBt2k9M&I04lYPfXB4h{{F$%+>PP<%xnPfkIyge?C50gp5@6g-Mp9VD z-bqGS94zkO2!`5AIY=RYv+x(XFUAQQfb>BrJL7o7afQpz-&_It{)iO+e~JgVpnin` z#~6+x;lCJzi2cc!=${^o{;C@Pa#>FF{~|^1x4_@Z3{LNlK3w_2RYTFg%Hf}+;SB!Y z{QVh>|II0Yz<(zBulW6ku7BwIuNe5Rg#XE|f9U$J82GP*|H-cZZ*-CWdqait#QhBl zz-^ay9QkN)TP=Kh9Su0(GCpmn8`mQ9(zNsi0Ityfy6^yb`8RN#Bv>syHIg+FdRh^_ zZ7tY60D!1f3$AS9@@d}E+C5W^?!w9cS!=&(41EG|Qc|W}S)HAsCtk0fmQv!rT@k(l zwICW1m1nmc4bmnwOoaF7^d>7rh`P%d`)e2G~K|EkF^d1T*x?Ox@0TsclBW^1#GCMR_{&?H%wn#Y-O_;b|eo(5U zxrkPZyEM$9|7Q9R{J8#g=W(9bWlGYob5BtPR{$YudI(cI-Zpa6OXtfcs@K=;G7hk# zU9FDosHBcCdw=6Z_oR=GG0q)Q$^I>?YfbP*;?RpPxuEyQop(f_gah8W!U8Cpgq*(R z4QDpJED&hl!>e-H+C`76BOzf_P2}50Vk(J;+o9Pd-E<^BV|NCQO1^|jP7`}O9>;jk z96llOO}V&ZU`{;h%|81jko3Uf0R3>JOP-yJF9^}Mxe?*fnQ?5){bYJ%+o3>0JU^yV zF77k3+V?86QcedVWqzA0R8?a)sEZnY5?{7KZ%G;~43@kp#QIL8zSWRQLx?+R#VERC z7?nM})VYCAI96_2@gb0KD_aQNi zfrewPO1!dBZ#t(QTUrAG9Wqd*#=(OprZ2eoOy<|19cngfKa-!9J#p&nzaR49iSEZ3 z`lX+aUf|h9sb_26@wug zQ5Y*Aaf_ZO_V%Eh{Ab310I~Ug1)naLLS5@b58h7QnpKgUp>%_kj8|iU%;_J3ivR#b z=>q@&s-D7npj4Bx8>Y2He8c7mNr2FB%NY~%xn50AbHDNld zE-y%prDFmAU@f#wq{P*?a8HZ)O&ZA}F~Th$Avt&mdqc}zq0X5kOSC(8p5ennQC?{5Js7G#BxI-!=c=b44ON?xp%UXna4z2+@le-C87IGCEp=Hg_HeyYq z1j$8vPQUn(wJz^M(a#GC9&shFtncJ$S7k5~ zY$mrl#uaowcnbeW063|Toa!B8UcNPUR~&1&Eake)xW`Pnn@kg$b!ZHs82w1+h5U%@ z?$(aC(UwW@l>Nv!F96egPb0j<$>~76t!lm8Sl6h3UluwhvQTchuIrY#T;`VPmHBk_ zvv)nI!gDy>CAP1@Y@hTjok@QF_-lSqtq?LSdsuc##1s7)l9Yg8O)Gf`0<~~{ z$LB-dROyD+n!hD9NWJnjh5`BXP=h}2z1pN*L)Yl*g0=#=1keCp74396B~f`K+&e#3 z%P6AoY1wh5&wCZgGyRCR*a`vwLw^Whl$~FL@xH7b3pqE5a5bB(soK_R(q%JgZLJrr z&PyBdPhE^psjpZ~UJEH>&eY&Bo?c(B)-deL z$&Plui5*Wq_>S)Q+^w+kwzS02L20nL}!{5NCAl_DjyokQoG uwr>LlTjp2yz;yHPO(&N=zw3V(PLN2*yJS4b8-gq904+6rc)f~U)c*mQ%#mLJ literal 0 HcmV?d00001 From 9151a0013c5b2a15a2a26ea389c80aaf372a6b4c Mon Sep 17 00:00:00 2001 From: Stephen Davies Date: Wed, 25 Oct 2023 14:20:17 +1100 Subject: [PATCH 37/53] Fix mobx warning --- lib/ReactViews/Map/ProgressBar.tsx | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/lib/ReactViews/Map/ProgressBar.tsx b/lib/ReactViews/Map/ProgressBar.tsx index 9fcc5359d60..6c60dbb3a09 100644 --- a/lib/ReactViews/Map/ProgressBar.tsx +++ b/lib/ReactViews/Map/ProgressBar.tsx @@ -1,9 +1,10 @@ -import React, { VFC, useCallback, useEffect, useMemo, useState } from "react"; +import { observer } from "mobx-react"; +import { VFC, useCallback, useEffect, useState } from "react"; import styled, { css, keyframes, useTheme } from "styled-components"; import EventHelper from "terriajs-cesium/Source/Core/EventHelper"; import { useViewState } from "../Context"; -export const ProgressBar: VFC = () => { +export const ProgressBar: VFC = observer(() => { const [loadPercentage, setLoadPercentage] = useState(0); const [indeterminateLoading, setIndeterminateLoading] = useState(); @@ -32,13 +33,8 @@ export const ProgressBar: VFC = () => { }; }, []); - const backgroundColor = useMemo( - () => - terria.baseMapContrastColor === "#ffffff" - ? "#ffffff" - : theme.colorPrimary, - [terria.baseMapContrastColor] - ); + const backgroundColor = + terria.baseMapContrastColor === "#ffffff" ? "#ffffff" : theme.colorPrimary; const allComplete = loadPercentage === 100 && !indeterminateLoading; @@ -50,7 +46,7 @@ export const ProgressBar: VFC = () => { loadPercentage={`${loadPercentage}%`} /> ); -}; +}); interface IStyledProgressBarProps { loadPercentage: string; From 223970cf2894fec920c88553347b60ceb279e47a Mon Sep 17 00:00:00 2001 From: Stephen Davies Date: Wed, 25 Oct 2023 14:23:59 +1100 Subject: [PATCH 38/53] Remove debugging console logs --- lib/ViewModels/TerriaViewer.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/ViewModels/TerriaViewer.ts b/lib/ViewModels/TerriaViewer.ts index 5e5c7568f26..f2ddec0e238 100644 --- a/lib/ViewModels/TerriaViewer.ts +++ b/lib/ViewModels/TerriaViewer.ts @@ -219,7 +219,6 @@ export default class TerriaViewer { newViewer = untracked(() => new NoViewer(this)); } - console.log(`Creating a viewer: ${newViewer.type}`); this._lastViewer = newViewer; newViewer.zoomTo(currentView || untracked(() => this.homeCamera), 0.0); @@ -248,7 +247,6 @@ export default class TerriaViewer { let currentView: CameraView | undefined; if (this._lastViewer !== undefined) { this.beforeViewerChanged.raiseEvent(); - console.log(`Destroying viewer: ${this._lastViewer.type}`); currentView = this._lastViewer.getCurrentCameraView(); this._lastViewer.destroy(); this._lastViewer = undefined; From f10f0c7269ae1d234727c29cda8e90c9ff2aca62 Mon Sep 17 00:00:00 2001 From: Stephen Davies Date: Wed, 25 Oct 2023 15:33:34 +1100 Subject: [PATCH 39/53] Add changelog entry --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 1ee97136874..ead7503da41 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,7 @@ - Fix bug in mismatched GeoJSON Feature `_id_` and TableMixin `rowId` - this was causing incorrect styling when using `filterByProperties` or features had `null` geometry - Fix splitter for `GeoJsonMixin` (lines and polygon features only) - Fix share links with picked features from `ProtomapsImageryProvider` +- Added on screen attribution and Google logo for Google Photorealistic 3D Tiles. - [The next improvement] #### 8.3.6 - 2023-10-03 From 7a0f2096fba9bf03fd10dcd5980d63fd73f8d9ce Mon Sep 17 00:00:00 2001 From: Stephen Davies Date: Wed, 25 Oct 2023 15:37:17 +1100 Subject: [PATCH 40/53] Fix missing React imports, waiting on React 18 https://github.com/TerriaJS/terriajs/pull/6902 --- lib/ReactViews/Map/BottomLeftBar/BottomLeftBar.tsx | 2 +- lib/ReactViews/Map/ProgressBar.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ReactViews/Map/BottomLeftBar/BottomLeftBar.tsx b/lib/ReactViews/Map/BottomLeftBar/BottomLeftBar.tsx index 552cc842b9c..2fbc49aacdf 100644 --- a/lib/ReactViews/Map/BottomLeftBar/BottomLeftBar.tsx +++ b/lib/ReactViews/Map/BottomLeftBar/BottomLeftBar.tsx @@ -1,5 +1,5 @@ import { observer } from "mobx-react"; -import { FC } from "react"; +import React, { FC } from "react"; import { useTranslation } from "react-i18next"; import styled, { useTheme } from "styled-components"; import defined from "terriajs-cesium/Source/Core/defined"; diff --git a/lib/ReactViews/Map/ProgressBar.tsx b/lib/ReactViews/Map/ProgressBar.tsx index 6c60dbb3a09..eedfef26599 100644 --- a/lib/ReactViews/Map/ProgressBar.tsx +++ b/lib/ReactViews/Map/ProgressBar.tsx @@ -1,5 +1,5 @@ import { observer } from "mobx-react"; -import { VFC, useCallback, useEffect, useState } from "react"; +import React, { VFC, useCallback, useEffect, useState } from "react"; import styled, { css, keyframes, useTheme } from "styled-components"; import EventHelper from "terriajs-cesium/Source/Core/EventHelper"; import { useViewState } from "../Context"; From 97ba9ffd8474412d78732a093e1a9871aec49a4b Mon Sep 17 00:00:00 2001 From: Stephen Davies Date: Fri, 20 Oct 2023 04:04:23 +1100 Subject: [PATCH 41/53] Add ASGS 2021 leftovers and add an automated duplicate alias check --- .../find-region-mapping-alias-duplicates.yml | 34 + .../find-region-mapping-alias-duplicates.js | 22 + wwwroot/data/regionMapping.json | 724 ++++++++++++++---- 3 files changed, 634 insertions(+), 146 deletions(-) create mode 100644 .github/workflows/find-region-mapping-alias-duplicates.yml create mode 100644 buildprocess/find-region-mapping-alias-duplicates.js diff --git a/.github/workflows/find-region-mapping-alias-duplicates.yml b/.github/workflows/find-region-mapping-alias-duplicates.yml new file mode 100644 index 00000000000..331c2ed47c3 --- /dev/null +++ b/.github/workflows/find-region-mapping-alias-duplicates.yml @@ -0,0 +1,34 @@ +name: Find region mapping alias duplicates + +# Run when regionMapping.json file or is updated +on: + push: + paths: + - "wwwroot/data/regionMapping.json" + - "buildprocess/find-region-mapping-alias-duplicates.js" + pull_request: + paths: + - "wwwroot/data/regionMapping.json" + - "buildprocess/find-region-mapping-alias-duplicates.js" + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job + find-alias-duplicates: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Check out only 2 files + # Use without cone mode as no git operations are executed past checkout + - uses: actions/checkout@v4 + with: + sparse-checkout: | + wwwroot/data/regionMapping.json + buildprocess/find-region-mapping-alias-duplicates.js + sparse-checkout-cone-mode: false + + - name: Check aliases + run: | + node buildprocess/find-region-mapping-alias-duplicates.js diff --git a/buildprocess/find-region-mapping-alias-duplicates.js b/buildprocess/find-region-mapping-alias-duplicates.js new file mode 100644 index 00000000000..e3d2c6e079c --- /dev/null +++ b/buildprocess/find-region-mapping-alias-duplicates.js @@ -0,0 +1,22 @@ +const fs = require("fs"); +const regions = JSON.parse( + fs.readFileSync("wwwroot/data/regionMapping.json") +).regionWmsMap; + +const aliasToType = new Map(); +for (const [regType, regDef] of Object.entries(regions)) { + for (const alias of regDef.aliases ?? []) { + aliasToType.set(alias, [...(aliasToType.get(alias) ?? []), regType]); + } +} + +let issues = 0; +for (const [alias, regTypes] of aliasToType.entries()) { + if (regTypes.length > 1) { + console.error( + `Alias "${alias}" used in multiple types: ${regTypes.join(", ")}` + ); + issues++; + } +} +process.exitCode = issues > 0 ? 1 : 0; diff --git a/wwwroot/data/regionMapping.json b/wwwroot/data/regionMapping.json index 987f18be348..a2f929b28d2 100644 --- a/wwwroot/data/regionMapping.json +++ b/wwwroot/data/regionMapping.json @@ -1,6 +1,447 @@ { "comments": "Matching takes place in the order defined in this file. Place code matches before name matches, and smaller regions before larger ones.", "regionWmsMap": { + "STE_2021": { + "layerName": "STE_2021", + "server": "https://tiles.terria.io/STE_2021/{z}/{x}/{y}.pbf", + "serverType": "MVT", + "serverMaxNativeZoom": 12, + "serverMinZoom": 0, + "serverMaxZoom": 28, + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-STE_2021.json", + "uniqueIdProp": "FID", + "regionProp": "STATE_CODE_2021", + "nameProp": "STATE_NAME_2021", + "aliases": ["ste_code_2021", "ste_code", "ste"], + "description": "States and Territories 2021", + "bbox": [96.81, -43.74, 168, -9.14] + }, + "ILOC_2021": { + "layerName": "ILOC_2021", + "server": "https://tiles.terria.io/ILOC_2021/{z}/{x}/{y}.pbf", + "serverType": "MVT", + "serverMaxNativeZoom": 12, + "serverMinZoom": 0, + "serverMaxZoom": 28, + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-ILOC_2021.json", + "uniqueIdProp": "FID", + "regionProp": "ILO_CODE21", + "nameProp": "ILO_NAME21", + "aliases": ["iloc_code_2021", "iloc_code", "iloc"], + "description": "Indigenous Locations 2021", + "bbox": [96.81, -43.74, 168, -9.14] + }, + "ILOC_NAME_2021": { + "layerName": "ILOC_2021", + "server": "https://tiles.terria.io/ILOC_2021/{z}/{x}/{y}.pbf", + "serverType": "MVT", + "serverMaxNativeZoom": 12, + "serverMinZoom": 0, + "serverMaxZoom": 28, + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-ILOC_NAME_2021.json", + "uniqueIdProp": "FID", + "regionProp": "ILO_NAME21", + "nameProp": "ILO_NAME21", + "aliases": ["iloc_name_2021", "iloc_name"], + "description": "Indigenous Locations 2021", + "bbox": [96.81, -43.74, 168, -9.14] + }, + "IARE_2021": { + "layerName": "IARE_2021", + "server": "https://tiles.terria.io/IARE_2021/{z}/{x}/{y}.pbf", + "serverType": "MVT", + "serverMaxNativeZoom": 12, + "serverMinZoom": 0, + "serverMaxZoom": 28, + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-IARE_2021.json", + "uniqueIdProp": "FID", + "regionProp": "IAR_CODE21", + "nameProp": "IAR_NAME21", + "aliases": ["iare_code_2021", "iare_code", "iare"], + "description": "Indigenous Areas 2021", + "bbox": [96.81, -43.74, 168, -9.14] + }, + "IARE_NAME_2021": { + "layerName": "IARE_2021", + "server": "https://tiles.terria.io/IARE_2021/{z}/{x}/{y}.pbf", + "serverType": "MVT", + "serverMaxNativeZoom": 12, + "serverMinZoom": 0, + "serverMaxZoom": 28, + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-IARE_NAME_2021.json", + "uniqueIdProp": "FID", + "regionProp": "IAR_NAME21", + "nameProp": "IAR_NAME21", + "aliases": ["iare_name_2021", "iare_name"], + "description": "Indigenous Areas 2021", + "bbox": [96.81, -43.74, 168, -9.14] + }, + "IREG_2021": { + "layerName": "IREG_2021", + "server": "https://tiles.terria.io/IREG_2021/{z}/{x}/{y}.pbf", + "serverType": "MVT", + "serverMaxNativeZoom": 12, + "serverMinZoom": 0, + "serverMaxZoom": 28, + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-IREG_2021.json", + "uniqueIdProp": "FID", + "regionProp": "IRE_CODE21", + "nameProp": "IRE_NAME21", + "aliases": ["ireg_code_2021", "ireg_code", "ireg"], + "description": "Indigenous Regions 2021", + "bbox": [96.81, -43.74, 168, -9.14] + }, + "IREG_NAME_2021": { + "layerName": "IREG_2021", + "server": "https://tiles.terria.io/IREG_2021/{z}/{x}/{y}.pbf", + "serverType": "MVT", + "serverMaxNativeZoom": 12, + "serverMinZoom": 0, + "serverMaxZoom": 28, + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-IREG_NAME_2021.json", + "uniqueIdProp": "FID", + "regionProp": "IRE_NAME21", + "nameProp": "IRE_NAME21", + "aliases": ["ireg_name_2021", "ireg_name"], + "description": "Indigenous Regions 2021", + "bbox": [96.81, -43.74, 168, -9.14] + }, + "RA_2021": { + "layerName": "RA_2021", + "server": "https://tiles.terria.io/RA_2021/{z}/{x}/{y}.pbf", + "serverType": "MVT", + "serverMaxNativeZoom": 12, + "serverMinZoom": 0, + "serverMaxZoom": 28, + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-RA_2021.json", + "uniqueIdProp": "FID", + "regionProp": "RA_CODE21", + "nameProp": "RA_NAME21", + "aliases": ["ra_code_2021", "ra_code", "ra"], + "description": "Remoteness Areas 2021", + "bbox": [96.81, -43.74, 168, -9.14] + }, + "SAL_2021": { + "layerName": "SAL_2021", + "server": "https://tiles.terria.io/SAL_2021/{z}/{x}/{y}.pbf", + "serverType": "MVT", + "serverMaxNativeZoom": 12, + "serverMinZoom": 0, + "serverMaxZoom": 28, + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-SAL_2021.json", + "uniqueIdProp": "FID", + "regionProp": "SAL_CODE_2021", + "nameProp": "SAL_NAME_2021", + "aliases": ["sal_code_2021", "sal_code", "sal"], + "description": "Suburbs and Localities 2021", + "bbox": [96.81, -43.74, 168, -9.14] + }, + "ADD_2021": { + "layerName": "ADD_2021", + "server": "https://tiles.terria.io/ADD_2021/{z}/{x}/{y}.pbf", + "serverType": "MVT", + "serverMaxNativeZoom": 12, + "serverMinZoom": 0, + "serverMaxZoom": 28, + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-ADD_2021.json", + "uniqueIdProp": "FID", + "regionProp": "ADD_CODE_2021", + "nameProp": "ADD_NAME_2021", + "aliases": ["add_code_2021", "add_code", "add"], + "description": "Australian Drainage Divisions 2021", + "bbox": [96.81, -43.74, 168, -9.14] + }, + "ADD_NAME_2021": { + "layerName": "ADD_2021", + "server": "https://tiles.terria.io/ADD_2021/{z}/{x}/{y}.pbf", + "serverType": "MVT", + "serverMaxNativeZoom": 12, + "serverMinZoom": 0, + "serverMaxZoom": 28, + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-ADD_NAME_2021.json", + "uniqueIdProp": "FID", + "regionProp": "ADD_NAME_2021", + "nameProp": "ADD_NAME_2021", + "aliases": ["add_name_2021", "add_name"], + "description": "Australian Drainage Divisions 2021", + "bbox": [96.81, -43.74, 168, -9.14] + }, + "DZN_2021": { + "layerName": "DZN_2021", + "server": "https://tiles.terria.io/DZN_2021/{z}/{x}/{y}.pbf", + "serverType": "MVT", + "serverMaxNativeZoom": 12, + "serverMinZoom": 0, + "serverMaxZoom": 28, + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-DZN_2021.json", + "uniqueIdProp": "FID", + "regionProp": "DZN_CODE_2021", + "nameProp": "DZN_CODE_2021", + "aliases": ["dzn_code_2021", "dzn_code", "dzn"], + "description": "Destination Zones 2021", + "bbox": [96.81, -43.74, 168, -9.14] + }, + "LGA_2022": { + "layerName": "LGA_2022", + "server": "https://tiles.terria.io/LGA_2022/{z}/{x}/{y}.pbf", + "serverType": "MVT", + "serverMaxNativeZoom": 12, + "serverMinZoom": 0, + "serverMaxZoom": 28, + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-LGA_2022.json", + "uniqueIdProp": "FID", + "regionProp": "LGA_CODE_2022", + "nameProp": "LGA_NAME_2022", + "aliases": ["lga_code_2022"], + "description": "Local Government Areas 2022", + "bbox": [96.81, -43.74, 168, -9.14] + }, + "LGA_2023": { + "layerName": "LGA_2023", + "server": "https://tiles.terria.io/LGA_2023/{z}/{x}/{y}.pbf", + "serverType": "MVT", + "serverMaxNativeZoom": 12, + "serverMinZoom": 0, + "serverMaxZoom": 28, + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-LGA_2023.json", + "uniqueIdProp": "FID", + "regionProp": "LGA_CODE_2023", + "nameProp": "LGA_NAME_2023", + "aliases": ["lga_code_2023", "lga_code", "lga"], + "description": "Local Government Areas 2023", + "bbox": [96.81, -43.74, 168, -9.14] + }, + "SED_2021": { + "layerName": "SED_2021", + "server": "https://tiles.terria.io/SED_2021/{z}/{x}/{y}.pbf", + "serverType": "MVT", + "serverMaxNativeZoom": 12, + "serverMinZoom": 0, + "serverMaxZoom": 28, + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-SED_2021.json", + "uniqueIdProp": "FID", + "regionProp": "SED_CODE_2021", + "nameProp": "SED_NAME_2021", + "aliases": ["sed_code_2021"], + "description": "State Electoral Divisions 2021 (ABS)", + "bbox": [96.81, -43.74, 168, -9.14] + }, + "SED_NAME_2021": { + "layerName": "SED_2021", + "server": "https://tiles.terria.io/SED_2021/{z}/{x}/{y}.pbf", + "serverType": "MVT", + "serverMaxNativeZoom": 12, + "serverMinZoom": 0, + "serverMaxZoom": 28, + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-SED_NAME_2021.json", + "uniqueIdProp": "FID", + "regionProp": "SED_NAME_2021", + "nameProp": "SED_NAME_2021", + "aliases": ["sed_name_2021"], + "description": "State Electoral Divisions 2021 (ABS)", + "bbox": [96.81, -43.74, 168, -9.14] + }, + "SED_2022": { + "layerName": "SED_2022", + "server": "https://tiles.terria.io/SED_2022/{z}/{x}/{y}.pbf", + "serverType": "MVT", + "serverMaxNativeZoom": 12, + "serverMinZoom": 0, + "serverMaxZoom": 28, + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-SED_2022.json", + "uniqueIdProp": "FID", + "regionProp": "SED_CODE_2022", + "nameProp": "SED_NAME_2022", + "aliases": ["sed_code_2022", "sed_code", "sed"], + "description": "State Electoral Divisions 2022 (ABS)", + "bbox": [96.81, -43.74, 168, -9.14] + }, + "SED_NAME_2022": { + "layerName": "SED_2022", + "server": "https://tiles.terria.io/SED_2022/{z}/{x}/{y}.pbf", + "serverType": "MVT", + "serverMaxNativeZoom": 12, + "serverMinZoom": 0, + "serverMaxZoom": 28, + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-SED_NAME_2022.json", + "uniqueIdProp": "FID", + "regionProp": "SED_NAME_2022", + "nameProp": "SED_NAME_2022", + "aliases": ["sed_name_2022", "sed_name"], + "description": "State Electoral Divisions 2022 (ABS)", + "bbox": [96.81, -43.74, 168, -9.14] + }, + "CED_2021": { + "layerName": "CED_2021", + "server": "https://tiles.terria.io/CED_2021/{z}/{x}/{y}.pbf", + "serverType": "MVT", + "serverMaxNativeZoom": 12, + "serverMinZoom": 0, + "serverMaxZoom": 28, + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-CED_2021.json", + "uniqueIdProp": "FID", + "regionProp": "CED_CODE_2021", + "nameProp": "CED_NAME_2021", + "aliases": ["ced_code_2021", "ced_code", "ced"], + "description": "Commonwealth Electoral Divisions 2021 (ABS)", + "bbox": [96.81, -43.74, 168, -9.14] + }, + "CED_NAME_2021": { + "layerName": "CED_2021", + "server": "https://tiles.terria.io/CED_2021/{z}/{x}/{y}.pbf", + "serverType": "MVT", + "serverMaxNativeZoom": 12, + "serverMinZoom": 0, + "serverMaxZoom": 28, + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-CED_NAME_2021.json", + "uniqueIdProp": "FID", + "regionProp": "CED_NAME_2021", + "nameProp": "CED_NAME_2021", + "aliases": ["ced_name_2021", "ced_name"], + "description": "Commonwealth Electoral Divisions 2021 (ABS)", + "bbox": [96.81, -43.74, 168, -9.14] + }, + "POA_2021": { + "layerName": "POA_2021", + "server": "https://tiles.terria.io/POA_2021/{z}/{x}/{y}.pbf", + "serverType": "MVT", + "serverMaxNativeZoom": 12, + "serverMinZoom": 0, + "serverMaxZoom": 28, + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-POA_2021.json", + "uniqueIdProp": "FID", + "regionProp": "POA_CODE_2021", + "nameProp": "POA_CODE_2021", + "aliases": [ + "poa_code_2021", + "poa_code", + "poa", + "postcode_2021", + "postcode" + ], + "description": "Postal Areas 2021 (ABS)", + "bbox": [96.81, -43.74, 168, -9.14] + }, + "TR_2021": { + "layerName": "TR_2021", + "server": "https://tiles.terria.io/TR_2021/{z}/{x}/{y}.pbf", + "serverType": "MVT", + "serverMaxNativeZoom": 12, + "serverMinZoom": 0, + "serverMaxZoom": 28, + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-TR_2021.json", + "uniqueIdProp": "FID", + "regionProp": "TR_CODE_2021", + "nameProp": "TR_NAME_2021", + "aliases": ["tr_code_2021", "tr_code", "tr"], + "description": "Tourism Regions 2021", + "bbox": [96.81, -43.74, 168, -9.14] + }, + "TR_NAME_2021": { + "layerName": "TR_2021", + "server": "https://tiles.terria.io/TR_2021/{z}/{x}/{y}.pbf", + "serverType": "MVT", + "serverMaxNativeZoom": 12, + "serverMinZoom": 0, + "serverMaxZoom": 28, + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-TR_NAME_2021.json", + "uniqueIdProp": "FID", + "regionProp": "TR_NAME_2021", + "nameProp": "TR_NAME_2021", + "aliases": ["tr_name_2021", "tr_name"], + "description": "Tourism Regions 2021", + "bbox": [96.81, -43.74, 168, -9.14] + }, + "SUA_2021": { + "layerName": "SUA_2021", + "server": "https://tiles.terria.io/SUA_2021/{z}/{x}/{y}.pbf", + "serverType": "MVT", + "serverMaxNativeZoom": 12, + "serverMinZoom": 0, + "serverMaxZoom": 28, + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-SUA_2021.json", + "uniqueIdProp": "FID", + "regionProp": "SUA_CODE_2021", + "nameProp": "SUA_NAME_2021", + "aliases": ["sua_code_2021", "sua_code", "sua"], + "description": "Significant Urban Areas 2021", + "bbox": [96.81, -43.74, 168, -9.14] + }, + "SUA_NAME_2021": { + "layerName": "SUA_2021", + "server": "https://tiles.terria.io/SUA_2021/{z}/{x}/{y}.pbf", + "serverType": "MVT", + "serverMaxNativeZoom": 12, + "serverMinZoom": 0, + "serverMaxZoom": 28, + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-SUA_NAME_2021.json", + "uniqueIdProp": "FID", + "regionProp": "SUA_NAME_2021", + "nameProp": "SUA_NAME_2021", + "aliases": ["sua_name_2022", "sua_name"], + "description": "Significant Urban Areas 2021", + "bbox": [96.81, -43.74, 168, -9.14] + }, + "UCL_2021": { + "layerName": "UCL_2021", + "server": "https://tiles.terria.io/UCL_2021/{z}/{x}/{y}.pbf", + "serverType": "MVT", + "serverMaxNativeZoom": 12, + "serverMinZoom": 0, + "serverMaxZoom": 28, + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-UCL_2021.json", + "uniqueIdProp": "FID", + "regionProp": "UCL_CODE_2021", + "nameProp": "UCL_NAME_2021", + "aliases": ["ucl_code_2021", "ucl_code", "ucl"], + "description": "Urban Centres and Localities 2021", + "bbox": [96.81, -43.74, 168, -9.14] + }, + "UCL_NAME_2021": { + "layerName": "UCL_2021", + "server": "https://tiles.terria.io/UCL_2021/{z}/{x}/{y}.pbf", + "serverType": "MVT", + "serverMaxNativeZoom": 12, + "serverMinZoom": 0, + "serverMaxZoom": 28, + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-UCL_NAME_2021.json", + "uniqueIdProp": "FID", + "regionProp": "UCL_NAME_2021", + "nameProp": "UCL_NAME_2021", + "aliases": ["ucl_name_2021", "ucl_name"], + "description": "Urban Centres and Localities 2021", + "bbox": [96.81, -43.74, 168, -9.14] + }, + "SOS_2021": { + "layerName": "SOS_2021", + "server": "https://tiles.terria.io/SOS_2021/{z}/{x}/{y}.pbf", + "serverType": "MVT", + "serverMaxNativeZoom": 12, + "serverMinZoom": 0, + "serverMaxZoom": 28, + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-SOS_2021.json", + "uniqueIdProp": "FID", + "regionProp": "SOS_CODE_2021", + "nameProp": "SOS_NAME_2021", + "aliases": ["sos_code_2021", "sos_code", "sos"], + "description": "Section of State 2021", + "bbox": [96.81, -43.74, 168, -9.14] + }, + "SOSR_2021": { + "layerName": "SOSR_2021", + "server": "https://tiles.terria.io/SOSR_2021/{z}/{x}/{y}.pbf", + "serverType": "MVT", + "serverMaxNativeZoom": 12, + "serverMinZoom": 0, + "serverMaxZoom": 28, + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-SOSR_2021.json", + "uniqueIdProp": "FID", + "regionProp": "SOSR_CODE_2021", + "nameProp": "SOSR_NAME_2021", + "aliases": ["sosr_code_2021", "sosr_code", "sosr"], + "description": "Section of State Range 2021", + "bbox": [96.81, -43.74, 168, -9.14] + }, "SA1_2011": { "layerName": "FID_SA1_2011_AUST", "server": "https://vector-tiles.terria.io/FID_SA1_2011_AUST/{z}/{x}/{y}.pbf", @@ -10,7 +451,7 @@ "aliases": ["sa1_code_2011", "sa1_maincode_2011"], "digits": 11, "description": "Statistical Area Level 1 2011 (ABS)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_SA1_2011_AUST_SA1_MAIN11.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_SA1_2011_AUST_SA1_MAIN11.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -31,7 +472,7 @@ "aliases": ["sa1_7digitcode_2011"], "digits": 7, "description": "Statistical Area Level 1 2011 by 7-dig code (ABS)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_SA1_2011_AUST_SA1_7DIG11.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_SA1_2011_AUST_SA1_7DIG11.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -59,7 +500,7 @@ "aliases": ["sa1_code_2016", "sa1_maincode_2016"], "nameProp": "SA1_7DIG16", "description": "Statistical Area Level 1 2016 by code (ABS)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-SA1_2016_AUST_SA1_MAIN16.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-SA1_2016_AUST_SA1_MAIN16.json" }, "SA1_7DIGIT_2016": { "layerName": "SA1_2016_AUST", @@ -77,7 +518,7 @@ "aliases": ["sa1_7digitcode", "sa1_7digitcode_2016"], "nameProp": "SA1_7DIG16", "description": "Statistical Area Level 1 2016 by 7-dig code (ABS)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-SA1_2016_AUST_SA1_7DIG16.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-SA1_2016_AUST_SA1_7DIG16.json" }, "SA1_2021": { "layerName": "SA1_2021", @@ -86,7 +527,7 @@ "serverMaxNativeZoom": 12, "serverMinZoom": 0, "serverMaxZoom": 28, - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-SA1_2021_SA1_2021.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-SA1_2021_SA1_2021.json", "regionProp": "SA1_CODE21", "nameProp": "SA1_CODE21", "aliases": ["sa1_code_2021", "sa1_maincode_2021", "sa1", "sa1_code"], @@ -102,7 +543,7 @@ "aliases": ["sa4_code_2011", "sa4_maincode_2011"], "digits": 3, "description": "Statistical Area Level 4 2011 by code (ABS)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_SA4_2011_AUST_SA4_CODE11.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_SA4_2011_AUST_SA4_CODE11.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -122,7 +563,7 @@ "regionProp": "SA4_NAME11", "aliases": ["sa4_name_2011"], "description": "Statistical Area Level 4 2011 by name (ABS)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_SA4_2011_AUST_SA4_NAME11.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_SA4_2011_AUST_SA4_NAME11.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -150,7 +591,7 @@ "aliases": ["sa4_maincode_2016", "sa4_code_2016"], "nameProp": "SA4_NAME16", "description": "Statistical Area Level 4 2016 by code (ABS)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-SA4_2016_AUST_SA4_CODE16.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-SA4_2016_AUST_SA4_CODE16.json" }, "SA4_NAME_2016": { "layerName": "SA4_2016_AUST", @@ -168,7 +609,7 @@ "aliases": ["sa4_name_2016"], "nameProp": "SA4_NAME16", "description": "Statistical Area Level 4 2016 by name (ABS)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-SA4_2016_AUST_SA4_NAME16.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-SA4_2016_AUST_SA4_NAME16.json" }, "SA4_2021": { "layerName": "SA4_2021", @@ -177,7 +618,7 @@ "serverMaxNativeZoom": 12, "serverMinZoom": 0, "serverMaxZoom": 28, - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-SA4_2021_SA4_2021.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-SA4_2021_SA4_2021.json", "regionProp": "SA4_CODE21", "nameProp": "SA4_NAME21", "aliases": ["sa4_code_2021", "sa4_maincode_2021", "sa4", "sa4_code"], @@ -191,7 +632,7 @@ "serverMaxNativeZoom": 12, "serverMinZoom": 0, "serverMaxZoom": 28, - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-SA4_NAME_2021_SA4_2021.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-SA4_NAME_2021_SA4_2021.json", "regionProp": "SA4_NAME21", "nameProp": "SA4_NAME21", "aliases": ["sa4_name_2021", "sa4_name"], @@ -207,7 +648,7 @@ "aliases": ["sa3_code_2011", "sa3_maincode_2011"], "digits": 5, "description": "Statistical Area Level 3 2011 by code (ABS)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_SA3_2011_AUST_SA3_CODE11.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_SA3_2011_AUST_SA3_CODE11.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -228,7 +669,7 @@ "aliases": ["sa3_name_2011"], "digits": 5, "description": "Statistical Area Level 3 2011 by name (ABS)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_SA3_2011_AUST_SA3_NAME11.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_SA3_2011_AUST_SA3_NAME11.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -256,7 +697,7 @@ "aliases": ["sa3_code_2016", "sa3_maincode_2016"], "nameProp": "SA3_NAME16", "description": "Statistical Area Level 3 2016 by code (ABS)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-SA3_2016_AUST_SA3_CODE16.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-SA3_2016_AUST_SA3_CODE16.json" }, "SA3_NAME_2016": { "layerName": "SA3_2016_AUST", @@ -274,7 +715,7 @@ "aliases": ["sa3_name_2016"], "nameProp": "SA3_NAME16", "description": "Statistical Area Level 3 2016 by name (ABS)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-SA3_2016_AUST_SA3_NAME16.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-SA3_2016_AUST_SA3_NAME16.json" }, "SA3_2021": { "layerName": "SA3_2021", @@ -283,7 +724,7 @@ "serverMaxNativeZoom": 12, "serverMinZoom": 0, "serverMaxZoom": 28, - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-SA3_2021_SA3_2021.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-SA3_2021_SA3_2021.json", "regionProp": "SA3_CODE21", "nameProp": "SA3_NAME21", "aliases": ["sa3_code_2021", "sa3_maincode_2021", "sa3", "sa3_code"], @@ -297,7 +738,7 @@ "serverMaxNativeZoom": 12, "serverMinZoom": 0, "serverMaxZoom": 28, - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-SA3_NAME_2021_SA3_2021.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-SA3_NAME_2021_SA3_2021.json", "regionProp": "SA3_NAME21", "nameProp": "SA3_NAME21", "aliases": ["sa3_name_2021", "sa3_name"], @@ -313,7 +754,7 @@ "aliases": ["sa2_code_2011", "sa2_maincode_2011"], "digits": 9, "description": "Statistical Area Level 2 2011 by code (ABS)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_SA2_2011_AUST_SA2_MAIN11.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_SA2_2011_AUST_SA2_MAIN11.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -334,7 +775,7 @@ "aliases": ["sa2_5digitcode_2011"], "digits": 5, "description": "Statistical Area Level 2 2011 by 5-dig code (ABS)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_SA2_2011_AUST_SA2_5DIG11.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_SA2_2011_AUST_SA2_5DIG11.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -354,7 +795,7 @@ "regionProp": "SA2_NAME11", "aliases": ["sa2_name_2011"], "description": "Statistical Area Level 2 2011 by name (ABS)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_SA2_2011_AUST_SA2_NAME11.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_SA2_2011_AUST_SA2_NAME11.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -382,7 +823,7 @@ "aliases": ["sa2_code_2016", "sa2_maincode_2016"], "nameProp": "SA2_NAME16", "description": "Statistical Area Level 2 2016 by code (ABS)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-SA2_2016_AUST_SA2_MAIN16.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-SA2_2016_AUST_SA2_MAIN16.json" }, "SA2_5DIG_2016": { "layerName": "SA2_2016_AUST", @@ -400,7 +841,7 @@ "aliases": ["sa2_5digitcode", "sa2_5digitcode_2016"], "nameProp": "SA2_NAME16", "description": "Statistical Area Level 2 2016 by 5-dig code (ABS)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-SA2_2016_AUST_SA2_5DIG16.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-SA2_2016_AUST_SA2_5DIG16.json" }, "SA2_NAME_2016": { "layerName": "SA2_2016_AUST", @@ -418,7 +859,7 @@ "aliases": ["sa2_name_2016"], "nameProp": "SA2_NAME16", "description": "Statistical Area Level 2 2016 by name (ABS)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-SA2_2016_AUST_SA2_NAME16.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-SA2_2016_AUST_SA2_NAME16.json" }, "SA2_2021": { "layerName": "SA2_2021", @@ -427,7 +868,7 @@ "serverMaxNativeZoom": 12, "serverMinZoom": 0, "serverMaxZoom": 28, - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-SA2_2021_SA2_2021.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-SA2_2021_SA2_2021.json", "regionProp": "SA2_CODE21", "nameProp": "SA2_NAME21", "aliases": ["sa2_code_2021", "sa2_maincode_2021", "sa2", "sa2_code"], @@ -441,7 +882,7 @@ "serverMaxNativeZoom": 12, "serverMinZoom": 0, "serverMaxZoom": 28, - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-SA2_NAME_2021_SA2_2021.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-SA2_NAME_2021_SA2_2021.json", "regionProp": "SA2_NAME21", "nameProp": "SA2_NAME21", "aliases": ["sa2_name_2021", "sa2_name"], @@ -457,7 +898,7 @@ "aliases": ["ssc_code_2011"], "digits": 5, "description": "ABS approximations of suburbs by code (2011)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_SSC_2011_AUST_SSC_CODE.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_SSC_2011_AUST_SSC_CODE.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -477,7 +918,7 @@ "regionProp": "SSC_NAME", "aliases": ["ssc_name_2011"], "description": "ABS approximations of suburbs by name (2011)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_SSC_2011_AUST_SSC_NAME.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_SSC_2011_AUST_SSC_NAME.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -505,7 +946,7 @@ "aliases": ["ssc_code_2016", "ssc_code", "ssc"], "nameProp": "SSC_NAME16", "description": "ABS approximations of suburbs by code (2016)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-SSC_2016_AUST_SSC_CODE16.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-SSC_2016_AUST_SSC_CODE16.json" }, "SSC_NAME_2016": { "layerName": "SSC_2016_AUST", @@ -523,7 +964,7 @@ "aliases": ["ssc_name_2016", "ssc_name", "suburb"], "nameProp": "SSC_NAME16", "description": "ABS approximations of suburbs by name (2016)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-SSC_2016_AUST_SSC_NAME16.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-SSC_2016_AUST_SSC_NAME16.json" }, "LGA_2021": { "layerName": "LGA_2021", @@ -532,10 +973,10 @@ "serverMaxNativeZoom": 12, "serverMinZoom": 0, "serverMaxZoom": 28, - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-LGA_2021_LGA_2021.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-LGA_2021_LGA_2021.json", "regionProp": "LGA_CODE21", "nameProp": "LGA_NAME21", - "aliases": ["lga_code_2021", "lga_code_2020", "lga_code", "lga"], + "aliases": ["lga_code_2021", "lga_code_2020"], "description": "Local Government Areas 2021 by code (ABS)", "bbox": [96.81, -43.75, 168, -9.14] }, @@ -546,7 +987,7 @@ "serverMaxNativeZoom": 12, "serverMinZoom": 0, "serverMaxZoom": 28, - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-LGA_2019_LGA_2019.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-LGA_2019_LGA_2019.json", "regionProp": "LGA_CODE19", "nameProp": "LGA_NAME19", "aliases": ["lga_code_2019"], @@ -568,7 +1009,7 @@ "nameProp": "LGA_NAME18", "aliases": ["lga_code_2018"], "description": "Local Government Areas 2018 by code (ABS)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-LGA_2018_AUST_LGA_CODE18.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-LGA_2018_AUST_LGA_CODE18.json" }, "LGA_2017": { "layerName": "LGA_2017_AUST", @@ -585,7 +1026,7 @@ "nameProp": "LGA_NAME17", "aliases": ["lga_code_2017"], "description": "Local Government Areas 2017 by code (ABS)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-LGA_2017_AUST_LGA_CODE17.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-LGA_2017_AUST_LGA_CODE17.json" }, "LGA_2016": { "layerName": "LGA_2016_AUST", @@ -603,7 +1044,7 @@ "aliases": ["lga_code_2016"], "nameProp": "LGA_NAME16", "description": "Local Government Areas 2016 by code (ABS)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-LGA_2016_AUST_LGA_CODE16.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-LGA_2016_AUST_LGA_CODE16.json" }, "LGA_2015": { "layerName": "FID_LGA_2015_AUST", @@ -614,7 +1055,7 @@ "aliases": ["lga_code_2015", "lga_code_2014"], "digits": 5, "description": "Local Government Areas 2015 by code (ABS)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_LGA_2015_AUST_LGA_CODE15.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_LGA_2015_AUST_LGA_CODE15.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -635,7 +1076,7 @@ "aliases": ["lga_code_2013", "lga_code_2012"], "digits": 5, "description": "Local Government Areas 2013 by code (ABS)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_LGA_2013_AUST_LGA_CODE13.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_LGA_2013_AUST_LGA_CODE13.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -656,7 +1097,7 @@ "aliases": ["lga_code_2011", "lga_code_2010"], "digits": 5, "description": "Local Government Areas 2011 by code (ABS)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_LGA_2011_AUST_LGA_CODE11.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_LGA_2011_AUST_LGA_CODE11.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -703,8 +1144,8 @@ "disambigProp": "STE_NAME16", "disambigRegionId": "STE_NAME_2016", "description": "Local Government Areas 2011 by name (ABS)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_LGA_2011_AUST_LGA_NAME11.json", - "regionDisambigIdsFile": "build/TerriaJS/data/regionids/region_map-FID_LGA_2011_AUST_STE_NAME11.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_LGA_2011_AUST_LGA_NAME11.json", + "regionDisambigIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_LGA_2011_AUST_STE_NAME11.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -729,18 +1170,12 @@ -9.142175976999962 ], "regionProp": "POA_CODE16", - "aliases": [ - "poa_code_2016", - "poa_code", - "poa", - "postcode_2016", - "postcode" - ], + "aliases": ["poa_code_2016", "postcode_2016"], "digits": 4, "dataReplacements": [["^(?=\\d\\d\\d$)", "0"]], "nameProp": "POA_NAME16", "description": "Postal areas 2016 (ABS approximation)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-POA_2016_AUST_POA_CODE16.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-POA_2016_AUST_POA_CODE16.json" }, "POA_2011": { "layerName": "FID_POA_2011_AUST", @@ -757,7 +1192,7 @@ "digits": 4, "dataReplacements": [["^(?=\\d\\d\\d$)", "0"]], "description": "Postal areas 2011 (ABS approximation)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_POA_2011_AUST_POA_CODE.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_POA_2011_AUST_POA_CODE.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -776,10 +1211,10 @@ "serverMaxNativeZoom": 12, "serverMinZoom": 0, "serverMaxZoom": 28, - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-CED_CODE18_CED_2018.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-CED_CODE18_CED_2018.json", "regionProp": "CED_CODE18", "nameProp": "CED_NAME18", - "aliases": ["ced", "ced_code", "ced_2018", "ced_code_2018"], + "aliases": ["ced_2018", "ced_code_2018"], "description": "Commonwealth electoral divisions 2018 by code (ABS)", "bbox": [96.82, -43.74, 159.11, -9.14] }, @@ -791,10 +1226,10 @@ "serverMinZoom": 0, "serverMaxZoom": 28, "digits": 3, - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-CED_NAME18_CED_2018.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-CED_NAME18_CED_2018.json", "regionProp": "CED_NAME18", "nameProp": "CED_NAME18", - "aliases": ["ced_name", "ced_name_2018"], + "aliases": ["ced_name_2018"], "description": "Commonwealth electoral divisions 2018 by name (ABS)", "bbox": [96.82, -43.74, 159.11, -9.14] }, @@ -807,7 +1242,7 @@ "aliases": ["ced_code_2016"], "digits": 3, "description": "Commonwealth electoral divisions 2016 by code (ABS)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_CED_2016_AUST_CED_CODE16.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_CED_2016_AUST_CED_CODE16.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -827,7 +1262,7 @@ "regionProp": "CED_NAME16", "aliases": ["ced_name_2016"], "description": "Commonwealth electoral divisions 2016 by name (ABS)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_CED_2016_AUST_CED_NAME16.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_CED_2016_AUST_CED_NAME16.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -848,7 +1283,7 @@ "aliases": ["ced_code_2013"], "digits": 3, "description": "Commonwealth electoral divisions 2013 by code (ABS)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_CED_2013_AUST_CED_CODE13.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_CED_2013_AUST_CED_CODE13.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -868,7 +1303,7 @@ "regionProp": "CED_NAME13", "aliases": ["ced_name_2013"], "description": "Commonwealth electoral divisions 2013 by name (ABS)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_CED_2013_AUST_CED_NAME13.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_CED_2013_AUST_CED_NAME13.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -889,7 +1324,7 @@ "aliases": ["ced_code_2011"], "digits": 3, "description": "Commonwealth electoral divisions 2011 by code (ABS)", - "disabledregionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_CED_2011_AUST_CED_CODE.json", + "disabledregionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_CED_2011_AUST_CED_CODE.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -900,7 +1335,7 @@ -9.142175976999999 ], "nameProp": "CED_NAME", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_CED_2011_AUST_CED_CODE.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_CED_2011_AUST_CED_CODE.json" }, "CED_NAME_2011": { "layerName": "FID_CED_2011_AUST", @@ -910,7 +1345,7 @@ "regionProp": "CED_NAME", "aliases": ["ced_name_2011"], "description": "Commonwealth electoral divisions 2011 by name (ABS)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_CED_2011_AUST_CED_NAME.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_CED_2011_AUST_CED_NAME.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -931,7 +1366,7 @@ "aliases": ["divisionid", "com_elb_id_2016", "com_elb_id", "com_elb"], "digits": 3, "description": "Commonwealth electoral districts 2016 by code (AEC)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_COM20160509_ELB_DIV_ID.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_COM20160509_ELB_DIV_ID.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -950,7 +1385,7 @@ "serverMaxNativeZoom": 12, "serverMinZoom": 0, "serverMaxZoom": 28, - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-ELB_NAME_2021_ELB_2021.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-ELB_NAME_2021_ELB_2021.json", "regionProp": "Elect_div", "nameProp": "Elect_div", "aliases": ["com_elb_name_2021", "com_elb_name", "divisionnm"], @@ -963,7 +1398,7 @@ "serverType": "MVT", "serverMaxNativeZoom": 12, "serverMinZoom": 0, - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-ELB_NAME_2019_ELB_2019.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-ELB_NAME_2019_ELB_2019.json", "regionProp": "Sortname", "nameProp": "Sortname", "aliases": ["com_elb_name_2019"], @@ -982,7 +1417,7 @@ "textCodes": true, "aliases": ["com_elb_name_2016"], "description": "Commonwealth electoral districts 2016 by name (AEC)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_COM20160509_ELB_ELECT_DIV.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_COM20160509_ELB_ELECT_DIV.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -1003,7 +1438,7 @@ "textCodes": true, "aliases": ["com_elb_name_2011"], "description": "Commonwealth electoral districts 2011 by name (AEC)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_COM20111216_ELB_region_ELECT_DIV.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_COM20111216_ELB_region_ELECT_DIV.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -1027,7 +1462,7 @@ "nameProp": "ced_name_2013", "aliases": ["com_elb_id_2013"], "description": "Commonwealth electoral districts 2013 by id (AEC)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-CommonwealthElectoralDivision_2013_ced_code_2013.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-CommonwealthElectoralDivision_2013_ced_code_2013.json" }, "COM_ELB_NAME_2013": { "layerName": "CommonwealthElectoralDivision_2013", @@ -1041,7 +1476,7 @@ "nameProp": "ced_name_2013", "aliases": ["com_elb_name_2013"], "description": "Commonwealth electoral districts 2013 by name (AEC)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-CommonwealthElectoralDivision_2013_ced_name_2013.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-CommonwealthElectoralDivision_2013_ced_name_2013.json" }, "COM_ELB_ID_2010": { "layerName": "CommonwealthElectoralDivision_2010", @@ -1055,7 +1490,7 @@ "nameProp": "ced_name_2010", "aliases": ["com_elb_id_2010"], "description": "Commonwealth electoral districts 2010 by code (AEC)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-CommonwealthElectoralDivision_2010_ced_code_2010.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-CommonwealthElectoralDivision_2010_ced_code_2010.json" }, "COM_ELB_NAME_2010": { "layerName": "CommonwealthElectoralDivision_2010", @@ -1069,7 +1504,7 @@ "nameProp": "ced_name_2010", "aliases": ["com_elb_name_2010"], "description": "Commonwealth electoral districts 2010 by name (AEC)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-CommonwealthElectoralDivision_2010_ced_name_2010.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-CommonwealthElectoralDivision_2010_ced_name_2010.json" }, "COM_ELB_ID_2007": { "layerName": "CommonwealthElectoralDivision_2007", @@ -1083,7 +1518,7 @@ "nameProp": "ced_name_2007", "aliases": ["com_elb_id_2007"], "description": "Commonwealth electoral districts 2007 by code (AEC)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-CommonwealthElectoralDivision_2007_ced_code_2007.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-CommonwealthElectoralDivision_2007_ced_code_2007.json" }, "COM_ELB_NAME_2007": { "layerName": "CommonwealthElectoralDivision_2007", @@ -1097,7 +1532,7 @@ "nameProp": "ced_name_2007", "aliases": ["com_elb_name_2007"], "description": "Commonwealth electoral districts 2007 by name (AEC)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-CommonwealthElectoralDivision_2007_ced_name_2007.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-CommonwealthElectoralDivision_2007_ced_name_2007.json" }, "SED_CODE18": { "layerName": "SED_2018", @@ -1106,10 +1541,10 @@ "serverMaxNativeZoom": 12, "serverMinZoom": 0, "serverMaxZoom": 28, - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-SED_CODE18_SED_2018.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-SED_CODE18_SED_2018.json", "regionProp": "SED_CODE18", "nameProp": "SED_NAME18", - "aliases": ["sed", "sed_code", "sed_2018", "sed_code_2018"], + "aliases": ["sed_2018", "sed_code_2018"], "description": "State electoral divisions 2018 by code (ABS)", "bbox": [96.82, -43.74, 159.11, -9.14] }, @@ -1120,10 +1555,10 @@ "serverMaxNativeZoom": 12, "serverMinZoom": 0, "serverMaxZoom": 28, - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-SED_NAME18_SED_2018.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-SED_NAME18_SED_2018.json", "regionProp": "SED_NAME18", "nameProp": "SED_NAME18", - "aliases": ["sed_name", "sed_name_2018"], + "aliases": ["sed_name_2018"], "description": "State electoral divisions 2018 by name (ABS)", "bbox": [96.82, -43.74, 159.11, -9.14] }, @@ -1134,7 +1569,7 @@ "serverMaxNativeZoom": 12, "serverMinZoom": 0, "serverMaxZoom": 28, - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-SED_CODE18_SED_2016.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-SED_CODE18_SED_2016.json", "regionProp": "SED_CODE16", "nameProp": "SED_NAME16", "aliases": ["sed_2016", "sed_code_2016", "sed_code16"], @@ -1148,7 +1583,7 @@ "serverMaxNativeZoom": 12, "serverMinZoom": 0, "serverMaxZoom": 28, - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-SED_NAME16_SED_2016.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-SED_NAME16_SED_2016.json", "regionProp": "SED_NAME16", "nameProp": "SED_NAME16", "aliases": ["sed_name_2016", "sed_name16"], @@ -1164,7 +1599,7 @@ "aliases": ["sed_code_2011"], "digits": 5, "description": "State electoral divisions 2011 by code (ABS)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_SED_2011_AUST_SED_CODE.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_SED_2011_AUST_SED_CODE.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -1184,7 +1619,7 @@ "regionProp": "SED_NAME", "aliases": ["sed_name_2011"], "description": "State electoral divisions 2011 by name (ABS)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_SED_2011_AUST_SED_NAME.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_SED_2011_AUST_SED_NAME.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -1205,7 +1640,7 @@ "aliases": ["gccsa_code_2011"], "digits": 5, "description": "Greater capital city statistical areas 2011 by code (ABS)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_GCCSA_2011_AUST_GCC_CODE11.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_GCCSA_2011_AUST_GCC_CODE11.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -1225,7 +1660,7 @@ "regionProp": "GCC_NAME11", "aliases": ["gccsa_name_2011"], "description": "Greater capital city statistical areas 2011 by name (ABS)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_GCCSA_2011_AUST_GCC_NAME11.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_GCCSA_2011_AUST_GCC_NAME11.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -1253,7 +1688,7 @@ "aliases": ["gccsa_code_2016"], "nameProp": "GCC_NAME16", "description": "Greater capital city statistical areas 2016 by code (ABS)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-GCCSA_2016_AUST_GCC_CODE16.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-GCCSA_2016_AUST_GCC_CODE16.json" }, "GCCSA_NAME_2016": { "layerName": "GCCSA_2016_AUST", @@ -1271,7 +1706,7 @@ "aliases": ["gccsa_name_2016"], "nameProp": "GCC_NAME16", "description": "Greater capital city statistical areas 2016 by name (ABS)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-GCCSA_2016_AUST_GCC_NAME16.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-GCCSA_2016_AUST_GCC_NAME16.json" }, "GCCSA_2021": { "layerName": "GCCSA_2021", @@ -1280,7 +1715,7 @@ "serverMaxNativeZoom": 12, "serverMinZoom": 0, "serverMaxZoom": 28, - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-GCCSA_2021_GCCSA_2021.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-GCCSA_2021_GCCSA_2021.json", "regionProp": "GCC_CODE21", "nameProp": "GCC_NAME21", "aliases": ["gccsa_code_2021", "gccsa_code", "gccsa"], @@ -1294,7 +1729,7 @@ "serverMaxNativeZoom": 12, "serverMinZoom": 0, "serverMaxZoom": 28, - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-GCCSA_NAME_2021_GCCSA_2021.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-GCCSA_NAME_2021_GCCSA_2021.json", "regionProp": "GCC_NAME21", "nameProp": "GCC_NAME21", "aliases": ["gccsa_name_2021", "gccsa_name"], @@ -1307,10 +1742,10 @@ "analyticsWmsLayerName": "region_map:FID_SUA_2011_AUST", "analyticsWmsServer": "http://geoserver.nationalmap.nicta.com.au/region_map/ows", "regionProp": "SUA_CODE11", - "aliases": ["sua_code_2011", "sua_code", "sua"], + "aliases": ["sua_code_2011"], "digits": 4, "description": "Significant urban areas 2011 by code", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_SUA_2011_AUST_SUA_CODE11.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_SUA_2011_AUST_SUA_CODE11.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -1328,11 +1763,11 @@ "analyticsWmsLayerName": "region_map:FID_SUA_2011_AUST", "analyticsWmsServer": "http://geoserver.nationalmap.nicta.com.au/region_map/ows", "regionProp": "SUA_NAME11", - "aliases": ["sua_name_2011", "sua_name"], + "aliases": ["sua_name_2011"], "description": "Significant urban areas 2011 by name", "serverReplacements": [["[^A-Za-z]", ""]], "dataReplacements": [["[^A-Za-z]", ""]], - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_SUA_2011_AUST_SUA_NAME11.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_SUA_2011_AUST_SUA_NAME11.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -1353,7 +1788,7 @@ "aliases": ["ste_code_2011"], "description": "States and Territories 2011 by code (ABS)", "digits": 1, - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_STE_2011_AUST_STE_CODE11.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_STE_2011_AUST_STE_CODE11.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -1379,18 +1814,15 @@ ], "regionProp": "STE_CODE16", "aliases": [ - "ste", - "ste_code", "ste_code_2016", "ste_code_2017", "ste_code_2018", "ste_code_2019", - "ste_code_2020", - "ste_code_2021" + "ste_code_2020" ], "nameProp": "STE_NAME16", "description": "States and Territories 2016 by code (ABS)", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-STE_2016_AUST_STE_CODE16.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-STE_2016_AUST_STE_CODE16.json" }, "SOS": { "layerName": "FID_SOS_2011_AUST", @@ -1398,10 +1830,10 @@ "analyticsWmsLayerName": "region_map:FID_SOS_2011_AUST", "analyticsWmsServer": "http://geoserver.nationalmap.nicta.com.au/region_map/ows", "regionProp": "SOS_CODE11", - "aliases": ["sos_code_2011", "sos_code", "sos"], + "aliases": ["sos_code_2011"], "digits": 2, "description": "Section of state 2011", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_SOS_2011_AUST_SOS_CODE11.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_SOS_2011_AUST_SOS_CODE11.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -1419,10 +1851,10 @@ "analyticsWmsLayerName": "region_map:FID_SOSR_2011_AUST", "analyticsWmsServer": "http://geoserver.nationalmap.nicta.com.au/region_map/ows", "regionProp": "SSR_CODE11", - "aliases": ["sosr_code_2011", "sosr_code", "sosr"], + "aliases": ["sosr_code_2011"], "digits": 3, "description": "Section of state range 2011", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_SOSR_2011_AUST_SSR_CODE11.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_SOSR_2011_AUST_SSR_CODE11.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -1440,10 +1872,10 @@ "analyticsWmsLayerName": "region_map:FID_UCL_2011_AUST", "analyticsWmsServer": "http://geoserver.nationalmap.nicta.com.au/region_map/ows", "regionProp": "UCL_CODE11", - "aliases": ["ucl_code_2011", "ucl_code", "ucl"], + "aliases": ["ucl_code_2011"], "digits": 6, "description": "Urban centres and localities 2011", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_UCL_2011_AUST_UCL_CODE11.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_UCL_2011_AUST_UCL_CODE11.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -1461,10 +1893,10 @@ "analyticsWmsLayerName": "region_map:FID_IREG_2011_AUST", "analyticsWmsServer": "http://geoserver.nationalmap.nicta.com.au/region_map/ows", "regionProp": "IR_CODE11", - "aliases": ["ireg_code_2011", "ireg_code", "ireg"], + "aliases": ["ireg_code_2011"], "digits": 3, "description": "Indigenous regions 2011", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_IREG_2011_AUST_IR_CODE11.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_IREG_2011_AUST_IR_CODE11.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -1482,10 +1914,10 @@ "analyticsWmsLayerName": "region_map:FID_ILOC_2011_AUST", "analyticsWmsServer": "http://geoserver.nationalmap.nicta.com.au/region_map/ows", "regionProp": "IL_CODE11", - "aliases": ["iloc_code_2011", "iloc_code", "iloc"], + "aliases": ["iloc_code_2011"], "digits": 8, "description": "Indigenous locations 2011", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_ILOC_2011_AUST_IL_CODE11.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_ILOC_2011_AUST_IL_CODE11.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -1503,10 +1935,10 @@ "analyticsWmsLayerName": "region_map:FID_IARE_2011_AUST", "analyticsWmsServer": "http://geoserver.nationalmap.nicta.com.au/region_map/ows", "regionProp": "IA_CODE11", - "aliases": ["iare_code_2011", "iare_code", "iare"], + "aliases": ["iare_code_2011"], "digits": 6, "description": "Indigenous areas 2011", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_IARE_2011_AUST_IA_CODE11.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_IARE_2011_AUST_IA_CODE11.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -1524,10 +1956,10 @@ "analyticsWmsLayerName": "region_map:FID_RA_2011_AUST", "analyticsWmsServer": "http://geoserver.nationalmap.nicta.com.au/region_map/ows", "regionProp": "RA_CODE11", - "aliases": ["ra_code_2011", "ra_code", "ra"], + "aliases": ["ra_code_2011"], "digits": 2, "description": "Remoteness areas 2011", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_RA_2011_AUST_RA_CODE11.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_RA_2011_AUST_RA_CODE11.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -1545,10 +1977,10 @@ "analyticsWmsLayerName": "region_map:FID_TR_2015_AUST", "analyticsWmsServer": "http://geoserver.nationalmap.nicta.com.au/region_map/ows", "regionProp": "TR_CODE15", - "aliases": ["tr_code_2015", "tr_code", "tr"], + "aliases": ["tr_code_2015"], "digits": 5, "description": "Tourism regions 2015", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_TR_2015_AUST_TR_CODE15.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_TR_2015_AUST_TR_CODE15.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -1569,7 +2001,7 @@ "aliases": ["tr_code_2013", "tr_2013"], "digits": 5, "description": "Tourism regions 2013", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_TR_2013_AUST_TR_CODE13.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_TR_2013_AUST_TR_CODE13.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -1590,7 +2022,7 @@ "aliases": ["nrmr", "nrmr_code", "nrmr_code_2011"], "digits": 3, "description": "Natural resource management regions 2011", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_NRMR_2011_AUST_NRMR_CODE.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_NRMR_2011_AUST_NRMR_CODE.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -1610,7 +2042,7 @@ "regionProp": "NRMR_NAME", "aliases": ["nrmr_name"], "description": "Natural resource management regions 2011", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_NRMR_2011_AUST_NRMR_NAME.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_NRMR_2011_AUST_NRMR_NAME.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -1628,10 +2060,10 @@ "analyticsWmsLayerName": "region_map:FID_ADD_2011_AUST", "analyticsWmsServer": "http://geoserver.nationalmap.nicta.com.au/region_map/ows", "regionProp": "ADD_CODE", - "aliases": ["add", "add_code", "add_code_2011"], + "aliases": ["add_code_2011"], "digits": 3, "description": "Australian drainage divisions 2011", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_ADD_2011_AUST_ADD_CODE.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_ADD_2011_AUST_ADD_CODE.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -1649,9 +2081,9 @@ "analyticsWmsLayerName": "region_map:FID_ADD_2011_AUST", "analyticsWmsServer": "http://geoserver.nationalmap.nicta.com.au/region_map/ows", "regionProp": "ADD_NAME", - "aliases": ["add_name"], + "aliases": ["add_name_2011"], "description": "Australian drainage divisions by name 2011", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_ADD_2011_AUST_ADD_NAME.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_ADD_2011_AUST_ADD_NAME.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -1676,10 +2108,10 @@ -9.142175976999962 ], "regionProp": "ADD_CODE16", - "aliases": ["add_code_2016", "add_code", "add"], + "aliases": ["add_code_2016"], "nameProp": "ADD_NAME16", "description": "Australian drainage divisions 2016", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-ADD_2016_AUST_ADD_CODE16.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-ADD_2016_AUST_ADD_CODE16.json" }, "ADD_NAME_2016": { "layerName": "ADD_2016_AUST", @@ -1694,10 +2126,10 @@ -9.142175976999962 ], "regionProp": "ADD_NAME16", - "aliases": ["add_name_2016", "add_name"], + "aliases": ["add_name_2016"], "nameProp": "ADD_NAME16", "description": "Australian drainage divisions by name 2016", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-ADD_2016_AUST_ADD_NAME16.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-ADD_2016_AUST_ADD_NAME16.json" }, "PHN": { "layerName": "FID_PHN_boundaries_AUS_Sep2015_V5", @@ -1708,7 +2140,7 @@ "aliases": ["phn_code_2015", "phn_code", "phn"], "digits": 6, "description": "Primary health networks", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_PHN_boundaries_AUS_Sep2015_V5_PHN_Code.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_PHN_boundaries_AUS_Sep2015_V5_PHN_Code.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -1747,7 +2179,7 @@ ["^8$", "Australian Capital Territory"], ["^9$", "Other Territories"] ], - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_STE_2011_AUST_STE_NAME11.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_STE_2011_AUST_STE_NAME11.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -1794,7 +2226,7 @@ ["^8$", "Australian Capital Territory"], ["^9$", "Other Territories"] ], - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-STE_2016_AUST_STE_NAME16.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-STE_2016_AUST_STE_NAME16.json" }, "SLA": { "layerName": "fid_asgc06_sla", @@ -1821,7 +2253,7 @@ 96.81676569599999, -43.740509602999985, 159.10921900799997, -9.142175976999999 ], - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-fid_asgc06_sla_SLA_CODE06.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-fid_asgc06_sla_SLA_CODE06.json" }, "SLA_5DIGITCODE": { "layerName": "fid_asgc06_sla", @@ -1842,7 +2274,7 @@ 96.81676569599999, -43.740509602999985, 159.10921900799997, -9.142175976999999 ], - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-fid_asgc06_sla_SLA_5DIGIT.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-fid_asgc06_sla_SLA_5DIGIT.json" }, "SLA_NAME": { "layerName": "fid_asgc06_sla", @@ -1862,7 +2294,7 @@ 96.81676569599999, -43.740509602999985, 159.10921900799997, -9.142175976999999 ], - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-fid_asgc06_sla_SLA_NAME06.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-fid_asgc06_sla_SLA_NAME06.json" }, "CD": { "layerName": "fid_asgc06_cd", @@ -1883,7 +2315,7 @@ -9.142175976999999 ], "nameProp": "CD_CODE06", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-fid_asgc06_cd_CD_CODE06.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-fid_asgc06_cd_CD_CODE06.json" }, "CNT2": { "layerName": "FID_TM_WORLD_BORDERS", @@ -1894,7 +2326,7 @@ "aliases": ["cnt2", "iso2"], "digits": 2, "textCodes": true, - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_TM_WORLD_BORDERS_ISO2.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_TM_WORLD_BORDERS_ISO2.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -1915,7 +2347,7 @@ "aliases": ["cnt3", "iso3"], "digits": 3, "textCodes": true, - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_TM_WORLD_BORDERS_ISO3.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_TM_WORLD_BORDERS_ISO3.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -1935,7 +2367,7 @@ "regionProp": "NAME", "textCodes": true, "aliases": ["country"], - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_TM_WORLD_BORDERS_NAME.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_TM_WORLD_BORDERS_NAME.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -1965,7 +2397,7 @@ "aus_code_2021", "aus_code_2022" ], - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_AUS_2011_AUST_AUS_CODE.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_AUS_2011_AUST_AUS_CODE.json", "serverType": "MVT", "serverSubdomains": [], "serverMinZoom": 0, @@ -1993,7 +2425,7 @@ "aliases": ["esa", "esa_code", "esa_code_2009"], "nameProp": "ESA_NAME", "description": "Employment Service Areas 2009-2015+", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_AUS_ESA_09_ESA_CODE.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_AUS_ESA_09_ESA_CODE.json" }, "ESA_NAME_09": { "layerName": "FID_AUS_ESA_09", @@ -2011,7 +2443,7 @@ "aliases": ["esa_name", "esa_name_2009"], "nameProp": "ESA_NAME", "description": "Employment Service Areas 2009-2015+", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-FID_AUS_ESA_09_ESA_NAME.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_AUS_ESA_09_ESA_NAME.json" }, "IBRA7_REG": { "layerName": "ibra7_regions", @@ -2029,7 +2461,7 @@ "aliases": ["ibra7_reg", "ibra7_reg_code"], "nameProp": "REG_NAME_7", "description": "IBRA Regions v7", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-ibra7_regions_REG_CODE_7.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-ibra7_regions_REG_CODE_7.json" }, "IBRA7_REG_NAME": { "layerName": "ibra7_regions", @@ -2047,7 +2479,7 @@ "aliases": ["ibra7_reg_name"], "nameProp": "REG_NAME_7", "description": "IBRA Regions v7", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-ibra7_regions_REG_NAME_7.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-ibra7_regions_REG_NAME_7.json" }, "IBRA7_SUB": { "layerName": "ibra7_subregions", @@ -2065,7 +2497,7 @@ "aliases": ["ibra7_sub", "ibra7_sub_code"], "nameProp": "SUB_NAME_7", "description": "IBRA Subregions v7", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-ibra7_subregions_SUB_CODE_7.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-ibra7_subregions_SUB_CODE_7.json" }, "IBRA7_SUB_NAME": { "layerName": "ibra7_subregions", @@ -2083,7 +2515,7 @@ "aliases": ["ibra7_sub_name"], "nameProp": "SUB_NAME_7", "description": "IBRA Subregions v7", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-ibra7_subregions_SUB_NAME_7.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-ibra7_subregions_SUB_NAME_7.json" }, "NZ_AU_2017": { "layerName": "NZ_AU2017_HD_Clipped", @@ -2100,7 +2532,7 @@ "nameProp": "AU2017_NAM", "aliases": ["nz_au_code_2017", "nz_au"], "description": "Stats New Zealand Area Units 2017", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-NZ_AU2017_HD_Clipped_AU2017.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-NZ_AU2017_HD_Clipped_AU2017.json" }, "NZ_AU_2017_NAME": { "layerName": "NZ_AU2017_HD_Clipped", @@ -2117,7 +2549,7 @@ "nameProp": "AU2017_NAM", "aliases": ["nz_au_name_2017"], "description": "Stats New Zealand Area Units 2017", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-NZ_AU2017_HD_Clipped_AU2017_NAM.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-NZ_AU2017_HD_Clipped_AU2017_NAM.json" }, "NZ_MB_2017": { "layerName": "NZ_MB2017_HD_Clipped", @@ -2134,7 +2566,7 @@ "nameProp": "MB2017", "aliases": ["nz_mb_code_2017", "nz_mb"], "description": "Stats New Zealand Mesh Blocks 2017", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-NZ_MB2017_HD_Clipped_MB2017.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-NZ_MB2017_HD_Clipped_MB2017.json" }, "AEC_FED_2017_AMLS": { "layerName": "AEC_FED_2017_AMLS", @@ -2148,7 +2580,7 @@ "nameProp": "FED_DIV", "aliases": ["fed_code_2017"], "description": "Australian Electoral Commission Commonwealth Electoral Boundaries for ABS Australian Marriage Law Survey", - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-AEC_FED_2017_AMLS_FED_ABB.json" + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-AEC_FED_2017_AMLS_FED_ABB.json" }, "RRA_Name": { "layerName": "Regional_Recovery_Areas", @@ -2157,7 +2589,7 @@ "serverMaxNativeZoom": 12, "serverMinZoom": 0, "serverMaxZoom": 28, - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-RRA_Name_Regional_Recovery_Areas.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-RRA_Name_Regional_Recovery_Areas.json", "regionProp": "RRA_Name", "nameProp": "RRA_Name", "aliases": ["RRA_NAME", "RRA"], @@ -2174,7 +2606,7 @@ "serverMaxNativeZoom": 12, "serverMinZoom": 0, "serverMaxZoom": 28, - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-ABARES_CODE_ABARES_Ag_Regions.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-ABARES_CODE_ABARES_Ag_Regions.json", "regionProp": "AbaresCode", "nameProp": "AbaresName", "aliases": ["abares_code", "abares_region_code"], @@ -2191,7 +2623,7 @@ "serverMaxNativeZoom": 12, "serverMinZoom": 0, "serverMaxZoom": 28, - "regionIdsFile": "build/TerriaJS/data/regionids/region_map-ABARES_NAME_ABARES_Ag_Regions.json", + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-ABARES_NAME_ABARES_Ag_Regions.json", "regionProp": "AbaresName", "nameProp": "AbaresName", "description": "ABARES regions, farm survey statistical aggregation areas", From e75d4bee6c74f02511462c15f863a28410fa12be Mon Sep 17 00:00:00 2001 From: Stephen Davies Date: Mon, 23 Oct 2023 11:36:14 +1100 Subject: [PATCH 42/53] Fix tests, and improve some tests by checking for errors on loading --- test/ModelMixins/TableMixinSpec.ts | 92 ++++++++++--------- .../YDYRCatalogFunctionJobSpec.ts | 4 +- .../YDYRCatalogFunctionSpec.ts | 4 +- .../SdmxJson/SdmxJsonCatalogItemSpec.ts | 4 +- .../DimensionSelectorSectionSpec.tsx | 2 +- test/Table/TableStyleSpec.ts | 9 +- 6 files changed, 60 insertions(+), 55 deletions(-) diff --git a/test/ModelMixins/TableMixinSpec.ts b/test/ModelMixins/TableMixinSpec.ts index 57d6200e654..f467749db1e 100644 --- a/test/ModelMixins/TableMixinSpec.ts +++ b/test/ModelMixins/TableMixinSpec.ts @@ -74,24 +74,26 @@ describe("TableMixin", function () { item = new CsvCatalogItem("test", terria, undefined); jasmine.Ajax.install(); + jasmine.Ajax.stubRequest(/.*/).andError({}); + jasmine.Ajax.stubRequest( "build/TerriaJS/data/regionMapping.json" ).andReturn({ responseText: regionMapping }); jasmine.Ajax.stubRequest( - "build/TerriaJS/data/regionids/region_map-STE_2016_AUST_STE_NAME16.json" + "https://tiles.terria.io/region-mapping/regionids/region_map-STE_2016_AUST_STE_NAME16.json" ).andReturn({ responseText: regionIdsSte }); jasmine.Ajax.stubRequest( - "build/TerriaJS/data/regionids/region_map-FID_LGA_2011_AUST_LGA_NAME11.json" + "https://tiles.terria.io/region-mapping/regionids/region_map-FID_LGA_2011_AUST_LGA_NAME11.json" ).andReturn({ responseText: regionIdsLgaName }); jasmine.Ajax.stubRequest( - "build/TerriaJS/data/regionids/region_map-FID_LGA_2015_AUST_LGA_CODE15.json" + "https://tiles.terria.io/region-mapping/regionids/region_map-FID_LGA_2015_AUST_LGA_CODE15.json" ).andReturn({ responseText: regionIdsLgaCode }); jasmine.Ajax.stubRequest( - "build/TerriaJS/data/regionids/region_map-FID_LGA_2011_AUST_STE_NAME11.json" + "https://tiles.terria.io/region-mapping/regionids/region_map-FID_LGA_2011_AUST_STE_NAME11.json" ).andReturn({ responseText: regionIdsLgaNameStates }); }); @@ -103,7 +105,7 @@ describe("TableMixin", function () { let dataSource: CustomDataSource; beforeEach(async function () { item.setTrait(CommonStrata.user, "csvString", LatLonEnumDateIdCsv); - await item.loadMapItems(); + (await item.loadMapItems()).throwIfError(); dataSource = item.mapItems[0]; expect(dataSource instanceof CustomDataSource).toBe(true); }); @@ -170,7 +172,7 @@ describe("TableMixin", function () { it("creates entities for all times", async function () { item.defaultStyle.time.setTrait(CommonStrata.user, "timeColumn", null); - await item.loadMapItems(); + (await item.loadMapItems()).throwIfError(); const mapItem = item.mapItems[0]; expect(mapItem instanceof CustomDataSource).toBe(true); if (mapItem instanceof CustomDataSource) { @@ -191,7 +193,7 @@ describe("TableMixin", function () { "csvString", LatLonEnumDateIdWithRegionCsv ); - await item.loadMapItems(); + (await item.loadMapItems()).throwIfError(); dataSource = item.mapItems[0]; expect(dataSource instanceof CustomDataSource).toBe(true); }); @@ -265,7 +267,7 @@ describe("TableMixin", function () { it("creates entities for all times", async function () { item.defaultStyle.time.setTrait(CommonStrata.user, "timeColumn", null); - await item.loadMapItems(); + (await item.loadMapItems()).throwIfError(); const mapItem = item.mapItems[0]; expect(mapItem instanceof CustomDataSource).toBe(true); if (mapItem instanceof CustomDataSource) { @@ -281,7 +283,7 @@ describe("TableMixin", function () { item.setTrait(CommonStrata.user, "csvString", LatLonValCsv) ); - await item.loadMapItems(); + (await item.loadMapItems()).throwIfError(); const mapItem = item.mapItems[0]; expect(mapItem instanceof CustomDataSource).toBe(true); if (mapItem instanceof CustomDataSource) { @@ -295,7 +297,7 @@ describe("TableMixin", function () { item.setTrait(CommonStrata.user, "removeDuplicateRows", true); }); - await item.loadMapItems(); + (await item.loadMapItems()).throwIfError(); const mapItem = item.mapItems[0]; expect(mapItem instanceof CustomDataSource).toBe(true); if (mapItem instanceof CustomDataSource) { @@ -317,7 +319,7 @@ describe("TableMixin", function () { runInAction(() => item.setTrait(CommonStrata.user, "csvString", LatLonValCsv) ); - await item.loadMapItems(); + (await item.loadMapItems()).throwIfError(); const dataSource = item.mapItems[0] as CustomDataSource; const propertyNames = dataSource.entities.values[0].properties?.propertyNames; @@ -331,7 +333,7 @@ describe("TableMixin", function () { item.setTrait(CommonStrata.user, "csvString", BadDatesCsv) ); - await item.loadMapItems(); + (await item.loadMapItems()).throwIfError(); const mapItem = item.mapItems[0]; expect(mapItem instanceof CustomDataSource).toBe(true); if (mapItem instanceof CustomDataSource) { @@ -344,7 +346,7 @@ describe("TableMixin", function () { let dataSource: CustomDataSource; beforeEach(async function () { item.setTrait(CommonStrata.user, "csvString", ParkingSensorDataCsv); - await item.loadMapItems(); + (await item.loadMapItems()).throwIfError(); dataSource = item.mapItems[0]; expect(dataSource instanceof CustomDataSource).toBe(true); }); @@ -508,7 +510,7 @@ describe("TableMixin", function () { item.setTrait(CommonStrata.user, "csvString", LatLonEnumDateIdCsv); }); - await item.loadMapItems(); + (await item.loadMapItems()).throwIfError(); expect(item.timeDisableDimension).toBeUndefined(); }); @@ -518,7 +520,7 @@ describe("TableMixin", function () { item.setTrait(CommonStrata.user, "showDisableTimeOption", true); }); - await item.loadMapItems(); + (await item.loadMapItems()).throwIfError(); expect(item.timeDisableDimension).toBeDefined(); }); }); @@ -529,7 +531,7 @@ describe("TableMixin", function () { item.setTrait(CommonStrata.user, "csvString", LatLonEnumDateIdCsv); }); - await item.loadMapItems(); + (await item.loadMapItems()).throwIfError(); expect(item.styleDimensions?.options?.length).toBe(4); expect(item.styleDimensions?.options?.[2].id).toBe("value"); @@ -542,7 +544,7 @@ describe("TableMixin", function () { item.setTrait(CommonStrata.user, "showDisableStyleOption", true); }); - await item.loadMapItems(); + (await item.loadMapItems()).throwIfError(); expect(item.styleDimensions?.options?.length).toBe(4); expect(item.styleDimensions?.allowUndefined).toBeTruthy(); @@ -559,7 +561,7 @@ describe("TableMixin", function () { }); }); - await item.loadMapItems(); + (await item.loadMapItems()).throwIfError(); expect(item.styleDimensions?.options?.[2].id).toBe("value"); expect(item.styleDimensions?.options?.[2].name).toBe("Some Title"); @@ -574,7 +576,7 @@ describe("TableMixin", function () { }); }); - await item.loadMapItems(); + (await item.loadMapItems()).throwIfError(); expect(item.styleDimensions?.options?.[2].id).toBe("value"); expect(item.styleDimensions?.options?.[2].name).toBe("Some Style Title"); @@ -583,13 +585,13 @@ describe("TableMixin", function () { it("loads regionProviderLists on loadMapItems", async function () { item.setTrait(CommonStrata.user, "csvString", LatLonEnumDateIdCsv); - await item.loadMetadata(); + (await item.loadMetadata()).throwIfError(); expect(item.regionProviderLists).toBeUndefined(); - await item.loadMapItems(); + (await item.loadMapItems()).throwIfError(); - expect(item.regionProviderLists?.[0]?.regionProviders.length).toBe(114); + expect(item.regionProviderLists?.[0]?.regionProviders.length).toBe(143); }); it("loads regionProviderLists on loadMapItems - with multiple regionMappingDefinitionsUrl", async function () { @@ -609,16 +611,16 @@ describe("TableMixin", function () { item.setTrait(CommonStrata.user, "csvString", LgaWithDisambigCsv); - await item.loadMetadata(); + (await item.loadMetadata()).throwIfError(); expect(item.regionProviderLists).toBeUndefined(); - await item.loadMapItems(); + (await item.loadMapItems()).throwIfError(); expect(item.regionProviderLists?.length).toBe(2); expect(item.regionProviderLists?.[0]?.regionProviders.length).toBe(2); - expect(item.regionProviderLists?.[1]?.regionProviders.length).toBe(114); + expect(item.regionProviderLists?.[1]?.regionProviders.length).toBe(143); // Item region provider should match from "additionalRegion.json" (as it comes before "build/TerriaJS/data/regionMapping.json") expect(item.activeTableStyle.regionColumn?.regionType?.description).toBe( @@ -644,15 +646,15 @@ describe("TableMixin", function () { item.setTrait(CommonStrata.user, "csvString", LgaWithDisambigCsv); - await item.loadMetadata(); + (await item.loadMetadata()).throwIfError(); expect(item.regionProviderLists).toBeUndefined(); - await item.loadMapItems(); + (await item.loadMapItems()).throwIfError(); expect(item.regionProviderLists?.length).toBe(1); - expect(item.regionProviderLists?.[0]?.regionProviders.length).toBe(114); + expect(item.regionProviderLists?.[0]?.regionProviders.length).toBe(143); // Item region provider should match from "build/TerriaJS/data/regionMapping.json" expect(item.activeTableStyle.regionColumn?.regionType?.description).toBe( @@ -667,7 +669,7 @@ describe("TableMixin", function () { item.setTrait("definition", "activeStyle", "0dp"); - await item.loadMapItems(); + (await item.loadMapItems()).throwIfError(); expect(item.legends[0].items.length).toBe(7); expect(item.legends[0].items.map((i) => i.title)).toEqual([ @@ -686,7 +688,7 @@ describe("TableMixin", function () { item.setTrait("definition", "activeStyle", "1dp"); - await item.loadMapItems(); + (await item.loadMapItems()).throwIfError(); expect(item.legends[0].items.length).toBe(7); expect(item.legends[0].items.map((i) => i.title)).toEqual([ @@ -705,7 +707,7 @@ describe("TableMixin", function () { item.setTrait("definition", "activeStyle", "2dp"); - await item.loadMapItems(); + (await item.loadMapItems()).throwIfError(); expect(item.legends[0].items.length).toBe(7); expect(item.legends[0].items.map((i) => i.title)).toEqual([ @@ -724,7 +726,7 @@ describe("TableMixin", function () { item.setTrait("definition", "activeStyle", "3dp"); - await item.loadMapItems(); + (await item.loadMapItems()).throwIfError(); expect(item.legends[0].items.length).toBe(7); expect(item.legends[0].items.map((i) => i.title)).toEqual([ @@ -746,7 +748,7 @@ describe("TableMixin", function () { styles: [{ name: "0dp", title: "Some title" }] }); - await item.loadMapItems(); + (await item.loadMapItems()).throwIfError(); expect(item.legends[0].title).toBe("0dp"); }); @@ -755,7 +757,7 @@ describe("TableMixin", function () { describe("region mapping - LGA with disambig", function () { beforeEach(async function () { item.setTrait(CommonStrata.user, "csvString", LgaWithDisambigCsv); - await item.loadMapItems(); + (await item.loadMapItems()).throwIfError(); await item.regionProviderLists?.[0] ?.getRegionProvider("LGA_NAME_2011") @@ -833,7 +835,7 @@ describe("TableMixin", function () { ` ); - await item.loadMapItems(); + (await item.loadMapItems()).throwIfError(); expect(item.activeTableStyle.regionColumn?.name).toBe("lga code-_-2015"); expect(item.activeTableStyle.regionColumn?.regionType?.regionType).toBe( @@ -884,7 +886,7 @@ describe("TableMixin", function () { ]); item.setTrait(CommonStrata.user, "activeStyle", "test-style"); - await item.loadMapItems(); + (await item.loadMapItems()).throwIfError(); const mapItem = item.mapItems[0] as CustomDataSource; @@ -958,7 +960,7 @@ describe("TableMixin", function () { ]); item.setTrait(CommonStrata.user, "activeStyle", "test-style"); - await item.loadMapItems(); + (await item.loadMapItems()).throwIfError(); const mapItem = item.mapItems[0] as CustomDataSource; @@ -1067,7 +1069,7 @@ describe("TableMixin", function () { ]); item.setTrait(CommonStrata.user, "activeStyle", "test-style"); - await item.loadMapItems(); + (await item.loadMapItems()).throwIfError(); const mapItem = item.mapItems[0] as CustomDataSource; @@ -1242,7 +1244,7 @@ describe("TableMixin", function () { ]); item.setTrait(CommonStrata.user, "activeStyle", "test-style"); - await item.loadMapItems(); + (await item.loadMapItems()).throwIfError(); const mapItem = item.mapItems[0] as CustomDataSource; @@ -1396,7 +1398,7 @@ describe("TableMixin", function () { ]); item.setTrait(CommonStrata.user, "activeStyle", "test-style"); - await item.loadMapItems(); + (await item.loadMapItems()).throwIfError(); const mapItem = item.mapItems[0] as CustomDataSource; @@ -1571,7 +1573,7 @@ describe("TableMixin", function () { ]); item.setTrait(CommonStrata.user, "activeStyle", "test-style"); - await item.loadMapItems(); + (await item.loadMapItems()).throwIfError(); const mapItem = item.mapItems[0] as CustomDataSource; @@ -1773,7 +1775,7 @@ describe("TableMixin", function () { ]); item.setTrait(CommonStrata.user, "activeStyle", "test-style"); - await item.loadMapItems(); + (await item.loadMapItems()).throwIfError(); const mapItem = item.mapItems[0] as CustomDataSource; @@ -1911,7 +1913,7 @@ describe("TableMixin", function () { ]); item.setTrait(CommonStrata.user, "activeStyle", "test-style"); - await item.loadMapItems(); + (await item.loadMapItems()).throwIfError(); const mapItem = item.mapItems[0] as CustomDataSource; @@ -2017,7 +2019,7 @@ describe("TableMixin", function () { it("doesn't pick hidden style as default activeStyle", async function () { item.setTrait(CommonStrata.user, "csvString", ParkingSensorDataCsv); - await item.loadMapItems(); + (await item.loadMapItems()).throwIfError(); expect(item.activeStyle).toBe("eventid"); @@ -2028,7 +2030,7 @@ describe("TableMixin", function () { }) ]); - await item.loadMapItems(); + (await item.loadMapItems()).throwIfError(); expect(item.activeStyle).toBe("parkflag"); }); diff --git a/test/Models/Catalog/CatalogFunctions/YDYRCatalogFunctionJobSpec.ts b/test/Models/Catalog/CatalogFunctions/YDYRCatalogFunctionJobSpec.ts index cb243ee2cff..7fabfa43206 100644 --- a/test/Models/Catalog/CatalogFunctions/YDYRCatalogFunctionJobSpec.ts +++ b/test/Models/Catalog/CatalogFunctions/YDYRCatalogFunctionJobSpec.ts @@ -60,11 +60,11 @@ describe("YDYRCatalogFunctionJob", function () { ).andReturn({ responseText: regionMapping }); jasmine.Ajax.stubRequest( - "build/TerriaJS/data/regionids/region_map-SA4_2016_AUST_SA4_CODE16.json" + "https://tiles.terria.io/region-mapping/regionids/region_map-SA4_2016_AUST_SA4_CODE16.json" ).andReturn({ responseText: sa4regionCodes }); jasmine.Ajax.stubRequest( - "build/TerriaJS/data/regionids/region_map-FID_LGA_2011_AUST_LGA_CODE11.json" + "https://tiles.terria.io/region-mapping/regionids/region_map-FID_LGA_2011_AUST_LGA_CODE11.json" ).andReturn({ responseText: lga2011RegionCodes }); terria = new Terria(); diff --git a/test/Models/Catalog/CatalogFunctions/YDYRCatalogFunctionSpec.ts b/test/Models/Catalog/CatalogFunctions/YDYRCatalogFunctionSpec.ts index 2b062b557d6..d36b51abe64 100644 --- a/test/Models/Catalog/CatalogFunctions/YDYRCatalogFunctionSpec.ts +++ b/test/Models/Catalog/CatalogFunctions/YDYRCatalogFunctionSpec.ts @@ -62,11 +62,11 @@ describe("YDYRCatalogFunction", function () { }); jasmine.Ajax.stubRequest( - "build/TerriaJS/data/regionids/region_map-SA4_2016_AUST_SA4_CODE16.json" + "https://tiles.terria.io/region-mapping/regionids/region_map-SA4_2016_AUST_SA4_CODE16.json" ).andReturn({ responseText: sa4regionCodes }); jasmine.Ajax.stubRequest( - "build/TerriaJS/data/regionids/region_map-FID_LGA_2011_AUST_LGA_CODE11.json" + "https://tiles.terria.io/region-mapping/regionids/region_map-FID_LGA_2011_AUST_LGA_CODE11.json" ).andReturn({ responseText: lga2011RegionCodes }); jasmine.Ajax.stubRequest( diff --git a/test/Models/Catalog/SdmxJson/SdmxJsonCatalogItemSpec.ts b/test/Models/Catalog/SdmxJson/SdmxJsonCatalogItemSpec.ts index d27b47aea4a..538fc939f9e 100644 --- a/test/Models/Catalog/SdmxJson/SdmxJsonCatalogItemSpec.ts +++ b/test/Models/Catalog/SdmxJson/SdmxJsonCatalogItemSpec.ts @@ -46,11 +46,11 @@ describe("SdmxJsonCatalogItem", function () { ).andReturn({ responseText: regionMapping }); jasmine.Ajax.stubRequest( - "build/TerriaJS/data/regionids/region_map-STE_2016_AUST_STE_CODE16.json" + "https://tiles.terria.io/region-mapping/regionids/region_map-STE_2016_AUST_STE_CODE16.json" ).andReturn({ responseText: steCodes }); jasmine.Ajax.stubRequest( - "build/TerriaJS/data/regionids/region_map-FID_TM_WORLD_BORDERS_ISO2.json" + "https://tiles.terria.io/region-mapping/regionids/region_map-FID_TM_WORLD_BORDERS_ISO2.json" ).andReturn({ responseText: isoCodes }); jasmine.Ajax.stubRequest( diff --git a/test/ReactViews/DimensionSelectorSectionSpec.tsx b/test/ReactViews/DimensionSelectorSectionSpec.tsx index 073a2fc0500..ccc2f9e185a 100644 --- a/test/ReactViews/DimensionSelectorSectionSpec.tsx +++ b/test/ReactViews/DimensionSelectorSectionSpec.tsx @@ -170,7 +170,7 @@ describe("DimensionSelectorSection", function () { }); jasmine.Ajax.stubRequest( - "build/TerriaJS/data/regionids/region_map-FID_LGA_2015_AUST_LGA_CODE15.json" + "https://tiles.terria.io/region-mapping/regionids/region_map-FID_LGA_2015_AUST_LGA_CODE15.json" ).andReturn({ responseText: JSON.stringify( require("../../wwwroot/data/regionids/region_map-FID_LGA_2015_AUST_LGA_CODE15.json") diff --git a/test/Table/TableStyleSpec.ts b/test/Table/TableStyleSpec.ts index 49d303dc467..350b31770f4 100644 --- a/test/Table/TableStyleSpec.ts +++ b/test/Table/TableStyleSpec.ts @@ -44,21 +44,24 @@ describe("TableStyle", function () { "build/TerriaJS/data/regionMapping.json"; jasmine.Ajax.install(); + jasmine.Ajax.stubRequest(/.*/).andError({ + statusText: "Unexpected request, not stubbed" + }); jasmine.Ajax.stubRequest( "build/TerriaJS/data/regionMapping.json" ).andReturn({ responseText: regionMapping }); jasmine.Ajax.stubRequest( - "build/TerriaJS/data/regionids/region_map-SED_CODE18_SED_2018.json" + "https://tiles.terria.io/region-mapping/regionids/region_map-SED_CODE18_SED_2018.json" ).andReturn({ responseText: SedCods }); jasmine.Ajax.stubRequest( - "build/TerriaJS/data/regionids/region_map-SA4_2016_AUST_SA4_CODE16.json" + "https://tiles.terria.io/region-mapping/regionids/region_map-SA4_2016_AUST_SA4_CODE16.json" ).andReturn({ responseText: Sa4Codes }); jasmine.Ajax.stubRequest( - "build/TerriaJS/data/regionids/region_map-SA4_2016_AUST_SA4_NAME16.json" + "https://tiles.terria.io/region-mapping/regionids/region_map-SA4_2016_AUST_SA4_NAME16.json" ).andReturn({ responseText: Sa4Names }); }); From e949c4d1dd1dde9dd98cc5c762446e47ab4889db Mon Sep 17 00:00:00 2001 From: Stephen Davies Date: Wed, 25 Oct 2023 19:01:58 +1100 Subject: [PATCH 43/53] Add CLUE blocks --- wwwroot/data/regionMapping.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/wwwroot/data/regionMapping.json b/wwwroot/data/regionMapping.json index a2f929b28d2..7d456cd82e5 100644 --- a/wwwroot/data/regionMapping.json +++ b/wwwroot/data/regionMapping.json @@ -2632,6 +2632,20 @@ 96.81694140799998, -43.74050960300003, 159.10921900799997, -9.142175976999999 ] + }, + "City_of_Melbourne_CLUE": { + "layerName": "City_of_Melbourne_CLUE", + "server": "https://tiles.terria.io/City_of_Melbourne_CLUE/{z}/{x}/{y}.pbf", + "serverType": "MVT", + "serverMaxNativeZoom": 16, + "serverMinZoom": 10, + "serverMaxZoom": 28, + "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-City_of_Melbourne_CLUE.json", + "uniqueIdProp": "FID", + "regionProp": "block_id", + "nameProp": "clue_area", + "description": "City of Melbourne Census of Land Use and Employment", + "bbox": [144.88, -37.86, 145, -37.77] } } } From 7b493681ace33769f754d178472ea2d50d2f3b96 Mon Sep 17 00:00:00 2001 From: Stephen Davies Date: Wed, 25 Oct 2023 19:39:53 +1100 Subject: [PATCH 44/53] Remove atom tracking database https://xkcd.com/2170/ --- wwwroot/data/regionMapping.json | 555 +++++++++----------------------- 1 file changed, 144 insertions(+), 411 deletions(-) diff --git a/wwwroot/data/regionMapping.json b/wwwroot/data/regionMapping.json index 7d456cd82e5..7ffeece0aad 100644 --- a/wwwroot/data/regionMapping.json +++ b/wwwroot/data/regionMapping.json @@ -14,7 +14,7 @@ "nameProp": "STATE_NAME_2021", "aliases": ["ste_code_2021", "ste_code", "ste"], "description": "States and Territories 2021", - "bbox": [96.81, -43.74, 168, -9.14] + "bbox": [96.81, -43.74, 168.0, -9.14] }, "ILOC_2021": { "layerName": "ILOC_2021", @@ -29,7 +29,7 @@ "nameProp": "ILO_NAME21", "aliases": ["iloc_code_2021", "iloc_code", "iloc"], "description": "Indigenous Locations 2021", - "bbox": [96.81, -43.74, 168, -9.14] + "bbox": [96.81, -43.74, 168.0, -9.14] }, "ILOC_NAME_2021": { "layerName": "ILOC_2021", @@ -44,7 +44,7 @@ "nameProp": "ILO_NAME21", "aliases": ["iloc_name_2021", "iloc_name"], "description": "Indigenous Locations 2021", - "bbox": [96.81, -43.74, 168, -9.14] + "bbox": [96.81, -43.74, 168.0, -9.14] }, "IARE_2021": { "layerName": "IARE_2021", @@ -59,7 +59,7 @@ "nameProp": "IAR_NAME21", "aliases": ["iare_code_2021", "iare_code", "iare"], "description": "Indigenous Areas 2021", - "bbox": [96.81, -43.74, 168, -9.14] + "bbox": [96.81, -43.74, 168.0, -9.14] }, "IARE_NAME_2021": { "layerName": "IARE_2021", @@ -74,7 +74,7 @@ "nameProp": "IAR_NAME21", "aliases": ["iare_name_2021", "iare_name"], "description": "Indigenous Areas 2021", - "bbox": [96.81, -43.74, 168, -9.14] + "bbox": [96.81, -43.74, 168.0, -9.14] }, "IREG_2021": { "layerName": "IREG_2021", @@ -89,7 +89,7 @@ "nameProp": "IRE_NAME21", "aliases": ["ireg_code_2021", "ireg_code", "ireg"], "description": "Indigenous Regions 2021", - "bbox": [96.81, -43.74, 168, -9.14] + "bbox": [96.81, -43.74, 168.0, -9.14] }, "IREG_NAME_2021": { "layerName": "IREG_2021", @@ -104,7 +104,7 @@ "nameProp": "IRE_NAME21", "aliases": ["ireg_name_2021", "ireg_name"], "description": "Indigenous Regions 2021", - "bbox": [96.81, -43.74, 168, -9.14] + "bbox": [96.81, -43.74, 168.0, -9.14] }, "RA_2021": { "layerName": "RA_2021", @@ -119,7 +119,7 @@ "nameProp": "RA_NAME21", "aliases": ["ra_code_2021", "ra_code", "ra"], "description": "Remoteness Areas 2021", - "bbox": [96.81, -43.74, 168, -9.14] + "bbox": [96.81, -43.74, 168.0, -9.14] }, "SAL_2021": { "layerName": "SAL_2021", @@ -134,7 +134,7 @@ "nameProp": "SAL_NAME_2021", "aliases": ["sal_code_2021", "sal_code", "sal"], "description": "Suburbs and Localities 2021", - "bbox": [96.81, -43.74, 168, -9.14] + "bbox": [96.81, -43.74, 168.0, -9.14] }, "ADD_2021": { "layerName": "ADD_2021", @@ -149,7 +149,7 @@ "nameProp": "ADD_NAME_2021", "aliases": ["add_code_2021", "add_code", "add"], "description": "Australian Drainage Divisions 2021", - "bbox": [96.81, -43.74, 168, -9.14] + "bbox": [96.81, -43.74, 168.0, -9.14] }, "ADD_NAME_2021": { "layerName": "ADD_2021", @@ -164,7 +164,7 @@ "nameProp": "ADD_NAME_2021", "aliases": ["add_name_2021", "add_name"], "description": "Australian Drainage Divisions 2021", - "bbox": [96.81, -43.74, 168, -9.14] + "bbox": [96.81, -43.74, 168.0, -9.14] }, "DZN_2021": { "layerName": "DZN_2021", @@ -179,7 +179,7 @@ "nameProp": "DZN_CODE_2021", "aliases": ["dzn_code_2021", "dzn_code", "dzn"], "description": "Destination Zones 2021", - "bbox": [96.81, -43.74, 168, -9.14] + "bbox": [96.81, -43.74, 168.0, -9.14] }, "LGA_2022": { "layerName": "LGA_2022", @@ -194,7 +194,7 @@ "nameProp": "LGA_NAME_2022", "aliases": ["lga_code_2022"], "description": "Local Government Areas 2022", - "bbox": [96.81, -43.74, 168, -9.14] + "bbox": [96.81, -43.74, 168.0, -9.14] }, "LGA_2023": { "layerName": "LGA_2023", @@ -209,7 +209,7 @@ "nameProp": "LGA_NAME_2023", "aliases": ["lga_code_2023", "lga_code", "lga"], "description": "Local Government Areas 2023", - "bbox": [96.81, -43.74, 168, -9.14] + "bbox": [96.81, -43.74, 168.0, -9.14] }, "SED_2021": { "layerName": "SED_2021", @@ -224,7 +224,7 @@ "nameProp": "SED_NAME_2021", "aliases": ["sed_code_2021"], "description": "State Electoral Divisions 2021 (ABS)", - "bbox": [96.81, -43.74, 168, -9.14] + "bbox": [96.81, -43.74, 168.0, -9.14] }, "SED_NAME_2021": { "layerName": "SED_2021", @@ -239,7 +239,7 @@ "nameProp": "SED_NAME_2021", "aliases": ["sed_name_2021"], "description": "State Electoral Divisions 2021 (ABS)", - "bbox": [96.81, -43.74, 168, -9.14] + "bbox": [96.81, -43.74, 168.0, -9.14] }, "SED_2022": { "layerName": "SED_2022", @@ -254,7 +254,7 @@ "nameProp": "SED_NAME_2022", "aliases": ["sed_code_2022", "sed_code", "sed"], "description": "State Electoral Divisions 2022 (ABS)", - "bbox": [96.81, -43.74, 168, -9.14] + "bbox": [96.81, -43.74, 168.0, -9.14] }, "SED_NAME_2022": { "layerName": "SED_2022", @@ -269,7 +269,7 @@ "nameProp": "SED_NAME_2022", "aliases": ["sed_name_2022", "sed_name"], "description": "State Electoral Divisions 2022 (ABS)", - "bbox": [96.81, -43.74, 168, -9.14] + "bbox": [96.81, -43.74, 168.0, -9.14] }, "CED_2021": { "layerName": "CED_2021", @@ -284,7 +284,7 @@ "nameProp": "CED_NAME_2021", "aliases": ["ced_code_2021", "ced_code", "ced"], "description": "Commonwealth Electoral Divisions 2021 (ABS)", - "bbox": [96.81, -43.74, 168, -9.14] + "bbox": [96.81, -43.74, 168.0, -9.14] }, "CED_NAME_2021": { "layerName": "CED_2021", @@ -299,7 +299,7 @@ "nameProp": "CED_NAME_2021", "aliases": ["ced_name_2021", "ced_name"], "description": "Commonwealth Electoral Divisions 2021 (ABS)", - "bbox": [96.81, -43.74, 168, -9.14] + "bbox": [96.81, -43.74, 168.0, -9.14] }, "POA_2021": { "layerName": "POA_2021", @@ -320,7 +320,7 @@ "postcode" ], "description": "Postal Areas 2021 (ABS)", - "bbox": [96.81, -43.74, 168, -9.14] + "bbox": [96.81, -43.74, 168.0, -9.14] }, "TR_2021": { "layerName": "TR_2021", @@ -335,7 +335,7 @@ "nameProp": "TR_NAME_2021", "aliases": ["tr_code_2021", "tr_code", "tr"], "description": "Tourism Regions 2021", - "bbox": [96.81, -43.74, 168, -9.14] + "bbox": [96.81, -43.74, 168.0, -9.14] }, "TR_NAME_2021": { "layerName": "TR_2021", @@ -350,7 +350,7 @@ "nameProp": "TR_NAME_2021", "aliases": ["tr_name_2021", "tr_name"], "description": "Tourism Regions 2021", - "bbox": [96.81, -43.74, 168, -9.14] + "bbox": [96.81, -43.74, 168.0, -9.14] }, "SUA_2021": { "layerName": "SUA_2021", @@ -365,7 +365,7 @@ "nameProp": "SUA_NAME_2021", "aliases": ["sua_code_2021", "sua_code", "sua"], "description": "Significant Urban Areas 2021", - "bbox": [96.81, -43.74, 168, -9.14] + "bbox": [96.81, -43.74, 168.0, -9.14] }, "SUA_NAME_2021": { "layerName": "SUA_2021", @@ -380,7 +380,7 @@ "nameProp": "SUA_NAME_2021", "aliases": ["sua_name_2022", "sua_name"], "description": "Significant Urban Areas 2021", - "bbox": [96.81, -43.74, 168, -9.14] + "bbox": [96.81, -43.74, 168.0, -9.14] }, "UCL_2021": { "layerName": "UCL_2021", @@ -395,7 +395,7 @@ "nameProp": "UCL_NAME_2021", "aliases": ["ucl_code_2021", "ucl_code", "ucl"], "description": "Urban Centres and Localities 2021", - "bbox": [96.81, -43.74, 168, -9.14] + "bbox": [96.81, -43.74, 168.0, -9.14] }, "UCL_NAME_2021": { "layerName": "UCL_2021", @@ -410,7 +410,7 @@ "nameProp": "UCL_NAME_2021", "aliases": ["ucl_name_2021", "ucl_name"], "description": "Urban Centres and Localities 2021", - "bbox": [96.81, -43.74, 168, -9.14] + "bbox": [96.81, -43.74, 168.0, -9.14] }, "SOS_2021": { "layerName": "SOS_2021", @@ -425,7 +425,7 @@ "nameProp": "SOS_NAME_2021", "aliases": ["sos_code_2021", "sos_code", "sos"], "description": "Section of State 2021", - "bbox": [96.81, -43.74, 168, -9.14] + "bbox": [96.81, -43.74, 168.0, -9.14] }, "SOSR_2021": { "layerName": "SOSR_2021", @@ -440,7 +440,7 @@ "nameProp": "SOSR_NAME_2021", "aliases": ["sosr_code_2021", "sosr_code", "sosr"], "description": "Section of State Range 2021", - "bbox": [96.81, -43.74, 168, -9.14] + "bbox": [96.81, -43.74, 168.0, -9.14] }, "SA1_2011": { "layerName": "FID_SA1_2011_AUST", @@ -457,10 +457,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694140799998, -43.74050960300003, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "nameProp": "SA1_7DIG11" }, "SA1_7DIGIT_2011": { @@ -478,10 +475,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694140799998, -43.74050960300003, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "nameProp": "SA1_7DIG11" }, "SA1_2016": { @@ -492,10 +486,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694139400007, -43.74050960299996, 167.99803499600006, - -9.142175976999962 - ], + "bbox": [96.81, -43.75, 168.0, -9.14], "regionProp": "SA1_MAIN16", "aliases": ["sa1_code_2016", "sa1_maincode_2016"], "nameProp": "SA1_7DIG16", @@ -510,10 +501,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694139400007, -43.74050960299996, 167.99803499600006, - -9.142175976999962 - ], + "bbox": [96.81, -43.75, 168.0, -9.14], "regionProp": "SA1_7DIG16", "aliases": ["sa1_7digitcode", "sa1_7digitcode_2016"], "nameProp": "SA1_7DIG16", @@ -532,7 +520,7 @@ "nameProp": "SA1_CODE21", "aliases": ["sa1_code_2021", "sa1_maincode_2021", "sa1", "sa1_code"], "description": "Statistical Area Level 1 2021 (ABS)", - "bbox": [96.81, -43.75, 168, -9.14] + "bbox": [96.81, -43.75, 168.0, -9.14] }, "SA4_2011": { "layerName": "FID_SA4_2011_AUST", @@ -549,10 +537,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694140799998, -43.74050960300003, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "nameProp": "SA4_NAME11" }, "SA4_NAME_2011": { @@ -569,10 +554,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694140799998, -43.74050960300003, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "nameProp": "SA4_NAME11" }, "SA4_2016": { @@ -583,10 +565,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694139400007, -43.74050960299996, 167.99803499600006, - -9.142175976999962 - ], + "bbox": [96.81, -43.75, 168.0, -9.14], "regionProp": "SA4_CODE16", "aliases": ["sa4_maincode_2016", "sa4_code_2016"], "nameProp": "SA4_NAME16", @@ -601,10 +580,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694139400007, -43.74050960299996, 167.99803499600006, - -9.142175976999962 - ], + "bbox": [96.81, -43.75, 168.0, -9.14], "regionProp": "SA4_NAME16", "aliases": ["sa4_name_2016"], "nameProp": "SA4_NAME16", @@ -623,7 +599,7 @@ "nameProp": "SA4_NAME21", "aliases": ["sa4_code_2021", "sa4_maincode_2021", "sa4", "sa4_code"], "description": "Statistical Area Level 4 2021 by code (ABS)", - "bbox": [96.81, -43.75, 168, -9.14] + "bbox": [96.81, -43.75, 168.0, -9.14] }, "SA4_NAME_2021": { "layerName": "SA4_2021", @@ -637,7 +613,7 @@ "nameProp": "SA4_NAME21", "aliases": ["sa4_name_2021", "sa4_name"], "description": "Statistical Area Level 4 2021 by name (ABS)", - "bbox": [96.81, -43.75, 168, -9.14] + "bbox": [96.81, -43.75, 168.0, -9.14] }, "SA3_2011": { "layerName": "FID_SA3_2011_AUST", @@ -654,10 +630,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694140799998, -43.74050960300003, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "nameProp": "SA3_NAME11" }, "SA3_NAME_2011": { @@ -675,10 +648,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694140799998, -43.74050960300003, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "nameProp": "SA3_NAME11" }, "SA3_2016": { @@ -689,10 +659,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694139400007, -43.74050960299996, 167.99803499600006, - -9.142175976999962 - ], + "bbox": [96.81, -43.75, 168.0, -9.14], "regionProp": "SA3_CODE16", "aliases": ["sa3_code_2016", "sa3_maincode_2016"], "nameProp": "SA3_NAME16", @@ -707,10 +674,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694139400007, -43.74050960299996, 167.99803499600006, - -9.142175976999962 - ], + "bbox": [96.81, -43.75, 168.0, -9.14], "regionProp": "SA3_NAME16", "aliases": ["sa3_name_2016"], "nameProp": "SA3_NAME16", @@ -729,7 +693,7 @@ "nameProp": "SA3_NAME21", "aliases": ["sa3_code_2021", "sa3_maincode_2021", "sa3", "sa3_code"], "description": "Statistical Area Level 3 2021 by code (ABS)", - "bbox": [96.81, -43.75, 168, -9.14] + "bbox": [96.81, -43.75, 168.0, -9.14] }, "SA3_NAME_2021": { "layerName": "SA3_2021", @@ -743,7 +707,7 @@ "nameProp": "SA3_NAME21", "aliases": ["sa3_name_2021", "sa3_name"], "description": "Statistical Area Level 3 2021 by name (ABS)", - "bbox": [96.81, -43.75, 168, -9.14] + "bbox": [96.81, -43.75, 168.0, -9.14] }, "SA2_2011": { "layerName": "FID_SA2_2011_AUST", @@ -760,10 +724,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694140799998, -43.74050960300003, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "nameProp": "SA2_NAME11" }, "SA2_5DIG_2011": { @@ -781,10 +742,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694140799998, -43.74050960300003, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "nameProp": "SA2_NAME11" }, "SA2_NAME_2011": { @@ -801,10 +759,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694140799998, -43.74050960300003, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "nameProp": "SA2_NAME11" }, "SA2_2016": { @@ -815,10 +770,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694139400007, -43.74050960299996, 167.99803499600006, - -9.142175976999962 - ], + "bbox": [96.81, -43.75, 168.0, -9.14], "regionProp": "SA2_MAIN16", "aliases": ["sa2_code_2016", "sa2_maincode_2016"], "nameProp": "SA2_NAME16", @@ -833,10 +785,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694139400007, -43.74050960299996, 167.99803499600006, - -9.142175976999962 - ], + "bbox": [96.81, -43.75, 168.0, -9.14], "regionProp": "SA2_5DIG16", "aliases": ["sa2_5digitcode", "sa2_5digitcode_2016"], "nameProp": "SA2_NAME16", @@ -851,10 +800,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694139400007, -43.74050960299996, 167.99803499600006, - -9.142175976999962 - ], + "bbox": [96.81, -43.75, 168.0, -9.14], "regionProp": "SA2_NAME16", "aliases": ["sa2_name_2016"], "nameProp": "SA2_NAME16", @@ -873,7 +819,7 @@ "nameProp": "SA2_NAME21", "aliases": ["sa2_code_2021", "sa2_maincode_2021", "sa2", "sa2_code"], "description": "Statistical Area Level 2 2021 by code (ABS)", - "bbox": [96.81, -43.75, 168, -9.14] + "bbox": [96.81, -43.75, 168.0, -9.14] }, "SA2_NAME_2021": { "layerName": "SA2_2021", @@ -887,7 +833,7 @@ "nameProp": "SA2_NAME21", "aliases": ["sa2_name_2021", "sa2_name"], "description": "Statistical Area Level 2 2021 by name (ABS)", - "bbox": [96.81, -43.75, 168, -9.14] + "bbox": [96.81, -43.75, 168.0, -9.14] }, "SSC": { "layerName": "FID_SSC_2011_AUST", @@ -904,10 +850,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694140799998, -43.740509602999985, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "nameProp": "SSC_NAME" }, "SSC_NAME": { @@ -924,10 +867,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694140799998, -43.740509602999985, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "nameProp": "SSC_NAME" }, "SSC_2016": { @@ -938,10 +878,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694139400007, -43.74050960299996, 167.99803499600006, - -9.142175976999962 - ], + "bbox": [96.81, -43.75, 168.0, -9.14], "regionProp": "SSC_CODE16", "aliases": ["ssc_code_2016", "ssc_code", "ssc"], "nameProp": "SSC_NAME16", @@ -956,10 +893,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694139400007, -43.74050960299996, 167.99803499600006, - -9.142175976999962 - ], + "bbox": [96.81, -43.75, 168.0, -9.14], "regionProp": "SSC_NAME16", "aliases": ["ssc_name_2016", "ssc_name", "suburb"], "nameProp": "SSC_NAME16", @@ -978,7 +912,7 @@ "nameProp": "LGA_NAME21", "aliases": ["lga_code_2021", "lga_code_2020"], "description": "Local Government Areas 2021 by code (ABS)", - "bbox": [96.81, -43.75, 168, -9.14] + "bbox": [96.81, -43.75, 168.0, -9.14] }, "LGA_2019": { "layerName": "LGA_2019", @@ -992,7 +926,7 @@ "nameProp": "LGA_NAME19", "aliases": ["lga_code_2019"], "description": "Local Government Areas 2019 by code (ABS)", - "bbox": [96.81, -43.75, 168, -9.14] + "bbox": [96.81, -43.75, 168.0, -9.14] }, "LGA_2018": { "layerName": "LGA_2018_AUST", @@ -1000,10 +934,7 @@ "serverType": "MVT", "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694139400008, -43.74050960205758, 167.99803499600011, - -9.142175976703571 - ], + "bbox": [96.81, -43.75, 168.0, -9.14], "uniqueIdProp": "FID", "regionProp": "LGA_CODE18", "nameProp": "LGA_NAME18", @@ -1017,10 +948,7 @@ "serverType": "MVT", "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694139400008, -43.74050960205758, 167.99803499600011, - -9.142175976703571 - ], + "bbox": [96.81, -43.75, 168.0, -9.14], "uniqueIdProp": "FID", "regionProp": "LGA_CODE17", "nameProp": "LGA_NAME17", @@ -1036,10 +964,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694139400007, -43.74050960299996, 167.99803499600006, - -9.142175976999962 - ], + "bbox": [96.81, -43.75, 168.0, -9.14], "regionProp": "LGA_CODE16", "aliases": ["lga_code_2016"], "nameProp": "LGA_NAME16", @@ -1061,10 +986,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694140799998, -43.740509602999985, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "nameProp": "LGA_NAME15" }, "LGA_2013": { @@ -1082,10 +1004,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694140799998, -43.740509602999985, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "nameProp": "LGA_NAME13" }, "LGA_2011": { @@ -1103,10 +1022,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 112.92111395999996, -43.74050957999999, 153.63872711999997, - -9.142175969999997 - ], + "bbox": [112.92, -43.75, 153.64, -9.14], "nameProp": "LGA_NAME11" }, "LGA_NAME_2011": { @@ -1151,10 +1067,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 112.92111395999996, -43.74050957999999, 153.63872711999997, - -9.142175969999997 - ], + "bbox": [112.92, -43.75, 153.64, -9.14], "nameProp": "LGA_NAME11" }, "POA": { @@ -1165,10 +1078,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694139400007, -43.74050960299996, 167.99803499600006, - -9.142175976999962 - ], + "bbox": [96.81, -43.75, 168.0, -9.14], "regionProp": "POA_CODE16", "aliases": ["poa_code_2016", "postcode_2016"], "digits": 4, @@ -1198,10 +1108,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694140799998, -43.59821500299999, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [96.81, -43.6, 159.11, -9.14], "nameProp": "POA_NAME" }, "CED_CODE18": { @@ -1216,7 +1123,7 @@ "nameProp": "CED_NAME18", "aliases": ["ced_2018", "ced_code_2018"], "description": "Commonwealth electoral divisions 2018 by code (ABS)", - "bbox": [96.82, -43.74, 159.11, -9.14] + "bbox": [96.82, -43.74, 159.12, -9.14] }, "CED_NAME18": { "layerName": "CED_2018", @@ -1231,7 +1138,7 @@ "nameProp": "CED_NAME18", "aliases": ["ced_name_2018"], "description": "Commonwealth electoral divisions 2018 by name (ABS)", - "bbox": [96.82, -43.74, 159.11, -9.14] + "bbox": [96.82, -43.74, 159.12, -9.14] }, "CED_CODE_2016": { "layerName": "FID_CED_2016_AUST", @@ -1248,10 +1155,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694140799998, -43.74050960300003, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "nameProp": "CED_NAME16" }, "CED_NAME_2016": { @@ -1268,10 +1172,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694140799998, -43.74050960300003, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "nameProp": "CED_NAME16" }, "CED_CODE_2013": { @@ -1289,10 +1190,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694140799998, -43.740509602999985, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "nameProp": "CED_NAME13" }, "CED_NAME_2013": { @@ -1309,10 +1207,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694140799998, -43.740509602999985, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "nameProp": "CED_NAME13" }, "CED_CODE_2011": { @@ -1330,10 +1225,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694140799998, -43.740509602999985, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "nameProp": "CED_NAME", "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-FID_CED_2011_AUST_CED_CODE.json" }, @@ -1351,10 +1243,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694140799998, -43.740509602999985, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "nameProp": "CED_NAME" }, "COM_ELB_ID_2016": { @@ -1372,10 +1261,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81676599999997, -43.740509999999986, 159.1092189999999, - -9.142175999999996 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "nameProp": "SORTNAME" }, "ELB_2021": { @@ -1390,7 +1276,7 @@ "nameProp": "Elect_div", "aliases": ["com_elb_name_2021", "com_elb_name", "divisionnm"], "description": "Commonwealth electoral districts 2021 by name (AEC)", - "bbox": [96.81, -43.73, 168, -9.1] + "bbox": [96.81, -43.73, 168.0, -9.1] }, "ELB_2019": { "layerName": "ELB_2019", @@ -1403,10 +1289,7 @@ "nameProp": "Sortname", "aliases": ["com_elb_name_2019"], "description": "Commonwealth electoral districts 2019 by name (AEC)", - "bbox": [ - 96.81694140799998, -43.74050960300003, 159.10921900799997, - -9.142175976999999 - ] + "bbox": [96.81, -43.75, 159.11, -9.14] }, "COM_ELB_NAME_2016": { "layerName": "FID_COM20160509_ELB", @@ -1423,10 +1306,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81676599999997, -43.740509999999986, 159.1092189999999, - -9.142175999999996 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "nameProp": "SORTNAME" }, "COM_ELB_NAME_2011": { @@ -1444,10 +1324,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81676599999999, -43.74050999999999, 159.10921899999994, - -9.142175999999997 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "nameProp": "SORTNAME" }, "COM_ELB_ID_2013": { @@ -1456,7 +1333,7 @@ "serverType": "MVT", "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [96.816766, -43.74051, 159.109219, -9.142176], + "bbox": [96.81, -43.75, 159.11, -9.14], "uniqueIdProp": "FID", "regionProp": "ced_code_2013", "nameProp": "ced_name_2013", @@ -1470,7 +1347,7 @@ "serverType": "MVT", "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [96.816766, -43.74051, 159.109219, -9.142176], + "bbox": [96.81, -43.75, 159.11, -9.14], "uniqueIdProp": "FID", "regionProp": "ced_name_2013", "nameProp": "ced_name_2013", @@ -1484,7 +1361,7 @@ "serverType": "MVT", "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [96.816766, -43.74051, 159.109219, -9.142176], + "bbox": [96.81, -43.75, 159.11, -9.14], "uniqueIdProp": "FID", "regionProp": "ced_code_2010", "nameProp": "ced_name_2010", @@ -1498,7 +1375,7 @@ "serverType": "MVT", "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [96.816766, -43.74051, 159.109219, -9.142176], + "bbox": [96.81, -43.75, 159.11, -9.14], "uniqueIdProp": "FID", "regionProp": "ced_name_2010", "nameProp": "ced_name_2010", @@ -1512,7 +1389,7 @@ "serverType": "MVT", "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [96.817997, -43.74051, 159.105442, -9.142186], + "bbox": [96.81, -43.75, 159.11, -9.14], "uniqueIdProp": "FID", "regionProp": "ced_code_2007", "nameProp": "ced_name_2007", @@ -1526,7 +1403,7 @@ "serverType": "MVT", "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [96.817997, -43.74051, 159.105442, -9.142186], + "bbox": [96.81, -43.75, 159.11, -9.14], "uniqueIdProp": "FID", "regionProp": "ced_name_2007", "nameProp": "ced_name_2007", @@ -1546,7 +1423,7 @@ "nameProp": "SED_NAME18", "aliases": ["sed_2018", "sed_code_2018"], "description": "State electoral divisions 2018 by code (ABS)", - "bbox": [96.82, -43.74, 159.11, -9.14] + "bbox": [96.82, -43.74, 159.12, -9.14] }, "SED_NAME18": { "layerName": "SED_2018", @@ -1560,7 +1437,7 @@ "nameProp": "SED_NAME18", "aliases": ["sed_name_2018"], "description": "State electoral divisions 2018 by name (ABS)", - "bbox": [96.82, -43.74, 159.11, -9.14] + "bbox": [96.82, -43.74, 159.12, -9.14] }, "SED_CODE16": { "layerName": "SED_2016", @@ -1574,7 +1451,7 @@ "nameProp": "SED_NAME16", "aliases": ["sed_2016", "sed_code_2016", "sed_code16"], "description": "State electoral divisions 2016 by code (ABS)", - "bbox": [96.82, -43.74, 159.11, -9.14] + "bbox": [96.82, -43.74, 159.12, -9.14] }, "SED_NAME16": { "layerName": "SED_2016", @@ -1588,7 +1465,7 @@ "nameProp": "SED_NAME16", "aliases": ["sed_name_2016", "sed_name16"], "description": "State electoral divisions 2016 by code (ABS)", - "bbox": [96.82, -43.74, 159.11, -9.14] + "bbox": [96.82, -43.74, 159.12, -9.14] }, "SED_CODE11": { "layerName": "FID_SED_2011_AUST", @@ -1605,10 +1482,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 112.92111395199997, -43.740509602999985, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [112.92, -43.75, 159.11, -9.14], "nameProp": "SED_NAME" }, "SED_NAME11": { @@ -1625,10 +1499,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 112.92111395199997, -43.740509602999985, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [112.92, -43.75, 159.11, -9.14], "nameProp": "SED_NAME" }, "GCCSA_2011": { @@ -1646,10 +1517,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694140799998, -43.74050960300003, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "nameProp": "GCC_NAME11" }, "GCCSA_NAME_2011": { @@ -1666,10 +1534,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694140799998, -43.74050960300003, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "nameProp": "GCC_NAME11" }, "GCCSA_2016": { @@ -1680,10 +1545,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694139400007, -43.74050960299996, 167.99803499600006, - -9.142175976999962 - ], + "bbox": [96.81, -43.75, 168.0, -9.14], "regionProp": "GCC_CODE16", "aliases": ["gccsa_code_2016"], "nameProp": "GCC_NAME16", @@ -1698,10 +1560,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694139400007, -43.74050960299996, 167.99803499600006, - -9.142175976999962 - ], + "bbox": [96.81, -43.75, 168.0, -9.14], "regionProp": "GCC_NAME16", "aliases": ["gccsa_name_2016"], "nameProp": "GCC_NAME16", @@ -1720,7 +1579,7 @@ "nameProp": "GCC_NAME21", "aliases": ["gccsa_code_2021", "gccsa_code", "gccsa"], "description": "Greater capital city statistical areas 2021 by code (ABS)", - "bbox": [96.81, -43.75, 168, -9.14] + "bbox": [96.81, -43.75, 168.0, -9.14] }, "GCCSA_NAME_2021": { "layerName": "GCCSA_2021", @@ -1734,7 +1593,7 @@ "nameProp": "GCC_NAME21", "aliases": ["gccsa_name_2021", "gccsa_name"], "description": "Greater capital city statistical areas 2021 by name (ABS)", - "bbox": [96.81, -43.75, 168, -9.14] + "bbox": [96.81, -43.75, 168.0, -9.14] }, "SUA": { "layerName": "FID_SUA_2011_AUST", @@ -1751,10 +1610,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694140799998, -43.740509602999985, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "nameProp": "SUA_NAME11" }, "SUA_NAME": { @@ -1773,10 +1629,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694140799998, -43.740509602999985, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "nameProp": "SUA_NAME11" }, "STE_2011": { @@ -1794,10 +1647,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694140799998, -43.74050960300003, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "nameProp": "STE_NAME11" }, "STE_2016": { @@ -1808,10 +1658,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694139400007, -43.74050960299996, 167.99803499600006, - -9.142175976999962 - ], + "bbox": [96.81, -43.75, 168.0, -9.14], "regionProp": "STE_CODE16", "aliases": [ "ste_code_2016", @@ -1839,10 +1686,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694140799998, -43.740509602999985, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "nameProp": "SOS_NAME11" }, "SOSR": { @@ -1860,10 +1704,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694140799998, -43.740509602999985, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "nameProp": "SSR_NAME11" }, "UCL": { @@ -1881,10 +1722,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694140799998, -43.740509602999985, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "nameProp": "UCL_NAME11" }, "IREG": { @@ -1902,10 +1740,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694140799998, -43.740509602999985, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "nameProp": "IR_NAME11" }, "ILOC": { @@ -1923,10 +1758,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694140799998, -43.740509602999985, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "nameProp": "IL_NAME11" }, "IARE": { @@ -1944,10 +1776,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694140799998, -43.740509602999985, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "nameProp": "IA_NAME11" }, "RA": { @@ -1965,10 +1794,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694140799998, -43.740509602999985, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "nameProp": "RA_NAME11" }, "TR": { @@ -1986,10 +1812,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 112.92111395199997, -43.740509602999985, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [112.92, -43.75, 159.11, -9.14], "nameProp": "TR_NAME15" }, "TR_2013": { @@ -2007,10 +1830,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 112.92111395199997, -43.740509602999985, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [112.92, -43.75, 159.11, -9.14], "nameProp": "TR_NAME13" }, "NRMR": { @@ -2028,10 +1848,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694140799995, -43.74050960299998, 159.10921900799994, - -9.142175976999997 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "nameProp": "NRMR_NAME" }, "NRMR_NAME": { @@ -2048,10 +1865,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694140799995, -43.74050960299998, 159.10921900799994, - -9.142175976999997 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "nameProp": "NRMR_NAME" }, "ADD": { @@ -2069,10 +1883,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 112.92111395199994, -43.74050960299998, 159.10921900799994, - -9.142175976999997 - ], + "bbox": [112.92, -43.75, 159.11, -9.14], "nameProp": "ADD_NAME" }, "ADD_NAME": { @@ -2089,10 +1900,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 112.92111395199994, -43.74050960299998, 159.10921900799994, - -9.142175976999997 - ], + "bbox": [112.92, -43.75, 159.11, -9.14], "nameProp": "ADD_NAME" }, "ADD_2016": { @@ -2103,10 +1911,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694139400007, -43.74050960299996, 167.99803499600006, - -9.142175976999962 - ], + "bbox": [96.81, -43.75, 168.0, -9.14], "regionProp": "ADD_CODE16", "aliases": ["add_code_2016"], "nameProp": "ADD_NAME16", @@ -2121,10 +1926,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694139400007, -43.74050960299996, 167.99803499600006, - -9.142175976999962 - ], + "bbox": [96.81, -43.75, 168.0, -9.14], "regionProp": "ADD_NAME16", "aliases": ["add_name_2016"], "nameProp": "ADD_NAME16", @@ -2146,10 +1948,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694140800003, -43.74050960299996, 159.10921900800005, - -9.142175976999962 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "nameProp": "PHN_Name" }, "STE_NAME_2011": { @@ -2185,10 +1984,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694140799998, -43.74050960300003, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "nameProp": "STE_NAME11" }, "STE_NAME_2016": { @@ -2199,10 +1995,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694139400007, -43.74050960299996, 167.99803499600006, - -9.142175976999962 - ], + "bbox": [96.81, -43.75, 168.0, -9.14], "regionProp": "STE_NAME16", "aliases": ["state", "ste_name", "ste_name_2016", "ste_name_2021"], "nameProp": "STE_NAME16", @@ -2249,10 +2042,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81676569599999, -43.740509602999985, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-fid_asgc06_sla_SLA_CODE06.json" }, "SLA_5DIGITCODE": { @@ -2270,10 +2060,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81676569599999, -43.740509602999985, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-fid_asgc06_sla_SLA_5DIGIT.json" }, "SLA_NAME": { @@ -2290,10 +2077,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81676569599999, -43.740509602999985, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-fid_asgc06_sla_SLA_NAME06.json" }, "CD": { @@ -2310,10 +2094,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.76945846399997, -43.740509602999985, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [96.76, -43.75, 159.11, -9.14], "nameProp": "CD_CODE06", "regionIdsFile": "https://tiles.terria.io/region-mapping/regionids/region_map-fid_asgc06_cd_CD_CODE06.json" }, @@ -2332,10 +2113,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 10, "serverMaxZoom": 28, - "bbox": [ - -179.99999999999994, -85.05109999999998, 179.99999999999994, - 83.62359600000005 - ], + "bbox": [-180.0, -85.06, 180.0, 83.63], "nameProp": "NAME" }, "CNT3": { @@ -2353,10 +2131,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 10, "serverMaxZoom": 28, - "bbox": [ - -179.99999999999994, -85.05109999999998, 179.99999999999994, - 83.62359600000005 - ], + "bbox": [-180.0, -85.06, 180.0, 83.63], "nameProp": "NAME" }, "COUNTRY": { @@ -2373,10 +2148,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 10, "serverMaxZoom": 28, - "bbox": [ - -179.99999999999994, -85.05109999999998, 179.99999999999994, - 83.62359600000005 - ], + "bbox": [-180.0, -85.06, 180.0, 83.63], "nameProp": "NAME" }, "AUS": { @@ -2403,10 +2175,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81694140799998, -43.74050960300003, 159.10921900799997, - -9.142175976999999 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "nameProp": "AUS_NAME" }, "ESA_09": { @@ -2417,10 +2186,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81676599999999, -43.74050999999999, 159.10921899999994, - -9.142175999999997 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "regionProp": "ESA_CODE", "aliases": ["esa", "esa_code", "esa_code_2009"], "nameProp": "ESA_NAME", @@ -2435,10 +2201,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 96.81676599999999, -43.74050999999999, 159.10921899999994, - -9.142175999999997 - ], + "bbox": [96.81, -43.75, 159.11, -9.14], "regionProp": "ESA_NAME", "aliases": ["esa_name", "esa_name_2009"], "nameProp": "ESA_NAME", @@ -2453,10 +2216,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 72.57737629065888, -54.776992953536805, 167.9981399159851, - -9.141289999999968 - ], + "bbox": [72.57, -54.78, 168.0, -9.14], "regionProp": "REG_CODE_7", "aliases": ["ibra7_reg", "ibra7_reg_code"], "nameProp": "REG_NAME_7", @@ -2471,10 +2231,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 72.57737629065888, -54.776992953536805, 167.9981399159851, - -9.141289999999968 - ], + "bbox": [72.57, -54.78, 168.0, -9.14], "regionProp": "REG_NAME_7", "aliases": ["ibra7_reg_name"], "nameProp": "REG_NAME_7", @@ -2489,10 +2246,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 72.57737629065888, -54.77699295353692, 167.9981399159851, - -9.141289999999968 - ], + "bbox": [72.57, -54.78, 168.0, -9.14], "regionProp": "SUB_CODE_7", "aliases": ["ibra7_sub", "ibra7_sub_code"], "nameProp": "SUB_NAME_7", @@ -2507,10 +2261,7 @@ "serverMinZoom": 0, "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - 72.57737629065888, -54.77699295353692, 167.9981399159851, - -9.141289999999968 - ], + "bbox": [72.57, -54.78, 168.0, -9.14], "regionProp": "SUB_NAME_7", "aliases": ["ibra7_sub_name"], "nameProp": "SUB_NAME_7", @@ -2523,10 +2274,7 @@ "serverType": "MVT", "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - -176.89314232298426, -47.28999251282331, 178.57724348546415, - -34.392630183116 - ], + "bbox": [-176.9, -47.29, 178.58, -34.39], "uniqueIdProp": "FID", "regionProp": "AU2017", "nameProp": "AU2017_NAM", @@ -2540,10 +2288,7 @@ "serverType": "MVT", "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - -176.89314232298426, -47.28999251282331, 178.57724348546415, - -34.392630183116 - ], + "bbox": [-176.9, -47.29, 178.58, -34.39], "uniqueIdProp": "FID", "regionProp": "AU2017_NAM", "nameProp": "AU2017_NAM", @@ -2557,10 +2302,7 @@ "serverType": "MVT", "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [ - -176.89314232298426, -47.28999251282331, 178.57724348546415, - -34.392630183116 - ], + "bbox": [-176.9, -47.29, 178.58, -34.39], "uniqueIdProp": "FID", "regionProp": "MB2017", "nameProp": "MB2017", @@ -2574,7 +2316,7 @@ "serverType": "MVT", "serverMaxNativeZoom": 12, "serverMaxZoom": 28, - "bbox": [96.816941, -43.74051, 167.99803499600011, -9.142176], + "bbox": [96.81, -43.75, 168.0, -9.14], "uniqueIdProp": "FID", "regionProp": "FED_ABB", "nameProp": "FED_DIV", @@ -2594,10 +2336,7 @@ "nameProp": "RRA_Name", "aliases": ["RRA_NAME", "RRA"], "description": "Bushfire Regional Recovery Areas", - "bbox": [ - 96.81694140799998, -43.74050960300003, 159.10921900799997, - -9.142175976999999 - ] + "bbox": [96.81, -43.75, 159.11, -9.14] }, "ABARES_CODE": { "layerName": "ABARES_Ag_Regions", @@ -2611,10 +2350,7 @@ "nameProp": "AbaresName", "aliases": ["abares_code", "abares_region_code"], "description": "ABARES regions, farm survey statistical aggregation areas", - "bbox": [ - 96.81694140799998, -43.74050960300003, 159.10921900799997, - -9.142175976999999 - ] + "bbox": [96.81, -43.75, 159.11, -9.14] }, "ABARES_NAME": { "layerName": "ABARES_Ag_Regions", @@ -2628,10 +2364,7 @@ "nameProp": "AbaresName", "description": "ABARES regions, farm survey statistical aggregation areas", "aliases": ["abares_name", "abares_region_name"], - "bbox": [ - 96.81694140799998, -43.74050960300003, 159.10921900799997, - -9.142175976999999 - ] + "bbox": [96.81, -43.75, 159.11, -9.14] }, "City_of_Melbourne_CLUE": { "layerName": "City_of_Melbourne_CLUE", @@ -2645,7 +2378,7 @@ "regionProp": "block_id", "nameProp": "clue_area", "description": "City of Melbourne Census of Land Use and Employment", - "bbox": [144.88, -37.86, 145, -37.77] + "bbox": [144.88, -37.86, 145.0, -37.77] } } } From 1aaeffb3d18580ecfb801ad1cb4a97830e3a7964 Mon Sep 17 00:00:00 2001 From: Stephen Davies Date: Wed, 25 Oct 2023 19:48:34 +1100 Subject: [PATCH 45/53] Add changelog entry --- CHANGES.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 1ee97136874..eab10dc1711 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,10 @@ - Fix bug in mismatched GeoJSON Feature `_id_` and TableMixin `rowId` - this was causing incorrect styling when using `filterByProperties` or features had `null` geometry - Fix splitter for `GeoJsonMixin` (lines and polygon features only) - Fix share links with picked features from `ProtomapsImageryProvider` +- Added many remaining ASGS 2021 region types to region mapping (STE_2021,ILOC_2021,IARE_2021,IREG_2021,RA_2021,SAL_2021,ADD_2021,DZN_2021,LGA_2022,LGA_2023,SED_2021,SED_2022, + CED_2021,POA_2021,TR_2021,SUA_2021,UCL_2021,SOS_2021,SOSR_2021). + - See [ASGS 2021](https://www.abs.gov.au/statistics/standards/australian-statistical-geography-standard-asgs-edition-3/jul2021-jun2026/access-and-downloads/digital-boundary-files) +- Added [Melbourne CLUE blocks](https://data.melbourne.vic.gov.au/pages/clue/) to region mapping. - [The next improvement] #### 8.3.6 - 2023-10-03 From beabdbea819578d41892ae340ee65bc1966250b1 Mon Sep 17 00:00:00 2001 From: Stephen Davies Date: Thu, 26 Oct 2023 00:44:57 +1100 Subject: [PATCH 46/53] Update number of region mapping types --- test/ModelMixins/TableMixinSpec.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/test/ModelMixins/TableMixinSpec.ts b/test/ModelMixins/TableMixinSpec.ts index f467749db1e..f74c8d54f18 100644 --- a/test/ModelMixins/TableMixinSpec.ts +++ b/test/ModelMixins/TableMixinSpec.ts @@ -63,6 +63,8 @@ const regionIdsLgaNameStates = JSON.stringify( require("../../wwwroot/data/regionids/region_map-FID_LGA_2011_AUST_STE_NAME11.json") ); +const NUMBER_OF_REGION_MAPPING_TYPES = 144; + describe("TableMixin", function () { let item: CsvCatalogItem; let terria: Terria; @@ -591,7 +593,9 @@ describe("TableMixin", function () { (await item.loadMapItems()).throwIfError(); - expect(item.regionProviderLists?.[0]?.regionProviders.length).toBe(143); + expect(item.regionProviderLists?.[0]?.regionProviders.length).toBe( + NUMBER_OF_REGION_MAPPING_TYPES + ); }); it("loads regionProviderLists on loadMapItems - with multiple regionMappingDefinitionsUrl", async function () { @@ -620,7 +624,9 @@ describe("TableMixin", function () { expect(item.regionProviderLists?.length).toBe(2); expect(item.regionProviderLists?.[0]?.regionProviders.length).toBe(2); - expect(item.regionProviderLists?.[1]?.regionProviders.length).toBe(143); + expect(item.regionProviderLists?.[1]?.regionProviders.length).toBe( + NUMBER_OF_REGION_MAPPING_TYPES + ); // Item region provider should match from "additionalRegion.json" (as it comes before "build/TerriaJS/data/regionMapping.json") expect(item.activeTableStyle.regionColumn?.regionType?.description).toBe( @@ -654,7 +660,9 @@ describe("TableMixin", function () { expect(item.regionProviderLists?.length).toBe(1); - expect(item.regionProviderLists?.[0]?.regionProviders.length).toBe(143); + expect(item.regionProviderLists?.[0]?.regionProviders.length).toBe( + NUMBER_OF_REGION_MAPPING_TYPES + ); // Item region provider should match from "build/TerriaJS/data/regionMapping.json" expect(item.activeTableStyle.regionColumn?.regionType?.description).toBe( From 2f0cec5a4c864cabb2bcdbc51cd34cea2ca2cbfb Mon Sep 17 00:00:00 2001 From: Nick Forbes-Smith Date: Thu, 26 Oct 2023 11:16:01 +1000 Subject: [PATCH 47/53] Add `hideDefaultDescription` to `CatalogMemberMixin` (#6951) --- CHANGES.md | 1 + lib/ReactViews/Preview/Description.jsx | 6 +- .../TraitsClasses/CatalogMemberTraits.ts | 8 +++ test/ReactViews/Preview/DescriptionSpec.tsx | 55 ++++++++++++++++++- 4 files changed, 67 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 1ee97136874..1745a1601b3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,7 @@ - Fix bug in mismatched GeoJSON Feature `_id_` and TableMixin `rowId` - this was causing incorrect styling when using `filterByProperties` or features had `null` geometry - Fix splitter for `GeoJsonMixin` (lines and polygon features only) - Fix share links with picked features from `ProtomapsImageryProvider` +- Add `hideDefaultDescription` to `CatalogMemberTraits` - if true, then no generic default description will be shown when `description` is empty. - [The next improvement] #### 8.3.6 - 2023-10-03 diff --git a/lib/ReactViews/Preview/Description.jsx b/lib/ReactViews/Preview/Description.jsx index cfb32fdd38c..904abfbd82f 100644 --- a/lib/ReactViews/Preview/Description.jsx +++ b/lib/ReactViews/Preview/Description.jsx @@ -64,7 +64,11 @@ class Description extends React.Component {

    {t("description.dataNotLocal")}

    diff --git a/lib/Traits/TraitsClasses/CatalogMemberTraits.ts b/lib/Traits/TraitsClasses/CatalogMemberTraits.ts index c073799b775..9ddf821411d 100644 --- a/lib/Traits/TraitsClasses/CatalogMemberTraits.ts +++ b/lib/Traits/TraitsClasses/CatalogMemberTraits.ts @@ -116,6 +116,14 @@ class CatalogMemberTraits extends ModelTraits { }) description?: string; + @primitiveTrait({ + type: "boolean", + name: "Hide default description", + description: + "If true, then no generic default description will be displayed if `description` is undefined." + }) + hideDefaultDescription: boolean = false; + @primitiveTrait({ type: "string", name: "Name in catalog", diff --git a/test/ReactViews/Preview/DescriptionSpec.tsx b/test/ReactViews/Preview/DescriptionSpec.tsx index fa1ec7c33d6..c9bfe4b42bf 100644 --- a/test/ReactViews/Preview/DescriptionSpec.tsx +++ b/test/ReactViews/Preview/DescriptionSpec.tsx @@ -3,9 +3,11 @@ import React from "react"; import { act } from "react-dom/test-utils"; import { create, ReactTestRenderer } from "react-test-renderer"; import { ThemeProvider } from "styled-components"; -import Terria from "../../../lib/Models/Terria"; -import updateModelFromJson from "../../../lib/Models/Definition/updateModelFromJson"; +import GeoJsonCatalogItem from "../../../lib/Models/Catalog/CatalogItems/GeoJsonCatalogItem"; import WebMapServiceCatalogItem from "../../../lib/Models/Catalog/Ows/WebMapServiceCatalogItem"; +import CommonStrata from "../../../lib/Models/Definition/CommonStrata"; +import updateModelFromJson from "../../../lib/Models/Definition/updateModelFromJson"; +import Terria from "../../../lib/Models/Terria"; import Description from "../../../lib/ReactViews/Preview/Description"; import { terriaTheme } from "../../../lib/ReactViews/StandardUserInterface"; @@ -142,4 +144,53 @@ describe("DescriptionSpec", function () { expect(child.props.children).toBe("some link"); }); + + it("respects hideDefaultDescription", function () { + const geoJsonItem = new GeoJsonCatalogItem("test-geojson", terria); + runInAction(() => { + geoJsonItem.setTrait(CommonStrata.definition, "description", "test"); + }); + + act(() => { + testRenderer = create( + + + + ); + }); + + const showDescription = testRenderer.root.findAll( + (node) => node.type === "p" + ); + + expect(showDescription.length).toEqual(1); + expect(showDescription[0].children[0]).toBe("test"); + + runInAction(() => { + geoJsonItem.setTrait(CommonStrata.definition, "description", ""); + }); + + const showDefaultDescription = testRenderer.root.findAll( + (node) => node.type === "p" + ); + + expect(showDefaultDescription.length).toEqual(1); + expect(showDefaultDescription[0].children[0]).toBe( + "description.dataNotLocal" + ); + + runInAction(() => { + geoJsonItem.setTrait( + CommonStrata.definition, + "hideDefaultDescription", + true + ); + }); + + const showNoDescription = testRenderer.root.findAll( + (node) => node.type === "p" + ); + + expect(showNoDescription.length).toEqual(0); + }); }); From 49b4c8a451595ded793773f23f4bfbddad2ddbfe Mon Sep 17 00:00:00 2001 From: Mike Wu <41275384+mwu2018@users.noreply.github.com> Date: Thu, 26 Oct 2023 15:41:02 +1100 Subject: [PATCH 48/53] v8.3.7 (#6953) --- CHANGES.md | 7 +++++-- package.json | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 8d119cecab2..2244eaed456 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,10 @@ # Change Log -#### next release (8.3.7) +#### next release (8.3.8) + +- [The next improvement] + +#### 8.3.7 - 2023-10-26 - Fix `WebMapServiceCatalogItem` `allowFeaturePicking` - Allow translation of TableStylingWorkflow. @@ -13,7 +17,6 @@ - Fix share links with picked features from `ProtomapsImageryProvider` - Added on screen attribution and Google logo for Google Photorealistic 3D Tiles. - Add `hideDefaultDescription` to `CatalogMemberTraits` - if true, then no generic default description will be shown when `description` is empty. -- [The next improvement] #### 8.3.6 - 2023-10-03 diff --git a/package.json b/package.json index 35fc2b61343..c1baed979f4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "terriajs", - "version": "8.3.6", + "version": "8.3.7", "description": "Geospatial data visualization platform.", "license": "Apache-2.0", "engines": { From 66c4dd09d912ef8b18527c1b9764cbe4c6fb7398 Mon Sep 17 00:00:00 2001 From: Nick Forbes-Smith Date: Fri, 27 Oct 2023 22:43:14 +1100 Subject: [PATCH 49/53] Re-enable tests --- test/ReactViews/DataCatalog/CatalogGroupSpec.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/ReactViews/DataCatalog/CatalogGroupSpec.tsx b/test/ReactViews/DataCatalog/CatalogGroupSpec.tsx index 8aa83fb516c..731d8363357 100644 --- a/test/ReactViews/DataCatalog/CatalogGroupSpec.tsx +++ b/test/ReactViews/DataCatalog/CatalogGroupSpec.tsx @@ -6,7 +6,7 @@ import { terriaTheme } from "../../../lib/ReactViews/StandardUserInterface"; import { create } from "react-test-renderer"; import { act } from "react-dom/test-utils"; -fdescribe("CatalogGroup", () => { +describe("CatalogGroup", () => { let testRenderer: ReturnType; describe("Loading", () => { From 51c39b31191b8791ed9b1d8ea18426ab8af88914 Mon Sep 17 00:00:00 2001 From: Nick Forbes-Smith Date: Fri, 27 Oct 2023 23:19:24 +1100 Subject: [PATCH 50/53] Fix WMS nested group IDs --- CHANGES.md | 3 +- .../Catalog/Ows/WebMapServiceCatalogGroup.ts | 18 +++--- .../Ows/WebMapServiceCatalogGroupSpec.ts | 61 ++++++++++++++----- wwwroot/test/WMS/wms_nested_groups.xml | 47 ++++++++++++++ 4 files changed, 105 insertions(+), 24 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 3bb3ea568c1..bbb6d82efb8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,8 +2,9 @@ #### next release (8.3.8) -- [The next improvement] +- Fix WMS nested group IDs - nested groups with the same name were not being created - Remove `jsx-control-statements` dependency +- [The next improvement] #### 8.3.7 - 2023-10-26 diff --git a/lib/Models/Catalog/Ows/WebMapServiceCatalogGroup.ts b/lib/Models/Catalog/Ows/WebMapServiceCatalogGroup.ts index bbaecbcee64..bdf48aff1ce 100644 --- a/lib/Models/Catalog/Ows/WebMapServiceCatalogGroup.ts +++ b/lib/Models/Catalog/Ows/WebMapServiceCatalogGroup.ts @@ -168,8 +168,8 @@ class GetCapabilitiesStratum extends LoadableStratum( } @action - createMemberFromLayer(layer: CapabilitiesLayer) { - const layerId = this.getLayerId(layer); + createMemberFromLayer(layer: CapabilitiesLayer, parentLayerId?: string) { + const layerId = this.getLayerId(layer, parentLayerId); if (!layerId) { return; @@ -185,7 +185,7 @@ class GetCapabilitiesStratum extends LoadableStratum( members = [layer.Layer as CapabilitiesLayer]; } - members.forEach((member) => this.createMemberFromLayer(member)); + members.forEach((member) => this.createMemberFromLayer(member, layerId)); // Create group const existingModel = this.catalogGroup.terria.getModelById( @@ -215,7 +215,9 @@ class GetCapabilitiesStratum extends LoadableStratum( model.setTrait( CommonStrata.definition, "members", - filterOutUndefined(members.map((member) => this.getLayerId(member))) + filterOutUndefined( + members.map((member) => this.getLayerId(member, layerId)) + ) ); // Set group `info` trait if applicable @@ -318,11 +320,13 @@ class GetCapabilitiesStratum extends LoadableStratum( model.createGetCapabilitiesStratumFromParent(this.capabilities); } - getLayerId(layer: CapabilitiesLayer) { - if (!isDefined(this.catalogGroup.uniqueId)) { + getLayerId(layer: CapabilitiesLayer, parentLayerId?: string) { + if (!isDefined(this.catalogGroup.uniqueId) && !isDefined(parentLayerId)) { return; } - return `${this.catalogGroup.uniqueId}/${layer.Name ?? layer.Title}`; + return `${parentLayerId ?? this.catalogGroup.uniqueId}/${ + layer.Name ?? layer.Title + }`; } /** For backward-compatibility. diff --git a/test/Models/Catalog/Ows/WebMapServiceCatalogGroupSpec.ts b/test/Models/Catalog/Ows/WebMapServiceCatalogGroupSpec.ts index 2c3b3ebb7be..c1b16bbd00d 100644 --- a/test/Models/Catalog/Ows/WebMapServiceCatalogGroupSpec.ts +++ b/test/Models/Catalog/Ows/WebMapServiceCatalogGroupSpec.ts @@ -133,26 +133,53 @@ describe("WebMapServiceCatalogGroup", function () { }); it("loads", async function () { - expect(wms.members.length).toEqual(3); - expect(wms.memberModels.length).toEqual(3); + expect(wms.members.length).toEqual(2); + expect(wms.memberModels.length).toEqual(2); - const firstGroup = wms.memberModels[0]; + const firstGroup = wms.memberModels[0] as WebMapServiceCatalogGroup; + expect(firstGroup.uniqueId).toEqual( + "test/Digital Earth Australia - OGC Web Services" + ); expect( GroupMixin.isMixedInto(firstGroup) && firstGroup.members.length ).toEqual(3); - const firstGroupFirstModel = - GroupMixin.isMixedInto(firstGroup) && firstGroup.memberModels[0]; - expect( - firstGroupFirstModel && - CatalogMemberMixin.isMixedInto(firstGroupFirstModel) && - firstGroupFirstModel.name - ).toEqual("Surface Reflectance 25m Annual Geomedian (Landsat 8)"); + const firstSubGroup = firstGroup + .memberModels[0] as WebMapServiceCatalogGroup; + expect(firstSubGroup.uniqueId).toEqual( + "test/Digital Earth Australia - OGC Web Services/Surface Reflectance" + ); + expect(firstSubGroup.name).toEqual("Surface Reflectance"); + expect(firstSubGroup.members.length).toEqual(3); - const thirdGroup = wms.memberModels[2]; - expect( - GroupMixin.isMixedInto(thirdGroup) && thirdGroup.members.length - ).toEqual(1); + const firstSubGroupModel = firstSubGroup + .memberModels[0] as WebMapServiceCatalogItem; + expect(firstSubGroupModel.uniqueId).toEqual( + "test/Digital Earth Australia - OGC Web Services/Surface Reflectance/ls8_nbart_geomedian_annual" + ); + expect(firstSubGroupModel.name).toEqual( + "Surface Reflectance 25m Annual Geomedian (Landsat 8)" + ); + + const secondGroup = wms.memberModels[1] as WebMapServiceCatalogGroup; + expect(secondGroup.uniqueId).toEqual("test/Some other catalog"); + expect(secondGroup.name).toEqual("Some other catalog"); + expect(secondGroup.memberModels.length).toEqual(1); + + const secondSubGroup = secondGroup + .memberModels[0] as WebMapServiceCatalogGroup; + expect(secondSubGroup.uniqueId).toEqual( + "test/Some other catalog/Surface Reflectance" + ); + expect(secondSubGroup.name).toEqual("Surface Reflectance"); + expect(secondSubGroup.members.length).toEqual(1); + + const secondSubGroupModel = secondSubGroup + .memberModels[0] as WebMapServiceCatalogItem; + expect(secondSubGroupModel.uniqueId).toEqual( + "test/Some other catalog/Surface Reflectance/some_layer" + ); + expect(secondSubGroupModel.name).toEqual("Some layer"); }); }); @@ -176,8 +203,10 @@ describe("WebMapServiceCatalogGroup", function () { }); it("sets traits correctly", async function () { - const wmsItem = (wms.memberModels[0] as WebMapServiceCatalogGroup) - .memberModels[0] as WebMapServiceCatalogItem; + const wmsItem = ( + (wms.memberModels[0] as WebMapServiceCatalogGroup) + .memberModels[0] as WebMapServiceCatalogGroup + ).memberModels[0] as WebMapServiceCatalogItem; expect(wmsItem.linkedWcsUrl).toEqual("some-url"); expect(wmsItem.linkedWcsCoverage).toEqual("ls8_nbart_geomedian_annual"); diff --git a/wwwroot/test/WMS/wms_nested_groups.xml b/wwwroot/test/WMS/wms_nested_groups.xml index 62a58e44d16..fc5852e1f94 100644 --- a/wwwroot/test/WMS/wms_nested_groups.xml +++ b/wwwroot/test/WMS/wms_nested_groups.xml @@ -601,5 +601,52 @@ NOTE this layer has no EX_GeographicBoundingBox + + Some other catalog + + Some other catalog + + EPSG:3857 + EPSG:4326 + EPSG:3577 + EPSG:3111 + + 100 + 160 + -50 + -10 + + + Surface Reflectance + This is another layer called Surface Reflectance + + some_layer + Some layer + Some layer + + + WOfS + + + 109.989859933428 + 156.101505058599 + -45.2413329418709 + -9.02727104242042 + + + + + + + 2013-01-01,2014-01-01,2015-01-01,2016-01-01,2017-01-01,2018-01-01 + + + + + From c2d5cf13ce2ba1939ed24a1c3eeee1aff7c6b6ac Mon Sep 17 00:00:00 2001 From: Nick Forbes-Smith Date: Fri, 3 Nov 2023 14:15:39 +1100 Subject: [PATCH 51/53] Fix WMS sharekeys --- .../Catalog/Ows/WebMapServiceCatalogGroup.ts | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/lib/Models/Catalog/Ows/WebMapServiceCatalogGroup.ts b/lib/Models/Catalog/Ows/WebMapServiceCatalogGroup.ts index bdf48aff1ce..58517a153ae 100644 --- a/lib/Models/Catalog/Ows/WebMapServiceCatalogGroup.ts +++ b/lib/Models/Catalog/Ows/WebMapServiceCatalogGroup.ts @@ -201,7 +201,7 @@ class GetCapabilitiesStratum extends LoadableStratum( // At the moment we ignore duplicate layers this.catalogGroup.terria.addModel( model, - this.getLayerShareKeys(layer) + this.getLayerShareKeys(layer, layerId) ); } catch (e) { TerriaError.from(e, "Failed to add CatalogGroup").log(); @@ -253,7 +253,10 @@ class GetCapabilitiesStratum extends LoadableStratum( try { // Sometimes WMS Layers have duplicate names // At the moment we ignore duplicate layers - this.catalogGroup.terria.addModel(model, this.getLayerShareKeys(layer)); + this.catalogGroup.terria.addModel( + model, + this.getLayerShareKeys(layer, layerId) + ); } catch (e) { TerriaError.from(e, "Failed to add WebMapServiceCatalogItem").log(); return; @@ -330,14 +333,20 @@ class GetCapabilitiesStratum extends LoadableStratum( } /** For backward-compatibility. - * If layer.Name is defined, we will use it to create layer autoID (see `this.getLayerId`). - * Previously we used layer.Title, so we now add it as a shareKey + * Previously we have used the following IDs + * - `WMS Group Catalog ID/WMS Layer Name` - regardless of nesting + * - `WMS Group Catalog ID/WMS Layer Title` */ - getLayerShareKeys(layer: CapabilitiesLayer) { + getLayerShareKeys(layer: CapabilitiesLayer, layerId: string) { + const shareKeys: string[] = []; + + if (layerId !== `${this.catalogGroup.uniqueId}/${layer.Name}`) + shareKeys.push(`${this.catalogGroup.uniqueId}/${layer.Name}`); + if (isDefined(layer.Name) && layer.Title !== layer.Name) - return [`${this.catalogGroup.uniqueId}/${layer.Title}`]; + shareKeys.push(`${this.catalogGroup.uniqueId}/${layer.Title}`); - return []; + return shareKeys; } } From 9dd9a144c599b12442ed61d98a7b5085b9dbafde Mon Sep 17 00:00:00 2001 From: Nick Forbes-Smith Date: Fri, 3 Nov 2023 14:57:37 +1100 Subject: [PATCH 52/53] Add comment + update CHANGES --- CHANGES.md | 11 +++++------ .../Catalog/Ows/WebMapServiceCapabilitiesStratum.ts | 4 +++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 2b14c2a1222..e3b49c67e38 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,19 +2,18 @@ #### next release (8.3.8) -- [The next improvement] - Remove `jsx-control-statements` dependency +- WMS `isEsri` default value will now check for case-insensitive `mapserver/wmsserver` (instead of `MapServer/WMSServer`) +- Tweak ArcGis MapServer WMS `GetFeatureInfo` default behaviour + - Add `application/geo+json` and `application/vnd.geo+json` default `GetFeatureInfo` (after `application/json` in priority list) + - Add `application/xml` default `GetFeatureInfo`. (if `isEsri` is true, then this will be used before `text/html`) +- [The next improvement] #### 8.3.7 - 2023-10-26 - Fix `WebMapServiceCatalogItem` `allowFeaturePicking` - Allow translation of TableStylingWorkflow. - Fix "Remove all" not removing selected/picked features -- WMS `isEsri` default value will now check for case-insensitive `mapserver/wmsserver` (instead of `MapServer/WMSServer`) -- Tweak ArcGis MapServer WMS `GetFeatureInfo` default behaviour - - Add `application/geo+json` and `application/vnd.geo+json` default `GetFeatureInfo` (after `application/json` in priority list) - - Add `application/xml` default `GetFeatureInfo`. (if `isEsri` is true, then this will be used before `text/html`) -- [The next improvement] - Fix crash on empty GeoJSON features - Add `tableFeatureInfoContext` support to `GeoJsonMixin.createProtomapsImageryProvider` - Fix `GeoJsonMixin` timeline animation for lines/polygons diff --git a/lib/Models/Catalog/Ows/WebMapServiceCapabilitiesStratum.ts b/lib/Models/Catalog/Ows/WebMapServiceCapabilitiesStratum.ts index 32b8737cc18..67a83fb5f11 100644 --- a/lib/Models/Catalog/Ows/WebMapServiceCapabilitiesStratum.ts +++ b/lib/Models/Catalog/Ows/WebMapServiceCapabilitiesStratum.ts @@ -861,7 +861,7 @@ export default class WebMapServiceCapabilitiesStratum extends LoadableStratum( if (formatsArray.includes("application/vnd.geo+json")) return { format: "application/vnd.geo+json", type: "json" }; - // Special case for Esri WMS, use XML before HTML + // Special case for Esri WMS, use XML before HTML/GML // as HTML includes with rowbg that is hard to read if (this.isEsri && formatsArray.includes("text/xml")) { return { format: "text/xml", type: "xml" }; @@ -870,6 +870,8 @@ export default class WebMapServiceCapabilitiesStratum extends LoadableStratum( return { format: "text/html", type: "html" }; if (formatsArray.includes("application/vnd.ogc.gml")) return { format: "application/vnd.ogc.gml", type: "xml" }; + + // For non-Esri services, we use XML after HTML/GML if (formatsArray.includes("text/xml")) { return { format: "text/xml", type: "xml" }; } From a4fb9dd6b5a03413355d904e5eff22847fc60b5a Mon Sep 17 00:00:00 2001 From: Nick Forbes-Smith Date: Fri, 3 Nov 2023 18:22:23 +1100 Subject: [PATCH 53/53] Fix changes --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index b560d68191f..bf3f525cd4d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,7 @@ #### next release (8.3.8) +- Remove `jsx-control-statements` dependency - Fix WMS nested group IDs - nested groups with the same name were not being created - WMS `isEsri` default value will now check for case-insensitive `mapserver/wmsserver` (instead of `MapServer/WMSServer`) - Tweak ArcGis MapServer WMS `GetFeatureInfo` default behaviour