<!-- Vector Map -->
<div style="height: 30rem;">
<div class="js-jvectormap-custom-with-stats jvectormap-custom"
data-hs-jvector-map-options='{
"tipCentered": true,
"focusOn": {
"x": 0.5,
"y": 0.5,
"scale": 1.5
},
"regionStyle": {
"initial": {
"fill": "rgba(55, 125, 255, .3)"
},
"hover": {
"fill": "#377dff"
}
},
"backgroundColor": "#132144",
"markerStyle": {
"initial": {
"stroke-width": 0,
"fill": "rgba(255,255,255,.5)",
"stroke": "rgba(255,255,255,.5)",
"r": 6
},
"hover": {
"stroke-width": 0,
"fill": "#fff",
"stroke": "#fff"
}
}
}'></div>
</div>
<!-- End Vector Map -->
<script>
$(document).on('ready', function () {
var markers = [
{
"latLng": [38, -97],
"name": "United States",
"active": 200,
"new": 40,
"flag": "../assets/vendor/flag-icon-css/flags/1x1/us.svg",
"code": "US"
},
{
"latLng": [20, 77],
"name": "India",
"active": 300,
"new": 100,
"flag": "../assets/vendor/flag-icon-css/flags/1x1/in.svg",
"code": "IN"
},
{
"latLng": [60, -105],
"name": "Canada",
"active": 400,
"new": 500,
"flag": "../assets/vendor/flag-icon-css/flags/1x1/ca.svg",
"code": "CA"
},
{
"latLng": [51, 9],
"name": "Germany",
"active": 120,
"new": 600,
"flag": "../assets/vendor/flag-icon-css/flags/1x1/de.svg",
"code": "DE"
},
{
"latLng": [54, -2],
"name": "United Kingdom",
"active": 140,
"new": 100,
"flag": "../assets/vendor/flag-icon-css/flags/1x1/gb.svg",
"code": "GB"
},
{
"latLng": [1.3, 103.8],
"name": "Singapore",
"active": 56,
"new": 0,
"flag": "../assets/vendor/flag-icon-css/flags/1x1/sg.svg",
"code": "SG"
},
{
"latLng": [9.0, 8.6],
"name": "Nigeria",
"active": 34,
"new": 2,
"flag": "../assets/vendor/flag-icon-css/flags/1x1/ng.svg",
"code": "NG"
},
{
"latLng": [61.5, 105.3],
"name": "Russia",
"active": 135,
"new": 46,
"flag": "../assets/vendor/flag-icon-css/flags/1x1/ru.svg",
"code": "RU"
},
{
"latLng": [35.8, 104.1],
"name": "China",
"active": 325,
"new": 75,
"flag": "../assets/vendor/flag-icon-css/flags/1x1/cn.svg",
"code": "CN"
},
{
"latLng": [-10, -51],
"name": "Brazil",
"active": 242,
"new": 17,
"flag": "../assets/vendor/flag-icon-css/flags/1x1/br.svg",
"code": "BR"
}
]
$('.js-jvectormap-custom-with-stats').each(function () {
var jVectorMap = $.HSCore.components.HSJVectorMap.init($(this), {
markers: markers,
onRegionTipShow: function(e, el, code){
let marker = markers.find(function (marker) {
return marker.code == code
});
if (marker) {
el.html(
'<span class="d-flex align-items-center mb-2">' +
'<img class="avatar avatar-xss avatar-circle mr-2" src="' + marker['flag'] + '" alt="Flag">' +
'<span class="h5 mb-0">' + marker['name'] + '</span>' +
'</span>' +
'<dl class="row" style="max-width: 10rem;">' +
'<dt class="col-sm-6 mb-0">Active:</dt>' +
'<dd class="col-sm-6 text-sm-right mb-0">' + marker['active'] + '</dd>' +
'<dt class="col-sm-6 mb-0">New:</dt>' +
'<dd class="col-sm-6 text-sm-right mb-0">' + marker['new'] + '</dd>' +
'</dl>'
);
} else {
return false;
}
},
onMarkerTipShow: function(e, el, code){
el.html(
'<span class="d-flex align-items-center mb-2">' +
'<img class="avatar avatar-xss avatar-circle mr-2" src="' + markers[code]['flag'] + '" alt="Flag">' +
'<span class="h5 mb-0">' + markers[code]['name'] + '</span>' +
'</span>' +
'<dl class="row" style="max-width: 10rem;">' +
'<dt class="col-sm-6 mb-0">Active:</dt>' +
'<dd class="col-sm-6 text-sm-right mb-0">' + markers[code]['active'] + '</dd>' +
'<dt class="col-sm-6 mb-0">New:</dt>' +
'<dd class="col-sm-6 text-sm-right mb-0">' + markers[code]['new'] + '</dd>' +
'</dl>'
);
}
});
});
});
</script>