svgmap 2.7.0 → 2.8.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/LICENSE +1 -1
- package/README.md +15 -13
- package/demo/es6/index.js +6 -0
- package/demo/es6/package-lock.json +32 -16
- package/demo/es6/package.json +1 -1
- package/demo/html/index.html +10 -2
- package/dist/svgMap.css +19 -0
- package/dist/svgMap.js +178 -24
- package/dist/svgMap.min.css +1 -1
- package/dist/svgMap.min.js +1 -1
- package/package.json +3 -3
- package/src/js/svgMap.js +178 -24
- package/src/scss/map.scss +24 -1
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -23,8 +23,8 @@ import 'svgmap/dist/svgMap.min.css';
|
|
|
23
23
|
|
|
24
24
|
```html
|
|
25
25
|
<script src="https://cdn.jsdelivr.net/npm/svg-pan-zoom@3.6.1/dist/svg-pan-zoom.min.js"></script>
|
|
26
|
-
<script src="https://cdn.jsdelivr.net/gh/StephanWagner/svgMap@v2.
|
|
27
|
-
<link href="https://cdn.jsdelivr.net/gh/StephanWagner/svgMap@v2.
|
|
26
|
+
<script src="https://cdn.jsdelivr.net/gh/StephanWagner/svgMap@v2.8.0/dist/svgMap.min.js"></script>
|
|
27
|
+
<link href="https://cdn.jsdelivr.net/gh/StephanWagner/svgMap@v2.8.0/dist/svgMap.min.css" rel="stylesheet">
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
---
|
|
@@ -81,34 +81,36 @@ You can pass the following options into svgMap:
|
|
|
81
81
|
| `maxZoom` | `float` | `25` | Maximal zoom level |
|
|
82
82
|
| `initialZoom` | `float` | `1.06` | Initial zoom level |
|
|
83
83
|
| `initialPan` | `object` | | Initial pan on x and y axis (e.g. `{ x: 30, y: 60 }`) |
|
|
84
|
+
| `showContinentSelector` | `boolean` | `false` | Show continent selector |
|
|
84
85
|
| `zoomScaleSensitivity` | `float` | `0.2` | Sensitivity when zooming |
|
|
86
|
+
| `showZoomReset` | `boolean` | `false` | Show zoom reset button |
|
|
85
87
|
| `mouseWheelZoomEnabled` | `boolean` | `true` | Enables or disables zooming with the scroll wheel |
|
|
86
|
-
| `mouseWheelZoomWithKey` | `boolean` | `false` | Allow zooming only when one of the following keys is pressed:
|
|
87
|
-
| `mouseWheelKeyMessage` | `string` | `'Press the [ALT] key to zoom'` | The message to
|
|
88
|
-
| `mouseWheelKeyMessageMac` | `string ` | `Press the [COMMAND] key to zoom` | The message to
|
|
89
|
-
| `colorMax` | `string` |
|
|
90
|
-
| `colorMin` | `string` |
|
|
91
|
-
| `colorNoData` | `string` |
|
|
88
|
+
| `mouseWheelZoomWithKey` | `boolean` | `false` | Allow zooming only when one of the following keys is pressed: SHIFT, CONTROL, ALT, COMMAND, OPTION |
|
|
89
|
+
| `mouseWheelKeyMessage` | `string` | `'Press the [ALT] key to zoom'` | The message when trying to scroll without a key |
|
|
90
|
+
| `mouseWheelKeyMessageMac` | `string ` | `Press the [COMMAND] key to zoom` | The message when trying to scroll without a key on MacOS |
|
|
91
|
+
| `colorMax` | `string` | `'#CC0033'` | Color for highest value |
|
|
92
|
+
| `colorMin` | `string` | `'#FFE5D9'` | Color for lowest value |
|
|
93
|
+
| `colorNoData` | `string` | `'#E2E2E2'` | Color when there is no data |
|
|
92
94
|
| `flagType` | `'image'`, `'emoji'` | `'image'` | The type of the flag in the tooltip |
|
|
93
|
-
| `flagURL` | `string` | | The URL to the flags when using flag type `image`. The placeholder `{0}` will get replaced with the lowercase [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code. Default: `https://cdn.jsdelivr.net/gh/hjnilsson/country-flags@latest/svg/{0}.svg` |
|
|
95
|
+
| `flagURL` | `string` | | The URL to the flags when using flag type `'image'`. The placeholder `{0}` will get replaced with the lowercase [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code. Default: `'https://cdn.jsdelivr.net/gh/hjnilsson/country-flags@latest/svg/{0}.svg'` |
|
|
94
96
|
| `hideFlag` | `boolean` | `false` | Hide the flag in tooltips |
|
|
95
97
|
| `noDataText` | `string` | `'No data available'` | The text to be shown when no data is present |
|
|
96
|
-
| `touchLink` | `boolean` | `false` | Set to `true` to open the link (see `data.values.link`) on mobile devices
|
|
98
|
+
| `touchLink` | `boolean` | `false` | Set to `true` to open the link (see `data.values.link`) on mobile devices, by default the tooltip will be shown |
|
|
97
99
|
| `onGetTooltip` | `function` | | Called when a tooltip is created to custimize the tooltip content (`function (tooltipDiv, countryID, countryValues) { return 'Custom HTML'; }`) |
|
|
98
100
|
| `countries` | `object` | | Additional options specific to countries: |
|
|
99
101
|
| `↳ EH` | `boolean` | `true` | When set to `false`, Western Sahara (EH) will be combined with Morocco (MA) |
|
|
100
|
-
| `↳ Crimea` | `'UA'`, `'RU'` | `UA` | Crimea: Set to 'RU' to make the Crimea part of Russia, by default it is part of the Ukraine |
|
|
102
|
+
| `↳ Crimea` | `'UA'`, `'RU'` | `'UA'` | Crimea: Set to 'RU' to make the Crimea part of Russia, by default it is part of the Ukraine |
|
|
101
103
|
| `data` | `object` | | The chart data to use for coloring and to show in the tooltip. Use a unique data-id as key and provide following options as value: |
|
|
102
104
|
| `↳ name` | `string` | | The name of the data, it will be shown in the tooltip |
|
|
103
105
|
| `↳ format` | `string` | | The format for the data value, `{0}` will be replaced with the actual value |
|
|
104
|
-
| `↳ thousandSeparator` | `string` |
|
|
106
|
+
| `↳ thousandSeparator` | `string` | `','` | The character to use as thousand separator |
|
|
105
107
|
| `↳ thresholdMax` | `number` | `null` | Maximal value to use for coloring calculations |
|
|
106
108
|
| `↳ thresholdMin` | `number` | `0` | Minimum value to use for coloring calculations |
|
|
107
109
|
| `↳ applyData` | `string` | | The ID (key) of the data that will be used for coloring |
|
|
108
110
|
| `↳ values` | `object` | | An object with the [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code as key and the chart data for each country as value |
|
|
109
111
|
| `↳ color` | `string` | | Forces a color for this country |
|
|
110
112
|
| `↳ link` | `string` | | An URL to redirect to when clicking the country |
|
|
111
|
-
| `↳ linkTarget` | `string` | | The target of the link. By default the link will be opened in the same tab. Use `_blank` to open the link in a new tab |
|
|
113
|
+
| `↳ linkTarget` | `string` | | The target of the link. By default the link will be opened in the same tab. Use `'_blank'` to open the link in a new tab |
|
|
112
114
|
| `countryNames` | `object` | | An object with the [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code as key and the country name as value |
|
|
113
115
|
|
|
114
116
|
---
|
package/demo/es6/index.js
CHANGED
|
@@ -109,6 +109,12 @@ var svgMapEuroCurrency = new svgMap({
|
|
|
109
109
|
|
|
110
110
|
// Fill content
|
|
111
111
|
var innerHTML =
|
|
112
|
+
'<div style="margin: 0 0 10px; text-align: center"><img src="https://cdn.jsdelivr.net/gh/hjnilsson/country-flags@latest/svg/{0}.svg" alt="" style="height: 40px; width: auto; border: 2px solid #eee"></div>'.replace(
|
|
113
|
+
'{0}',
|
|
114
|
+
countryID.toLowerCase()
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
innerHTML +=
|
|
112
118
|
'<div style="min-width: 180px; font-weight: bold; margin: 0 0 15px; text-align: center">' +
|
|
113
119
|
countries[countryID] +
|
|
114
120
|
'</div>';
|
|
@@ -346,6 +346,18 @@
|
|
|
346
346
|
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
|
|
347
347
|
"dev": true
|
|
348
348
|
},
|
|
349
|
+
"acorn": {
|
|
350
|
+
"version": "8.7.0",
|
|
351
|
+
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz",
|
|
352
|
+
"integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==",
|
|
353
|
+
"dev": true
|
|
354
|
+
},
|
|
355
|
+
"acorn-walk": {
|
|
356
|
+
"version": "8.2.0",
|
|
357
|
+
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz",
|
|
358
|
+
"integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==",
|
|
359
|
+
"dev": true
|
|
360
|
+
},
|
|
349
361
|
"address": {
|
|
350
362
|
"version": "1.1.2",
|
|
351
363
|
"resolved": "https://registry.npmjs.org/address/-/address-1.1.2.tgz",
|
|
@@ -2039,9 +2051,9 @@
|
|
|
2039
2051
|
}
|
|
2040
2052
|
},
|
|
2041
2053
|
"minimist": {
|
|
2042
|
-
"version": "1.2.
|
|
2043
|
-
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.
|
|
2044
|
-
"integrity": "sha512-
|
|
2054
|
+
"version": "1.2.6",
|
|
2055
|
+
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
|
|
2056
|
+
"integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==",
|
|
2045
2057
|
"dev": true
|
|
2046
2058
|
},
|
|
2047
2059
|
"minipass": {
|
|
@@ -2145,9 +2157,9 @@
|
|
|
2145
2157
|
"dev": true
|
|
2146
2158
|
},
|
|
2147
2159
|
"nanoid": {
|
|
2148
|
-
"version": "3.
|
|
2149
|
-
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.
|
|
2150
|
-
"integrity": "sha512-
|
|
2160
|
+
"version": "3.2.0",
|
|
2161
|
+
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.2.0.tgz",
|
|
2162
|
+
"integrity": "sha512-fmsZYa9lpn69Ad5eDn7FMcnnSR+8R34W9qJEijxYhTbfOWzr22n1QxCMzXLK+ODyW2973V3Fux959iQoUxzUIA==",
|
|
2151
2163
|
"dev": true
|
|
2152
2164
|
},
|
|
2153
2165
|
"negotiator": {
|
|
@@ -2296,9 +2308,9 @@
|
|
|
2296
2308
|
}
|
|
2297
2309
|
},
|
|
2298
2310
|
"nth-check": {
|
|
2299
|
-
"version": "2.0.
|
|
2300
|
-
"resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.0.
|
|
2301
|
-
"integrity": "sha512-
|
|
2311
|
+
"version": "2.0.1",
|
|
2312
|
+
"resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.0.1.tgz",
|
|
2313
|
+
"integrity": "sha512-it1vE95zF6dTT9lBsYbxvqh0Soy4SPowchj0UBGj/V6cTPnXXtQOPUbhZ6CmGzAD/rW22LQK6E96pcdJXk4A4w==",
|
|
2302
2314
|
"dev": true,
|
|
2303
2315
|
"requires": {
|
|
2304
2316
|
"boolbase": "^1.0.0"
|
|
@@ -3164,9 +3176,9 @@
|
|
|
3164
3176
|
"integrity": "sha512-JaKkGHHfGvRrcMPdJWkssLBeWqM+Isg/a09H7kgNNajT1cX5AztDTNs+C8UzpCxjCTRrG34WbquwaovZbmSk9g=="
|
|
3165
3177
|
},
|
|
3166
3178
|
"svgmap": {
|
|
3167
|
-
"version": "2.
|
|
3168
|
-
"resolved": "https://registry.npmjs.org/svgmap/-/svgmap-2.
|
|
3169
|
-
"integrity": "sha512-
|
|
3179
|
+
"version": "2.7.0",
|
|
3180
|
+
"resolved": "https://registry.npmjs.org/svgmap/-/svgmap-2.7.0.tgz",
|
|
3181
|
+
"integrity": "sha512-v/8xrRQXWwMaoRvV6tEy1hgmc2YW/DEVN7TzmbUH1beVHjB8tzTixs90ZRciKDUPcD/SeM+ItCgHca5VSdN85Q==",
|
|
3170
3182
|
"requires": {
|
|
3171
3183
|
"svg-pan-zoom": "^3.6.1"
|
|
3172
3184
|
}
|
|
@@ -3335,10 +3347,14 @@
|
|
|
3335
3347
|
}
|
|
3336
3348
|
},
|
|
3337
3349
|
"vm2": {
|
|
3338
|
-
"version": "3.9.
|
|
3339
|
-
"resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.
|
|
3340
|
-
"integrity": "sha512-
|
|
3341
|
-
"dev": true
|
|
3350
|
+
"version": "3.9.7",
|
|
3351
|
+
"resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.7.tgz",
|
|
3352
|
+
"integrity": "sha512-g/GZ7V0Mlmch3eDVOATvAXr1GsJNg6kQ5PjvYy3HbJMCRn5slNbo/u73Uy7r5yUej1cRa3ZjtoVwcWSQuQ/fow==",
|
|
3353
|
+
"dev": true,
|
|
3354
|
+
"requires": {
|
|
3355
|
+
"acorn": "^8.7.0",
|
|
3356
|
+
"acorn-walk": "^8.2.0"
|
|
3357
|
+
}
|
|
3342
3358
|
},
|
|
3343
3359
|
"walk-up-path": {
|
|
3344
3360
|
"version": "1.0.0",
|
package/demo/es6/package.json
CHANGED
package/demo/html/index.html
CHANGED
|
@@ -45,7 +45,8 @@
|
|
|
45
45
|
data: svgMapDataPopulation,
|
|
46
46
|
flagType: 'emoji',
|
|
47
47
|
mouseWheelZoomEnabled: true,
|
|
48
|
-
mouseWheelZoomWithKey: true
|
|
48
|
+
mouseWheelZoomWithKey: true,
|
|
49
|
+
showContinentSelector: true
|
|
49
50
|
});
|
|
50
51
|
</script>
|
|
51
52
|
</div>
|
|
@@ -70,7 +71,8 @@
|
|
|
70
71
|
mouseWheelZoomEnabled: true,
|
|
71
72
|
mouseWheelZoomWithKey: true,
|
|
72
73
|
mouseWheelKeyMessage: 'Bitte [ALT] drücken um zu zoomen',
|
|
73
|
-
mouseWheelKeyMessageMac: 'Bitte [COMMAND] drücken um zu zoomen'
|
|
74
|
+
mouseWheelKeyMessageMac: 'Bitte [COMMAND] drücken um zu zoomen',
|
|
75
|
+
showZoomReset: true
|
|
74
76
|
});
|
|
75
77
|
</script>
|
|
76
78
|
</div>
|
|
@@ -151,6 +153,12 @@
|
|
|
151
153
|
|
|
152
154
|
// Fill content
|
|
153
155
|
var innerHTML =
|
|
156
|
+
'<div style="margin: 0 0 10px; text-align: center"><img src="https://cdn.jsdelivr.net/gh/hjnilsson/country-flags@latest/svg/{0}.svg" alt="" style="height: 40px; width: auto; border: 2px solid #eee"></div>'.replace(
|
|
157
|
+
'{0}',
|
|
158
|
+
countryID.toLowerCase()
|
|
159
|
+
);
|
|
160
|
+
|
|
161
|
+
innerHTML +=
|
|
154
162
|
'<div style="min-width: 180px; font-weight: bold; margin: 0 0 15px; text-align: center">' +
|
|
155
163
|
countries[countryID] +
|
|
156
164
|
'</div>';
|
package/dist/svgMap.css
CHANGED
|
@@ -114,6 +114,12 @@
|
|
|
114
114
|
width: 11px;
|
|
115
115
|
height: 3px;
|
|
116
116
|
}
|
|
117
|
+
.svgMap-map-wrapper .svgMap-control-button.svgMap-zoom-button.svgMap-zoom-reset-button::before {
|
|
118
|
+
width: 11px;
|
|
119
|
+
height: 11px;
|
|
120
|
+
background: none;
|
|
121
|
+
border: 2px solid #666;
|
|
122
|
+
}
|
|
117
123
|
@media (hover: hover) {
|
|
118
124
|
.svgMap-map-wrapper .svgMap-control-button.svgMap-zoom-button:hover:before, .svgMap-map-wrapper .svgMap-control-button.svgMap-zoom-button:hover:after {
|
|
119
125
|
background: #111;
|
|
@@ -125,6 +131,10 @@
|
|
|
125
131
|
.svgMap-map-wrapper .svgMap-control-button.svgMap-zoom-button.svgMap-disabled:before, .svgMap-map-wrapper .svgMap-control-button.svgMap-zoom-button.svgMap-disabled:after {
|
|
126
132
|
background: #ccc;
|
|
127
133
|
}
|
|
134
|
+
.svgMap-map-wrapper .svgMap-control-button.svgMap-zoom-button.svgMap-zoom-reset-button.svgMap-disabled:before {
|
|
135
|
+
border: 2px solid #ccc;
|
|
136
|
+
background: none;
|
|
137
|
+
}
|
|
128
138
|
.svgMap-map-wrapper .svgMap-control-button.svgMap-zoom-in-button {
|
|
129
139
|
margin: 1px 0 1px 1px;
|
|
130
140
|
}
|
|
@@ -135,6 +145,15 @@
|
|
|
135
145
|
.svgMap-map-wrapper .svgMap-control-button.svgMap-zoom-out-button {
|
|
136
146
|
margin: 1px 1px 1px 0;
|
|
137
147
|
}
|
|
148
|
+
.svgMap-map-wrapper .svgMap-map-continent-controls-wrapper {
|
|
149
|
+
position: absolute;
|
|
150
|
+
top: 10px;
|
|
151
|
+
right: 10px;
|
|
152
|
+
z-index: 1;
|
|
153
|
+
display: flex;
|
|
154
|
+
border-radius: 2px;
|
|
155
|
+
box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
|
|
156
|
+
}
|
|
138
157
|
.svgMap-map-wrapper .svgMap-country {
|
|
139
158
|
stroke: #fff;
|
|
140
159
|
stroke-width: 1;
|
package/dist/svgMap.js
CHANGED
|
@@ -64,6 +64,9 @@ function svgMapWrapper(svgPanZoom) {
|
|
|
64
64
|
// Set to true to open the link on mobile devices, set to false (default) to show the tooltip
|
|
65
65
|
touchLink: false,
|
|
66
66
|
|
|
67
|
+
// Set to true to show the to show a zoom reset button
|
|
68
|
+
showZoomReset: false,
|
|
69
|
+
|
|
67
70
|
// Called when a tooltip is created to custimize the tooltip content
|
|
68
71
|
onGetTooltip: function (tooltipDiv, countryID, countryValues) {
|
|
69
72
|
return null;
|
|
@@ -76,7 +79,10 @@ function svgMapWrapper(svgPanZoom) {
|
|
|
76
79
|
|
|
77
80
|
// Crimea: Set to 'RU' to make the Crimea part of Russia, by default it is part of the Ukraine
|
|
78
81
|
Crimea: 'UA'
|
|
79
|
-
}
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
// Set to true to show a drop down menu with the continents
|
|
85
|
+
showContinentSelector: false,
|
|
80
86
|
};
|
|
81
87
|
|
|
82
88
|
this.options = Object.assign({}, defaultOptions, options || {});
|
|
@@ -679,6 +685,69 @@ function svgMapWrapper(svgPanZoom) {
|
|
|
679
685
|
ZW: '🇿🇼'
|
|
680
686
|
};
|
|
681
687
|
|
|
688
|
+
svgMap.prototype.continents = {
|
|
689
|
+
"EA": {
|
|
690
|
+
"iso": "EA",
|
|
691
|
+
"name": "World"
|
|
692
|
+
},
|
|
693
|
+
"AF": {
|
|
694
|
+
"iso": "AF",
|
|
695
|
+
"name": "Africa",
|
|
696
|
+
"pan": {
|
|
697
|
+
x: 454, y: 250
|
|
698
|
+
},
|
|
699
|
+
"zoom": 1.90
|
|
700
|
+
},
|
|
701
|
+
"AS": {
|
|
702
|
+
"iso": "AS",
|
|
703
|
+
"name": "Asia",
|
|
704
|
+
"pan": {
|
|
705
|
+
x: 904, y: 80
|
|
706
|
+
},
|
|
707
|
+
"zoom": 1.8
|
|
708
|
+
},
|
|
709
|
+
"EU": {
|
|
710
|
+
"iso": "EU",
|
|
711
|
+
"name": "Europe",
|
|
712
|
+
"pan": {
|
|
713
|
+
x: 404, y: 80
|
|
714
|
+
},
|
|
715
|
+
"zoom": 5
|
|
716
|
+
},
|
|
717
|
+
"NA": {
|
|
718
|
+
"iso": "NA",
|
|
719
|
+
"name": "North America",
|
|
720
|
+
"pan": {
|
|
721
|
+
x: 104, y: 55
|
|
722
|
+
},
|
|
723
|
+
"zoom": 2.6
|
|
724
|
+
},
|
|
725
|
+
|
|
726
|
+
"MA": {
|
|
727
|
+
"iso": "MA",
|
|
728
|
+
"name": "Middle America",
|
|
729
|
+
"pan": {
|
|
730
|
+
x: 104, y: 200
|
|
731
|
+
},
|
|
732
|
+
"zoom": 2.6
|
|
733
|
+
},
|
|
734
|
+
"SA": {
|
|
735
|
+
"iso": "SA",
|
|
736
|
+
"name": "South America",
|
|
737
|
+
"pan": {
|
|
738
|
+
x: 104, y: 340
|
|
739
|
+
},
|
|
740
|
+
"zoom": 2.2
|
|
741
|
+
},
|
|
742
|
+
"OC": {
|
|
743
|
+
"iso": "OC",
|
|
744
|
+
"name": "Oceania",
|
|
745
|
+
"pan": {
|
|
746
|
+
x: 954, y: 350
|
|
747
|
+
},
|
|
748
|
+
"zoom": 1.90
|
|
749
|
+
},
|
|
750
|
+
}
|
|
682
751
|
// Create the SVG map
|
|
683
752
|
|
|
684
753
|
svgMap.prototype.createMap = function () {
|
|
@@ -699,6 +768,7 @@ function svgMapWrapper(svgPanZoom) {
|
|
|
699
768
|
this.mapImage.classList.add('svgMap-map-image');
|
|
700
769
|
this.mapWrapper.appendChild(this.mapImage);
|
|
701
770
|
|
|
771
|
+
|
|
702
772
|
// Add controls
|
|
703
773
|
var mapControlsWrapper = this.createElement(
|
|
704
774
|
'div',
|
|
@@ -710,25 +780,27 @@ function svgMapWrapper(svgPanZoom) {
|
|
|
710
780
|
'svgMap-map-controls-zoom',
|
|
711
781
|
mapControlsWrapper
|
|
712
782
|
);
|
|
713
|
-
['in', 'out'].forEach(
|
|
783
|
+
['in', 'out', 'reset'].forEach(
|
|
714
784
|
function (item) {
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
785
|
+
if (item === 'reset' && this.options.showZoomReset || item !== 'reset') {
|
|
786
|
+
var zoomControlName =
|
|
787
|
+
'zoomControl' + item.charAt(0).toUpperCase() + item.slice(1);
|
|
788
|
+
this[zoomControlName] = this.createElement(
|
|
789
|
+
'button',
|
|
790
|
+
'svgMap-control-button svgMap-zoom-button svgMap-zoom-' +
|
|
720
791
|
item +
|
|
721
792
|
'-button',
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
793
|
+
zoomContainer
|
|
794
|
+
);
|
|
795
|
+
this[zoomControlName].type = 'button';
|
|
796
|
+
this[zoomControlName].addEventListener(
|
|
797
|
+
'click',
|
|
798
|
+
function () {
|
|
799
|
+
this.zoomMap(item);
|
|
800
|
+
}.bind(this),
|
|
801
|
+
{ passive: true }
|
|
802
|
+
);
|
|
803
|
+
}
|
|
732
804
|
}.bind(this)
|
|
733
805
|
);
|
|
734
806
|
|
|
@@ -736,6 +808,41 @@ function svgMapWrapper(svgPanZoom) {
|
|
|
736
808
|
this.zoomControlIn.setAttribute('aria-label', 'Zoom in');
|
|
737
809
|
this.zoomControlOut.setAttribute('aria-label', 'Zoom out');
|
|
738
810
|
|
|
811
|
+
if (this.options.showContinentSelector) {
|
|
812
|
+
// Add continent controls
|
|
813
|
+
var mapContinentControlsWrapper = this.createElement(
|
|
814
|
+
'div',
|
|
815
|
+
'svgMap-map-continent-controls-wrapper',
|
|
816
|
+
this.mapWrapper
|
|
817
|
+
);
|
|
818
|
+
this["continentSelect"] = this.createElement(
|
|
819
|
+
'select',
|
|
820
|
+
'svgMap-continent-select',
|
|
821
|
+
mapContinentControlsWrapper
|
|
822
|
+
);
|
|
823
|
+
var that = this;
|
|
824
|
+
Object.keys(svgMap.prototype.continents).forEach(
|
|
825
|
+
function (item) {
|
|
826
|
+
let element = that.createElement(
|
|
827
|
+
'option',
|
|
828
|
+
'svgMap-continent-option svgMap-continent-iso-' + svgMap.prototype.continents[item].iso,
|
|
829
|
+
that["continentSelect"],
|
|
830
|
+
svgMap.prototype.continents[item].name
|
|
831
|
+
);
|
|
832
|
+
element.value = item
|
|
833
|
+
}
|
|
834
|
+
);
|
|
835
|
+
|
|
836
|
+
this.continentSelect.addEventListener(
|
|
837
|
+
'change',
|
|
838
|
+
function (e) {
|
|
839
|
+
const continent = e.target.value;
|
|
840
|
+
if (continent) this.zoomContinent(e.target.value);
|
|
841
|
+
}.bind(that),
|
|
842
|
+
{ passive: true }
|
|
843
|
+
);
|
|
844
|
+
mapContinentControlsWrapper.setAttribute('aria-label', 'Select continent');
|
|
845
|
+
}
|
|
739
846
|
// Fix countries
|
|
740
847
|
var mapPaths = Object.assign({}, this.mapPaths);
|
|
741
848
|
|
|
@@ -845,7 +952,17 @@ function svgMapWrapper(svgPanZoom) {
|
|
|
845
952
|
this.options.data.values[countryID]['linkTarget']
|
|
846
953
|
);
|
|
847
954
|
}
|
|
848
|
-
|
|
955
|
+
|
|
956
|
+
let dragged = false;
|
|
957
|
+
countryElement.addEventListener('mousedown', function () { dragged = false });
|
|
958
|
+
countryElement.addEventListener('touchstart', function () { dragged = false });
|
|
959
|
+
countryElement.addEventListener('mousemove', function () { dragged = true });
|
|
960
|
+
countryElement.addEventListener('touchmove', function () { dragged = true });
|
|
961
|
+
const clickHandler = function (e) {
|
|
962
|
+
if (dragged) {
|
|
963
|
+
return;
|
|
964
|
+
}
|
|
965
|
+
|
|
849
966
|
const link = countryElement.getAttribute('data-link');
|
|
850
967
|
const target = countryElement.getAttribute('data-link-target');
|
|
851
968
|
|
|
@@ -854,7 +971,10 @@ function svgMapWrapper(svgPanZoom) {
|
|
|
854
971
|
} else {
|
|
855
972
|
window.location.href = link;
|
|
856
973
|
}
|
|
857
|
-
}
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
countryElement.addEventListener('click', clickHandler);
|
|
977
|
+
countryElement.addEventListener('touchend', clickHandler);
|
|
858
978
|
}
|
|
859
979
|
|
|
860
980
|
// Hide tooltip when mouse leaves the country area
|
|
@@ -969,7 +1089,7 @@ function svgMapWrapper(svgPanZoom) {
|
|
|
969
1089
|
var flagContainer = this.createElement(
|
|
970
1090
|
'div',
|
|
971
1091
|
'svgMap-tooltip-flag-container svgMap-tooltip-flag-container-' +
|
|
972
|
-
|
|
1092
|
+
this.options.flagType,
|
|
973
1093
|
tooltipContentWrapper
|
|
974
1094
|
);
|
|
975
1095
|
|
|
@@ -1035,6 +1155,10 @@ function svgMapWrapper(svgPanZoom) {
|
|
|
1035
1155
|
this.zoomControlIn.setAttribute('aria-disabled', 'false');
|
|
1036
1156
|
this.zoomControlOut.classList.remove('svgMap-disabled');
|
|
1037
1157
|
this.zoomControlOut.setAttribute('aria-disabled', 'false');
|
|
1158
|
+
if (this.options.showZoomReset) {
|
|
1159
|
+
this.zoomControlReset.classList.remove('svgMap-disabled');
|
|
1160
|
+
this.zoomControlReset.setAttribute('aria-disabled', 'false');
|
|
1161
|
+
}
|
|
1038
1162
|
|
|
1039
1163
|
if (this.mapPanZoom.getZoom().toFixed(3) <= this.options.minZoom) {
|
|
1040
1164
|
this.zoomControlOut.classList.add('svgMap-disabled');
|
|
@@ -1044,6 +1168,10 @@ function svgMapWrapper(svgPanZoom) {
|
|
|
1044
1168
|
this.zoomControlIn.classList.add('svgMap-disabled');
|
|
1045
1169
|
this.zoomControlIn.setAttribute('aria-disabled', 'true');
|
|
1046
1170
|
}
|
|
1171
|
+
if (this.options.showZoomReset && this.mapPanZoom.getZoom().toFixed(3) == this.options.initialZoom) {
|
|
1172
|
+
this.zoomControlReset.classList.add('svgMap-disabled');
|
|
1173
|
+
this.zoomControlReset.setAttribute('aria-disabled', 'true');
|
|
1174
|
+
}
|
|
1047
1175
|
};
|
|
1048
1176
|
|
|
1049
1177
|
// Zoom map
|
|
@@ -1056,7 +1184,33 @@ function svgMapWrapper(svgPanZoom) {
|
|
|
1056
1184
|
) {
|
|
1057
1185
|
return false;
|
|
1058
1186
|
}
|
|
1059
|
-
|
|
1187
|
+
if (direction === 'reset') {
|
|
1188
|
+
this.mapPanZoom.reset();
|
|
1189
|
+
if (this.options.initialPan.x != 0 || this.options.initialPan.y != 0) {
|
|
1190
|
+
// Init zoom and pan
|
|
1191
|
+
this.mapPanZoom.zoomAtPointBy(this.options.initialZoom, {
|
|
1192
|
+
x: this.options.initialPan.x,
|
|
1193
|
+
y: this.options.initialPan.y
|
|
1194
|
+
});
|
|
1195
|
+
} else {
|
|
1196
|
+
// Init zoom
|
|
1197
|
+
this.mapPanZoom.zoom(this.options.initialZoom);
|
|
1198
|
+
}
|
|
1199
|
+
} else {
|
|
1200
|
+
this.mapPanZoom[direction == 'in' ? 'zoomIn' : 'zoomOut']();
|
|
1201
|
+
}
|
|
1202
|
+
};
|
|
1203
|
+
|
|
1204
|
+
// Zoom to Contient
|
|
1205
|
+
|
|
1206
|
+
svgMap.prototype.zoomContinent = function (contientIso) {
|
|
1207
|
+
|
|
1208
|
+
const continent = this.continents[contientIso];
|
|
1209
|
+
if (continent.iso == "EA") this.mapPanZoom.reset()
|
|
1210
|
+
else if (continent.pan) {
|
|
1211
|
+
this.mapPanZoom.reset()
|
|
1212
|
+
this.mapPanZoom.zoomAtPoint(continent.zoom, continent.pan);
|
|
1213
|
+
}
|
|
1060
1214
|
};
|
|
1061
1215
|
|
|
1062
1216
|
// Add elements to show the zoom with keys notice
|
|
@@ -1971,15 +2125,15 @@ function svgMapWrapper(svgPanZoom) {
|
|
|
1971
2125
|
ratio = parseFloat(ratio).toFixed(1);
|
|
1972
2126
|
var r = Math.ceil(
|
|
1973
2127
|
parseInt(color1.substring(0, 2), 16) * ratio +
|
|
1974
|
-
|
|
2128
|
+
parseInt(color2.substring(0, 2), 16) * (1 - ratio)
|
|
1975
2129
|
);
|
|
1976
2130
|
var g = Math.ceil(
|
|
1977
2131
|
parseInt(color1.substring(2, 4), 16) * ratio +
|
|
1978
|
-
|
|
2132
|
+
parseInt(color2.substring(2, 4), 16) * (1 - ratio)
|
|
1979
2133
|
);
|
|
1980
2134
|
var b = Math.ceil(
|
|
1981
2135
|
parseInt(color1.substring(4, 6), 16) * ratio +
|
|
1982
|
-
|
|
2136
|
+
parseInt(color2.substring(4, 6), 16) * (1 - ratio)
|
|
1983
2137
|
);
|
|
1984
2138
|
return '#' + this.getHex(r) + this.getHex(g) + this.getHex(b);
|
|
1985
2139
|
};
|
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;bottom:10px;left:10px;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-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:transparent;border:none;border-radius:0;color:inherit;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:30px;height:30px;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:#666;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:#111}}.svgMap-map-wrapper .svgMap-control-button.svgMap-zoom-button:active:after,.svgMap-map-wrapper .svgMap-control-button.svgMap-zoom-button:active:before{background:#111}.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:#ccc}.svgMap-map-wrapper .svgMap-control-button.svgMap-zoom-in-button{margin:1px 0 1px 1px}.svgMap-map-wrapper .svgMap-control-button.svgMap-zoom-in-button:after{width:3px;height:11px}.svgMap-map-wrapper .svgMap-control-button.svgMap-zoom-out-button{margin:1px 1px 1px 0}.svgMap-map-wrapper .svgMap-country{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 #000;display:none;pointer-events:none;min-width:60px}.svgMap-tooltip.svgMap-tooltip-flipped{transform:translate(-50%,0);border-bottom:0;border-top:1px solid #000}.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 #000;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)}
|
|
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;bottom:10px;left:10px;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-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:transparent;border:none;border-radius:0;color:inherit;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:30px;height:30px;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:#666;transition:background-color 250ms}.svgMap-map-wrapper .svgMap-control-button.svgMap-zoom-button:before{width:11px;height:3px}.svgMap-map-wrapper .svgMap-control-button.svgMap-zoom-button.svgMap-zoom-reset-button::before{width:11px;height:11px;background:0 0;border:2px solid #666}@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:#111}}.svgMap-map-wrapper .svgMap-control-button.svgMap-zoom-button:active:after,.svgMap-map-wrapper .svgMap-control-button.svgMap-zoom-button:active:before{background:#111}.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:#ccc}.svgMap-map-wrapper .svgMap-control-button.svgMap-zoom-button.svgMap-zoom-reset-button.svgMap-disabled:before{border:2px solid #ccc;background:0 0}.svgMap-map-wrapper .svgMap-control-button.svgMap-zoom-in-button{margin:1px 0 1px 1px}.svgMap-map-wrapper .svgMap-control-button.svgMap-zoom-in-button:after{width:3px;height:11px}.svgMap-map-wrapper .svgMap-control-button.svgMap-zoom-out-button{margin:1px 1px 1px 0}.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{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 #000;display:none;pointer-events:none;min-width:60px}.svgMap-tooltip.svgMap-tooltip-flipped{transform:translate(-50%,0);border-bottom:0;border-top:1px solid #000}.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 #000;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)}
|