回答編集履歴
1
追記
answer
CHANGED
@@ -1,2 +1,51 @@
|
|
1
1
|
geochartの世界地図を使うのも手段としてはあると思います
|
2
|
-
[https://developers.google.com/chart/interactive/docs/gallery/geochart](https://developers.google.com/chart/interactive/docs/gallery/geochart)
|
2
|
+
[https://developers.google.com/chart/interactive/docs/gallery/geochart](https://developers.google.com/chart/interactive/docs/gallery/geochart)
|
3
|
+
|
4
|
+
追記 2017/02/27 18:40
|
5
|
+
例えばこんな風になる
|
6
|
+
日本でgoogleブラジルでyahooに飛ぶように設定している
|
7
|
+
|
8
|
+
```HTML
|
9
|
+
<html>
|
10
|
+
<head>
|
11
|
+
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
|
12
|
+
<script type="text/javascript">
|
13
|
+
google.charts.load('current', {'packages':['geochart']});
|
14
|
+
google.charts.setOnLoadCallback(drawRegionsMap);
|
15
|
+
|
16
|
+
function drawRegionsMap() {
|
17
|
+
|
18
|
+
var data = google.visualization.arrayToDataTable([
|
19
|
+
['国', 'Popularity'],
|
20
|
+
['日本', '日本'],
|
21
|
+
['ブラジル', 'ブラジル']
|
22
|
+
]);
|
23
|
+
var options = {};
|
24
|
+
var chart = new google.visualization.GeoChart(document.getElementById('regions_div'));
|
25
|
+
function selectHandler() {
|
26
|
+
var selectedItem = chart.getSelection()[0];
|
27
|
+
var row = selectedItem.row
|
28
|
+
if (selectedItem) {
|
29
|
+
switch (row){
|
30
|
+
case 0:
|
31
|
+
url ="https://www.google.co.jp/";
|
32
|
+
break;
|
33
|
+
case 1:
|
34
|
+
url ="http://www.yahoo.co.jp/";
|
35
|
+
break;
|
36
|
+
}
|
37
|
+
window.location.href = url;
|
38
|
+
}
|
39
|
+
}
|
40
|
+
google.visualization.events.addListener(chart, 'select', selectHandler);
|
41
|
+
chart.draw(data, options);
|
42
|
+
}
|
43
|
+
</script>
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
<div id="regions_div" style="width: 900px; height: 500px;"></div>
|
47
|
+
</body>
|
48
|
+
</html>
|
49
|
+
|
50
|
+
```
|
51
|
+

|