svgmap 2.14.0 → 2.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/demo/react/app/package-lock.json +37 -12
- package/dist/svgMap.css +17 -2
- package/dist/svgMap.js +27 -8
- package/dist/svgMap.min.css +1 -1
- package/dist/svgMap.min.js +1 -1
- package/package.json +1 -1
- package/src/js/svgMap.js +27 -8
- package/src/scss/map.scss +18 -2
- package/src/scss/variables.scss +1 -0
package/README.md
CHANGED
|
@@ -85,6 +85,8 @@ You can pass the following options into svgMap:
|
|
|
85
85
|
| `showContinentSelector` | `boolean` | `false` | Show continent selector |
|
|
86
86
|
| `zoomScaleSensitivity` | `float` | `0.2` | Sensitivity when zooming |
|
|
87
87
|
| `showZoomReset` | `boolean` | `false` | Show zoom reset button |
|
|
88
|
+
| `resetZoomOnResize` | `boolean` | `false` | Reset map zoom on resize |
|
|
89
|
+
| `zoomButtonsPosition` | `string` | `'bottomLeft'` | Position of the zoom buttons. Possible values: `'topLeft'`, `'topRight'`, `'bottomLeft'`, `'bottomRight'` |
|
|
88
90
|
| `mouseWheelZoomEnabled` | `boolean` | `true` | Enables or disables zooming with the scroll wheel |
|
|
89
91
|
| `mouseWheelZoomWithKey` | `boolean` | `false` | Allow zooming only when one of the following keys is pressed: SHIFT, CONTROL, ALT, COMMAND, OPTION |
|
|
90
92
|
| `mouseWheelKeyMessage` | `string` | `'Press the [ALT] key to zoom'` | The message when trying to scroll without a key |
|
|
@@ -72,6 +72,7 @@
|
|
|
72
72
|
"version": "7.18.6",
|
|
73
73
|
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.18.6.tgz",
|
|
74
74
|
"integrity": "sha512-cQbWBpxcbbs/IUredIPkHiAGULLV8iwgNRMFzvbhEXISp4f3rUUXE5+TIw6KwUWUR3DwyI6gmBRnmAtYaWehwQ==",
|
|
75
|
+
"peer": true,
|
|
75
76
|
"dependencies": {
|
|
76
77
|
"@ampproject/remapping": "^2.1.0",
|
|
77
78
|
"@babel/code-frame": "^7.18.6",
|
|
@@ -911,6 +912,7 @@
|
|
|
911
912
|
"version": "7.18.6",
|
|
912
913
|
"resolved": "https://registry.npmjs.org/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.18.6.tgz",
|
|
913
914
|
"integrity": "sha512-LUbR+KNTBWCUAqRG9ex5Gnzu2IOkt8jRJbHHXFT9q+L9zm7M/QQbEqXyw1n1pohYvOyWC8CjeyjrSaIwiYjK7A==",
|
|
915
|
+
"peer": true,
|
|
914
916
|
"dependencies": {
|
|
915
917
|
"@babel/helper-plugin-utils": "^7.18.6"
|
|
916
918
|
},
|
|
@@ -1473,6 +1475,7 @@
|
|
|
1473
1475
|
"version": "7.18.6",
|
|
1474
1476
|
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.18.6.tgz",
|
|
1475
1477
|
"integrity": "sha512-Mz7xMPxoy9kPS/JScj6fJs03TZ/fZ1dJPlMjRAgTaxaS0fUBk8FV/A2rRgfPsVCZqALNwMexD+0Uaf5zlcKPpw==",
|
|
1478
|
+
"peer": true,
|
|
1476
1479
|
"dependencies": {
|
|
1477
1480
|
"@babel/helper-annotate-as-pure": "^7.18.6",
|
|
1478
1481
|
"@babel/helper-module-imports": "^7.18.6",
|
|
@@ -2275,9 +2278,10 @@
|
|
|
2275
2278
|
}
|
|
2276
2279
|
},
|
|
2277
2280
|
"node_modules/@eslint/eslintrc/node_modules/js-yaml": {
|
|
2278
|
-
"version": "4.1.
|
|
2279
|
-
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.
|
|
2280
|
-
"integrity": "sha512-
|
|
2281
|
+
"version": "4.1.1",
|
|
2282
|
+
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz",
|
|
2283
|
+
"integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==",
|
|
2284
|
+
"license": "MIT",
|
|
2281
2285
|
"dependencies": {
|
|
2282
2286
|
"argparse": "^2.0.1"
|
|
2283
2287
|
},
|
|
@@ -4160,6 +4164,7 @@
|
|
|
4160
4164
|
"version": "5.30.5",
|
|
4161
4165
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.30.5.tgz",
|
|
4162
4166
|
"integrity": "sha512-lftkqRoBvc28VFXEoRgyZuztyVUQ04JvUnATSPtIRFAccbXTWL6DEtXGYMcbg998kXw1NLUJm7rTQ9eUt+q6Ig==",
|
|
4167
|
+
"peer": true,
|
|
4163
4168
|
"dependencies": {
|
|
4164
4169
|
"@typescript-eslint/scope-manager": "5.30.5",
|
|
4165
4170
|
"@typescript-eslint/type-utils": "5.30.5",
|
|
@@ -4210,6 +4215,7 @@
|
|
|
4210
4215
|
"version": "5.30.5",
|
|
4211
4216
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.30.5.tgz",
|
|
4212
4217
|
"integrity": "sha512-zj251pcPXI8GO9NDKWWmygP6+UjwWmrdf9qMW/L/uQJBM/0XbU2inxe5io/234y/RCvwpKEYjZ6c1YrXERkK4Q==",
|
|
4218
|
+
"peer": true,
|
|
4213
4219
|
"dependencies": {
|
|
4214
4220
|
"@typescript-eslint/scope-manager": "5.30.5",
|
|
4215
4221
|
"@typescript-eslint/types": "5.30.5",
|
|
@@ -4402,6 +4408,7 @@
|
|
|
4402
4408
|
"version": "8.7.1",
|
|
4403
4409
|
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz",
|
|
4404
4410
|
"integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==",
|
|
4411
|
+
"peer": true,
|
|
4405
4412
|
"bin": {
|
|
4406
4413
|
"acorn": "bin/acorn"
|
|
4407
4414
|
},
|
|
@@ -4510,6 +4517,7 @@
|
|
|
4510
4517
|
"resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz",
|
|
4511
4518
|
"integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==",
|
|
4512
4519
|
"license": "MIT",
|
|
4520
|
+
"peer": true,
|
|
4513
4521
|
"dependencies": {
|
|
4514
4522
|
"fast-deep-equal": "^3.1.3",
|
|
4515
4523
|
"fast-uri": "^3.0.1",
|
|
@@ -4928,6 +4936,7 @@
|
|
|
4928
4936
|
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
|
|
4929
4937
|
"integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
|
|
4930
4938
|
"license": "MIT",
|
|
4939
|
+
"peer": true,
|
|
4931
4940
|
"dependencies": {
|
|
4932
4941
|
"fast-deep-equal": "^3.1.1",
|
|
4933
4942
|
"fast-json-stable-stringify": "^2.0.0",
|
|
@@ -5300,6 +5309,7 @@
|
|
|
5300
5309
|
}
|
|
5301
5310
|
],
|
|
5302
5311
|
"license": "MIT",
|
|
5312
|
+
"peer": true,
|
|
5303
5313
|
"dependencies": {
|
|
5304
5314
|
"caniuse-lite": "^1.0.30001733",
|
|
5305
5315
|
"electron-to-chromium": "^1.5.199",
|
|
@@ -6929,6 +6939,7 @@
|
|
|
6929
6939
|
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.19.0.tgz",
|
|
6930
6940
|
"integrity": "sha512-SXOPj3x9VKvPe81TjjUJCYlV4oJjQw68Uek+AM0X4p+33dj2HY5bpTZOgnQHcG2eAm1mtCU9uNMnJi7exU/kYw==",
|
|
6931
6941
|
"deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.",
|
|
6942
|
+
"peer": true,
|
|
6932
6943
|
"dependencies": {
|
|
6933
6944
|
"@eslint/eslintrc": "^1.3.0",
|
|
6934
6945
|
"@humanwhocodes/config-array": "^0.9.2",
|
|
@@ -7534,9 +7545,10 @@
|
|
|
7534
7545
|
}
|
|
7535
7546
|
},
|
|
7536
7547
|
"node_modules/eslint/node_modules/js-yaml": {
|
|
7537
|
-
"version": "4.1.
|
|
7538
|
-
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.
|
|
7539
|
-
"integrity": "sha512-
|
|
7548
|
+
"version": "4.1.1",
|
|
7549
|
+
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz",
|
|
7550
|
+
"integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==",
|
|
7551
|
+
"license": "MIT",
|
|
7540
7552
|
"dependencies": {
|
|
7541
7553
|
"argparse": "^2.0.1"
|
|
7542
7554
|
},
|
|
@@ -8071,6 +8083,7 @@
|
|
|
8071
8083
|
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
|
|
8072
8084
|
"integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
|
|
8073
8085
|
"license": "MIT",
|
|
8086
|
+
"peer": true,
|
|
8074
8087
|
"dependencies": {
|
|
8075
8088
|
"fast-deep-equal": "^3.1.1",
|
|
8076
8089
|
"fast-json-stable-stringify": "^2.0.0",
|
|
@@ -11423,9 +11436,10 @@
|
|
|
11423
11436
|
"integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="
|
|
11424
11437
|
},
|
|
11425
11438
|
"node_modules/js-yaml": {
|
|
11426
|
-
"version": "3.14.
|
|
11427
|
-
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.
|
|
11428
|
-
"integrity": "sha512-
|
|
11439
|
+
"version": "3.14.2",
|
|
11440
|
+
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.2.tgz",
|
|
11441
|
+
"integrity": "sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==",
|
|
11442
|
+
"license": "MIT",
|
|
11429
11443
|
"dependencies": {
|
|
11430
11444
|
"argparse": "^1.0.7",
|
|
11431
11445
|
"esprima": "^4.0.0"
|
|
@@ -12035,9 +12049,9 @@
|
|
|
12035
12049
|
"integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ=="
|
|
12036
12050
|
},
|
|
12037
12051
|
"node_modules/node-forge": {
|
|
12038
|
-
"version": "1.3.
|
|
12039
|
-
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.
|
|
12040
|
-
"integrity": "sha512-
|
|
12052
|
+
"version": "1.3.2",
|
|
12053
|
+
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.2.tgz",
|
|
12054
|
+
"integrity": "sha512-6xKiQ+cph9KImrRh0VsjH2d8/GXA4FIMlgU4B757iI1ApvcyA9VlouP0yZJha01V+huImO+kKMU7ih+2+E14fw==",
|
|
12041
12055
|
"license": "(BSD-3-Clause OR GPL-2.0)",
|
|
12042
12056
|
"engines": {
|
|
12043
12057
|
"node": ">= 6.13.0"
|
|
@@ -12644,6 +12658,7 @@
|
|
|
12644
12658
|
}
|
|
12645
12659
|
],
|
|
12646
12660
|
"license": "MIT",
|
|
12661
|
+
"peer": true,
|
|
12647
12662
|
"dependencies": {
|
|
12648
12663
|
"nanoid": "^3.3.11",
|
|
12649
12664
|
"picocolors": "^1.1.1",
|
|
@@ -13709,6 +13724,7 @@
|
|
|
13709
13724
|
"version": "6.0.10",
|
|
13710
13725
|
"resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.10.tgz",
|
|
13711
13726
|
"integrity": "sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w==",
|
|
13727
|
+
"peer": true,
|
|
13712
13728
|
"dependencies": {
|
|
13713
13729
|
"cssesc": "^3.0.0",
|
|
13714
13730
|
"util-deprecate": "^1.0.2"
|
|
@@ -14142,6 +14158,7 @@
|
|
|
14142
14158
|
"version": "18.2.0",
|
|
14143
14159
|
"resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz",
|
|
14144
14160
|
"integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==",
|
|
14161
|
+
"peer": true,
|
|
14145
14162
|
"dependencies": {
|
|
14146
14163
|
"loose-envify": "^1.1.0"
|
|
14147
14164
|
},
|
|
@@ -14286,6 +14303,7 @@
|
|
|
14286
14303
|
"version": "18.2.0",
|
|
14287
14304
|
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz",
|
|
14288
14305
|
"integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==",
|
|
14306
|
+
"peer": true,
|
|
14289
14307
|
"dependencies": {
|
|
14290
14308
|
"loose-envify": "^1.1.0",
|
|
14291
14309
|
"scheduler": "^0.23.0"
|
|
@@ -14308,6 +14326,7 @@
|
|
|
14308
14326
|
"version": "0.11.0",
|
|
14309
14327
|
"resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.11.0.tgz",
|
|
14310
14328
|
"integrity": "sha512-F27qZr8uUqwhWZboondsPx8tnC3Ct3SxZA3V5WyEvujRyyNv0VYPhoBg1gZ8/MV5tubQp76Trw8lTv9hzRBa+A==",
|
|
14329
|
+
"peer": true,
|
|
14311
14330
|
"engines": {
|
|
14312
14331
|
"node": ">=0.10.0"
|
|
14313
14332
|
}
|
|
@@ -14799,6 +14818,7 @@
|
|
|
14799
14818
|
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.2.tgz",
|
|
14800
14819
|
"integrity": "sha512-fS6iqSPZDs3dr/y7Od6y5nha8dW1YnbgtsyotCVvoFGKbERG++CVRFv1meyGDE1SNItQA8BrnCw7ScdAhRJ3XQ==",
|
|
14801
14820
|
"license": "MIT",
|
|
14821
|
+
"peer": true,
|
|
14802
14822
|
"bin": {
|
|
14803
14823
|
"rollup": "dist/bin/rollup"
|
|
14804
14824
|
},
|
|
@@ -14984,6 +15004,7 @@
|
|
|
14984
15004
|
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
|
|
14985
15005
|
"integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
|
|
14986
15006
|
"license": "MIT",
|
|
15007
|
+
"peer": true,
|
|
14987
15008
|
"dependencies": {
|
|
14988
15009
|
"fast-deep-equal": "^3.1.1",
|
|
14989
15010
|
"fast-json-stable-stringify": "^2.0.0",
|
|
@@ -16049,6 +16070,7 @@
|
|
|
16049
16070
|
"version": "0.20.2",
|
|
16050
16071
|
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz",
|
|
16051
16072
|
"integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==",
|
|
16073
|
+
"peer": true,
|
|
16052
16074
|
"engines": {
|
|
16053
16075
|
"node": ">=10"
|
|
16054
16076
|
},
|
|
@@ -16348,6 +16370,7 @@
|
|
|
16348
16370
|
"version": "5.94.0",
|
|
16349
16371
|
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.94.0.tgz",
|
|
16350
16372
|
"integrity": "sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg==",
|
|
16373
|
+
"peer": true,
|
|
16351
16374
|
"dependencies": {
|
|
16352
16375
|
"@types/estree": "^1.0.5",
|
|
16353
16376
|
"@webassemblyjs/ast": "^1.12.1",
|
|
@@ -16434,6 +16457,7 @@
|
|
|
16434
16457
|
"resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-4.15.2.tgz",
|
|
16435
16458
|
"integrity": "sha512-0XavAZbNJ5sDrCbkpWL8mia0o5WPOd2YGtxrEiZkBK9FjLppIUK2TgxK6qGD2P3hUXTJNNPVibrerKcx5WkR1g==",
|
|
16436
16459
|
"license": "MIT",
|
|
16460
|
+
"peer": true,
|
|
16437
16461
|
"dependencies": {
|
|
16438
16462
|
"@types/bonjour": "^3.5.9",
|
|
16439
16463
|
"@types/connect-history-api-fallback": "^1.3.5",
|
|
@@ -16750,6 +16774,7 @@
|
|
|
16750
16774
|
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
|
|
16751
16775
|
"integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
|
|
16752
16776
|
"license": "MIT",
|
|
16777
|
+
"peer": true,
|
|
16753
16778
|
"dependencies": {
|
|
16754
16779
|
"fast-deep-equal": "^3.1.1",
|
|
16755
16780
|
"fast-json-stable-stringify": "^2.0.0",
|
package/dist/svgMap.css
CHANGED
|
@@ -63,14 +63,28 @@
|
|
|
63
63
|
}
|
|
64
64
|
.svgMap-map-wrapper .svgMap-map-controls-wrapper {
|
|
65
65
|
position: absolute;
|
|
66
|
-
bottom: 10px;
|
|
67
|
-
left: 10px;
|
|
68
66
|
z-index: 1;
|
|
69
67
|
display: flex;
|
|
70
68
|
overflow: hidden;
|
|
71
69
|
border-radius: 2px;
|
|
72
70
|
box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
|
|
73
71
|
}
|
|
72
|
+
.svgMap-map-wrapper .svgMap-map-controls-wrapper.svgMap-controls-position-bottomLeft {
|
|
73
|
+
bottom: 10px;
|
|
74
|
+
left: 10px;
|
|
75
|
+
}
|
|
76
|
+
.svgMap-map-wrapper .svgMap-map-controls-wrapper.svgMap-controls-position-bottomRight {
|
|
77
|
+
bottom: 10px;
|
|
78
|
+
right: 10px;
|
|
79
|
+
}
|
|
80
|
+
.svgMap-map-wrapper .svgMap-map-controls-wrapper.svgMap-controls-position-topLeft {
|
|
81
|
+
top: 10px;
|
|
82
|
+
left: 10px;
|
|
83
|
+
}
|
|
84
|
+
.svgMap-map-wrapper .svgMap-map-controls-wrapper.svgMap-controls-position-topRight {
|
|
85
|
+
top: 10px;
|
|
86
|
+
right: 10px;
|
|
87
|
+
}
|
|
74
88
|
.svgMap-map-wrapper .svgMap-map-controls-wrapper.svgMap-disabled {
|
|
75
89
|
display: none;
|
|
76
90
|
}
|
|
@@ -166,6 +180,7 @@
|
|
|
166
180
|
box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
|
|
167
181
|
}
|
|
168
182
|
.svgMap-map-wrapper .svgMap-country {
|
|
183
|
+
fill: #E2E2E2;
|
|
169
184
|
stroke: #fff;
|
|
170
185
|
stroke-width: 1;
|
|
171
186
|
stroke-linejoin: round;
|
package/dist/svgMap.js
CHANGED
|
@@ -46,6 +46,9 @@ function svgMapWrapper(svgPanZoom) {
|
|
|
46
46
|
// The message to show for MacOS
|
|
47
47
|
mouseWheelKeyMessageMac: 'Press the [COMMAND] key to zoom',
|
|
48
48
|
|
|
49
|
+
// Position of the zoom buttons
|
|
50
|
+
zoomButtonsPosition: 'bottomLeft',
|
|
51
|
+
|
|
49
52
|
// Data colors
|
|
50
53
|
colorMax: '#CC0033',
|
|
51
54
|
colorMin: '#FFE5D9',
|
|
@@ -89,6 +92,9 @@ function svgMapWrapper(svgPanZoom) {
|
|
|
89
92
|
|
|
90
93
|
// Set to true to show a drop down menu with the continents
|
|
91
94
|
showContinentSelector: false,
|
|
95
|
+
|
|
96
|
+
// Reset zoom on resize
|
|
97
|
+
resetZoomOnResize: false,
|
|
92
98
|
};
|
|
93
99
|
|
|
94
100
|
this.options = Object.assign({}, defaultOptions, options || {});
|
|
@@ -406,9 +412,9 @@ function svgMapWrapper(svgPanZoom) {
|
|
|
406
412
|
});
|
|
407
413
|
|
|
408
414
|
data.data[data.applyData].thresholdMax &&
|
|
409
|
-
|
|
415
|
+
(max = Math.min(max, data.data[data.applyData].thresholdMax));
|
|
410
416
|
data.data[data.applyData].thresholdMin &&
|
|
411
|
-
|
|
417
|
+
(min = Math.max(min, data.data[data.applyData].thresholdMin));
|
|
412
418
|
|
|
413
419
|
// Loop through countries and set colors
|
|
414
420
|
Object.keys(this.countries).forEach(
|
|
@@ -810,6 +816,7 @@ function svgMapWrapper(svgPanZoom) {
|
|
|
810
816
|
'svgMap-map-controls-wrapper',
|
|
811
817
|
this.mapWrapper
|
|
812
818
|
);
|
|
819
|
+
mapControlsWrapper.classList.add('svgMap-controls-position-' + this.options.zoomButtonsPosition);
|
|
813
820
|
var zoomContainer = this.createElement(
|
|
814
821
|
'div',
|
|
815
822
|
'svgMap-map-controls-zoom',
|
|
@@ -1098,6 +1105,12 @@ function svgMapWrapper(svgPanZoom) {
|
|
|
1098
1105
|
|
|
1099
1106
|
// Initial zoom statuses
|
|
1100
1107
|
this.setControlStatuses();
|
|
1108
|
+
|
|
1109
|
+
// Zoom reset on resize
|
|
1110
|
+
if (this.options.resetZoomOnResize) {
|
|
1111
|
+
const resizeObserver = new ResizeObserver(() => this.mapReset());
|
|
1112
|
+
resizeObserver.observe(this.mapWrapper);
|
|
1113
|
+
}
|
|
1101
1114
|
};
|
|
1102
1115
|
|
|
1103
1116
|
// Create the tooltip content
|
|
@@ -1172,7 +1185,7 @@ function svgMapWrapper(svgPanZoom) {
|
|
|
1172
1185
|
if ((value !== undefined && this.options.hideMissingData === true) || this.options.hideMissingData === false) {
|
|
1173
1186
|
item.floatingNumbers && (value = value.toFixed(1));
|
|
1174
1187
|
item.thousandSeparator &&
|
|
1175
|
-
|
|
1188
|
+
(value = this.numberWithCommas(value, item.thousandSeparator));
|
|
1176
1189
|
value = item.format
|
|
1177
1190
|
? item.format.replace('{0}', '<span>' + value + '</span>')
|
|
1178
1191
|
: '<span>' + value + '</span>';
|
|
@@ -1218,8 +1231,8 @@ function svgMapWrapper(svgPanZoom) {
|
|
|
1218
1231
|
svgMap.prototype.zoomMap = function (direction) {
|
|
1219
1232
|
if (
|
|
1220
1233
|
this[
|
|
1221
|
-
|
|
1222
|
-
|
|
1234
|
+
'zoomControl' + direction.charAt(0).toUpperCase() + direction.slice(1)
|
|
1235
|
+
].classList.contains('svgMap-disabled')
|
|
1223
1236
|
) {
|
|
1224
1237
|
return false;
|
|
1225
1238
|
}
|
|
@@ -1240,6 +1253,12 @@ function svgMapWrapper(svgPanZoom) {
|
|
|
1240
1253
|
}
|
|
1241
1254
|
};
|
|
1242
1255
|
|
|
1256
|
+
// Zoom reset
|
|
1257
|
+
svgMap.prototype.mapReset = function () {
|
|
1258
|
+
this.mapPanZoom.resize()
|
|
1259
|
+
this.zoomMap('reset')
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1243
1262
|
// Zoom to Contient
|
|
1244
1263
|
|
|
1245
1264
|
svgMap.prototype.zoomContinent = function (contientIso) {
|
|
@@ -1276,7 +1295,7 @@ function svgMapWrapper(svgPanZoom) {
|
|
|
1276
1295
|
}
|
|
1277
1296
|
|
|
1278
1297
|
this.autoHideMouseWheelNoticeTimeout &&
|
|
1279
|
-
|
|
1298
|
+
clearTimeout(this.autoHideMouseWheelNoticeTimeout);
|
|
1280
1299
|
this.autoHideMouseWheelNoticeTimeout = setTimeout(
|
|
1281
1300
|
function () {
|
|
1282
1301
|
this.hideMouseWheelZoomNotice();
|
|
@@ -1292,7 +1311,7 @@ function svgMapWrapper(svgPanZoom) {
|
|
|
1292
1311
|
svgMap.prototype.hideMouseWheelZoomNotice = function () {
|
|
1293
1312
|
this.wrapper.classList.remove('svgMap-block-zoom-notice-active');
|
|
1294
1313
|
this.autoHideMouseWheelNoticeTimeout &&
|
|
1295
|
-
|
|
1314
|
+
clearTimeout(this.autoHideMouseWheelNoticeTimeout);
|
|
1296
1315
|
};
|
|
1297
1316
|
|
|
1298
1317
|
// Block shing the zoom wheel notice for some time
|
|
@@ -1300,7 +1319,7 @@ function svgMapWrapper(svgPanZoom) {
|
|
|
1300
1319
|
svgMap.prototype.blockMouseWheelZoomNotice = function (duration) {
|
|
1301
1320
|
this.mouseWheelNoticeJustHidden = true;
|
|
1302
1321
|
this.mouseWheelNoticeJustHiddenTimeout &&
|
|
1303
|
-
|
|
1322
|
+
clearTimeout(this.mouseWheelNoticeJustHiddenTimeout);
|
|
1304
1323
|
this.mouseWheelNoticeJustHiddenTimeout = setTimeout(
|
|
1305
1324
|
function () {
|
|
1306
1325
|
this.mouseWheelNoticeJustHidden = false;
|
package/dist/svgMap.min.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! svgMap | https://github.com/StephanWagner/svgMap | MIT License | Copyright Stephan Wagner | https://stephanwagner.me */
|
|
2
|
-
.svgMap-container,.svgMap-wrapper{position:relative}.svgMap-block-zoom-notice{position:absolute;z-index:2;top:100%;left:0;right:0;bottom:0;background:rgba(0,0,0,.8);pointer-events:none;opacity:0;color:#fff;transition:opacity 250ms}.svgMap-block-zoom-notice-active .svgMap-block-zoom-notice{pointer-events:all;top:0;opacity:1}.svgMap-block-zoom-notice>div{position:absolute;top:50%;left:0;right:0;text-align:center;padding:0 32px;transform:translateY(-50%);font-size:28px}@media (max-width:900px){.svgMap-block-zoom-notice>div{font-size:22px}}.svgMap-map-wrapper{position:relative;width:100%;padding-top:50%;overflow:hidden;background:#d9ecff;color:#111}.svgMap-map-wrapper *{box-sizing:border-box}.svgMap-map-wrapper :focus:not(:focus-visible){outline:0}.svgMap-map-wrapper .svgMap-map-image{display:block;position:absolute;top:0;left:0;width:100%;height:100%;margin:0}.svgMap-map-wrapper .svgMap-map-controls-wrapper{position:absolute;
|
|
2
|
+
.svgMap-container,.svgMap-wrapper{position:relative}.svgMap-block-zoom-notice{position:absolute;z-index:2;top:100%;left:0;right:0;bottom:0;background:rgba(0,0,0,.8);pointer-events:none;opacity:0;color:#fff;transition:opacity 250ms}.svgMap-block-zoom-notice-active .svgMap-block-zoom-notice{pointer-events:all;top:0;opacity:1}.svgMap-block-zoom-notice>div{position:absolute;top:50%;left:0;right:0;text-align:center;padding:0 32px;transform:translateY(-50%);font-size:28px}@media (max-width:900px){.svgMap-block-zoom-notice>div{font-size:22px}}.svgMap-map-wrapper{position:relative;width:100%;padding-top:50%;overflow:hidden;background:#d9ecff;color:#111}.svgMap-map-wrapper *{box-sizing:border-box}.svgMap-map-wrapper :focus:not(:focus-visible){outline:0}.svgMap-map-wrapper .svgMap-map-image{display:block;position:absolute;top:0;left:0;width:100%;height:100%;margin:0}.svgMap-map-wrapper .svgMap-map-controls-wrapper{position:absolute;z-index:1;display:flex;overflow:hidden;border-radius:2px;box-shadow:0 0 0 2px rgba(0,0,0,.1)}.svgMap-map-wrapper .svgMap-map-controls-wrapper.svgMap-controls-position-bottomLeft{bottom:10px;left:10px}.svgMap-map-wrapper .svgMap-map-controls-wrapper.svgMap-controls-position-bottomRight{bottom:10px;right:10px}.svgMap-map-wrapper .svgMap-map-controls-wrapper.svgMap-controls-position-topLeft{top:10px;left:10px}.svgMap-map-wrapper .svgMap-map-controls-wrapper.svgMap-controls-position-topRight{top:10px;right:10px}.svgMap-map-wrapper .svgMap-map-controls-wrapper.svgMap-disabled{display:none}.svgMap-map-wrapper .svgMap-map-controls-move,.svgMap-map-wrapper .svgMap-map-controls-zoom{display:flex;margin-right:5px;overflow:hidden;background:#fff}.svgMap-map-wrapper .svgMap-map-controls-move:last-child,.svgMap-map-wrapper .svgMap-map-controls-zoom:last-child{margin-right:0}.svgMap-map-wrapper .svgMap-control-button{background-color:#fff;border:none;border-radius:0;color:#fff;font:inherit;line-height:inherit;margin:0;padding:0;overflow:visible;text-transform:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;width:32px;height:32px;position:relative}.svgMap-map-wrapper .svgMap-control-button.svgMap-zoom-button::after,.svgMap-map-wrapper .svgMap-control-button.svgMap-zoom-button::before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);background:#ccc;transition:background-color 250ms}.svgMap-map-wrapper .svgMap-control-button.svgMap-zoom-button::before{width:11px;height:3px}@media (hover:hover){.svgMap-map-wrapper .svgMap-control-button.svgMap-zoom-button:hover::after,.svgMap-map-wrapper .svgMap-control-button.svgMap-zoom-button:hover::before{background:#000}}.svgMap-map-wrapper .svgMap-control-button.svgMap-zoom-button:active::after,.svgMap-map-wrapper .svgMap-control-button.svgMap-zoom-button:active::before{background:#000}.svgMap-map-wrapper .svgMap-control-button.svgMap-zoom-button.svgMap-zoom-reset-button::before{width:11px;height:11px;background:0 0;border:2px solid #ccc;transition:border-color 250ms}@media (hover:hover){.svgMap-map-wrapper .svgMap-control-button.svgMap-zoom-button.svgMap-zoom-reset-button:hover::before{background:0 0;border-color:#000}}.svgMap-map-wrapper .svgMap-control-button.svgMap-zoom-button.svgMap-zoom-reset-button:active::before{background:0 0;border-color:#000}.svgMap-map-wrapper .svgMap-control-button.svgMap-zoom-button.svgMap-disabled::after,.svgMap-map-wrapper .svgMap-control-button.svgMap-zoom-button.svgMap-disabled::before{background:#eee}.svgMap-map-wrapper .svgMap-control-button.svgMap-zoom-button.svgMap-zoom-reset-button.svgMap-disabled{cursor:default}.svgMap-map-wrapper .svgMap-control-button.svgMap-zoom-button.svgMap-zoom-reset-button.svgMap-disabled::before{border:2px solid #eee;background:0 0}.svgMap-map-wrapper .svgMap-control-button.svgMap-zoom-in-button::after{width:3px;height:11px}.svgMap-map-wrapper .svgMap-map-continent-controls-wrapper{position:absolute;top:10px;right:10px;z-index:1;display:flex;border-radius:2px;box-shadow:0 0 0 2px rgba(0,0,0,.1)}.svgMap-map-wrapper .svgMap-country{fill:#e2e2e2;stroke:#fff;stroke-width:1;stroke-linejoin:round;vector-effect:non-scaling-stroke;transition:fill 250ms,stroke 250ms}.svgMap-map-wrapper .svgMap-country[data-link]{cursor:pointer}@media (hover:hover){.svgMap-map-wrapper .svgMap-country:hover{stroke:#333;stroke-width:1.5}}.svgMap-map-wrapper .svgMap-country.svgMap-active{stroke:#333;stroke-width:1.5}.svgMap-tooltip{box-shadow:0 0 3px rgba(0,0,0,.2);position:absolute;z-index:2;border-radius:2px;background:#fff;transform:translate(-50%,-100%);border-bottom:1px solid #111;display:none;pointer-events:none;min-width:60px}.svgMap-tooltip.svgMap-tooltip-flipped{transform:translate(-50%,0);border-bottom:0;border-top:1px solid #111}.svgMap-tooltip.svgMap-active{display:block}.svgMap-tooltip .svgMap-tooltip-content-container{position:relative;padding:10px 20px}.svgMap-tooltip .svgMap-tooltip-content-container .svgMap-tooltip-flag-container{text-align:center;margin:2px 0 5px}.svgMap-tooltip .svgMap-tooltip-content-container .svgMap-tooltip-flag-container.svgMap-tooltip-flag-container-emoji{font-size:50px;line-height:0;padding:25px 0 15px}.svgMap-tooltip .svgMap-tooltip-content-container .svgMap-tooltip-flag-container .svgMap-tooltip-flag{display:block;margin:auto;width:auto;height:32px;padding:2px;background:rgba(0,0,0,.15);border-radius:2px}.svgMap-tooltip .svgMap-tooltip-title{white-space:nowrap;font-size:18px;line-height:28px;padding:0 0 8px;text-align:center}.svgMap-tooltip .svgMap-tooltip-content{white-space:nowrap;text-align:center;font-size:14px;color:#777;margin:-5px 0 0}.svgMap-tooltip .svgMap-tooltip-content table{padding:0;border-spacing:0;margin:auto}.svgMap-tooltip .svgMap-tooltip-content table td{padding:2px 0;text-align:left}.svgMap-tooltip .svgMap-tooltip-content table td span{color:#111}.svgMap-tooltip .svgMap-tooltip-content table td:first-child{padding-right:10px;text-align:right}.svgMap-tooltip .svgMap-tooltip-content table td sup{vertical-align:baseline;position:relative;top:-5px}.svgMap-tooltip .svgMap-tooltip-content .svgMap-tooltip-no-data{padding:2px 0;color:#777;font-style:italic}.svgMap-tooltip .svgMap-tooltip-pointer{position:absolute;top:100%;left:50%;transform:translateX(-50%);overflow:hidden;height:10px;width:30px}.svgMap-tooltip .svgMap-tooltip-pointer::after{content:"";width:20px;height:20px;background:#fff;border:1px solid #111;position:absolute;bottom:6px;left:50%;transform:translateX(-50%) rotate(45deg)}.svgMap-tooltip.svgMap-tooltip-flipped .svgMap-tooltip-pointer{bottom:auto;top:-10px;transform:translateX(-50%) scaleY(-1)}
|