forked from asSqr/jVectormapJP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex_jvectormap.html
57 lines (55 loc) · 1.55 KB
/
index_jvectormap.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<!DOCTYPE html>
<html>
<head>
<title>jVectorMap demo</title>
<link rel="stylesheet" href="jquery-jvectormap.css" type="text/css" media="screen"/>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="jquery-jvectormap-min.js"></script>
<script src="jquery-jvectormap-jp-merc.js"></script>
</head>
<body>
<div id="world-map" style="width: 800px; height: 350px;"></div>
<script>
$( () => {
var markers = [
{ latLng: [35.68, 139.76], name: 'Tokyo' }
];
var map = new jvm.Map({
container: $('#world-map'),
map: 'jp_merc',
onRegionTipShow: ( e, el, code ) => {
el.html( el.html() );
console.log(el.html() );
},
backgroundColor: '#0071a4',
enableZoom: false,
showTooltip: false,
regionsSelectable: true,
markersSelectable: true,
hoverOpacity: 0.7,
regionStyle: {
selected: {
fill: '#666666'
}
},
markerStyle: {
initial: {
fill: '#f8e23b',
stroke: '#383f47'
}
},
markers: markers,
onRegionSelected: () => {
var xs = map.getSelectedRegions();
console.log( xs.map( x => map.mapData.paths[x].name+" ("+x+")" ) );
},
onMarkerSelected: () => {
var xs = map.getSelectedMarkers().map( parseFloat );
console.log( xs.map( x => markers[x].name ) );
}
});
console.log(map);
});
</script>
</body>
</html>