質問編集履歴
1
質問内容及び問題解決方法の変更
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
Google Fusion
|
1
|
+
Google Fusion tablesの『リンクの共有』を『オフ-特定のユーザ』にした場合のデータ取得方法
|
body
CHANGED
@@ -1,87 +1,85 @@
|
|
1
1
|
###前提・実現したいこと
|
2
|
-
|
2
|
+
GoogleのFusion tablesのお客様の住所データを使って、HTML&ScriptにてGoogle Mapにピンを設置しています。
|
3
3
|
|
4
|
-
GoogleのFusion tablesを使って、HTMLのJava Scriptからテーブルデータの
|
5
|
-
取得を行い、取得したテーブルデータの住所を元にMapにピンを表示する処理を
|
6
|
-
|
4
|
+
ここで顧客データのセキュリティを高めたいと思っております。
|
7
5
|
|
8
6
|
###発生している問題・エラーメッセージ
|
9
7
|
|
10
|
-
Fusion tablesの設定で『リンクの共有』で『オン-リンクを知っている全員』
|
8
|
+
現在、Fusion tablesの設定で『リンクの共有』で『オン-リンクを知っている全員』にしております。
|
11
|
-
問題無く、テーブルデータの取得が出来ます。
|
12
|
-
しかし、『リンクの共有』を『オフ-特定のユーザ』ではテーブルデータの取得が出来ません。
|
13
|
-
|
9
|
+
そこで、Scriptの"暗号化されたTableID"(下記参照)が解ってしまうと、第3者にもアクセスが可能になってしまいます。
|
10
|
+
顧客データなので、もう少しセキュリティを高くしたいと思っております。
|
14
11
|
|
15
12
|
|
13
|
+
『 query: {
|
14
|
+
select: "col2",
|
15
|
+
from: "暗号化されたTableID",
|
16
|
+
where: ""
|
17
|
+
』
|
16
18
|
|
17
19
|
###該当のソースコード
|
18
|
-
※ 申し訳ありませんが、コードの一部を伏せさせて頂きました。
|
19
20
|
<!DOCTYPE html>
|
20
21
|
<html>
|
21
22
|
<head>
|
22
|
-
<meta name="viewport"
|
23
|
+
<meta name="viewport"/>
|
23
|
-
<title>
|
24
|
+
<title>Map - Google Fusion Tables</title>
|
24
25
|
<style type="text/css">
|
25
26
|
html, body, #googft-mapCanvas {
|
26
|
-
height:
|
27
|
+
height: 300px;
|
27
28
|
margin: 0;
|
28
29
|
padding: 0;
|
29
|
-
width:
|
30
|
+
width: 500px;
|
30
31
|
}
|
31
32
|
</style>
|
32
33
|
|
33
34
|
<script type="text/javascript" src="https://maps.google.com/maps/api/js?v=3"></script>
|
34
35
|
|
35
36
|
<script type="text/javascript">
|
36
|
-
var map;
|
37
|
-
|
38
37
|
function initialize() {
|
38
|
+
var isMobile = (navigator.userAgent.toLowerCase().indexOf('android') > -1) ||
|
39
|
+
(navigator.userAgent.match(/(iPod|iPhone|iPad|BlackBerry|Windows Phone|iemobile)/));
|
39
|
-
|
40
|
+
if (isMobile) {
|
41
|
+
var viewport = document.querySelector("meta[name=viewport]");
|
42
|
+
viewport.setAttribute('content', 'initial-scale=1.0, user-scalable=no');
|
40
|
-
|
43
|
+
}
|
41
|
-
|
42
|
-
|
43
|
-
function MapWrite(EventFlg) {
|
44
|
-
var cent;
|
45
|
-
var zoom
|
46
44
|
var mapDiv = document.getElementById('googft-mapCanvas');
|
47
|
-
|
48
|
-
|
45
|
+
mapDiv.style.width = isMobile ? '100%' : '500px';
|
49
|
-
zoom = 9;
|
50
|
-
|
46
|
+
mapDiv.style.height = isMobile ? '100%' : '300px';
|
51
|
-
} else {
|
52
|
-
zoom = map.getZoom();
|
53
|
-
cent= map.getCenter();
|
54
|
-
}
|
55
|
-
|
56
|
-
map = new google.maps.Map(mapDiv, {
|
47
|
+
var map = new google.maps.Map(mapDiv, {
|
57
|
-
|
48
|
+
center: new google.maps.LatLng(36.62479048260215, 138.18121014999997),
|
58
|
-
|
49
|
+
zoom: 6,
|
59
|
-
|
50
|
+
mapTypeId: google.maps.MapTypeId.ROADMAP
|
60
51
|
});
|
61
52
|
|
62
|
-
|
63
|
-
map.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(document.getElementById('googft-legend-open'));
|
64
|
-
map.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(document.getElementById('googft-legend'));
|
65
|
-
|
66
|
-
|
67
|
-
var ename = document.getElementById('group');
|
68
|
-
var selidx = ename.selectedIndex;
|
69
|
-
|
70
|
-
|
53
|
+
layer = new google.maps.FusionTablesLayer({
|
71
|
-
|
54
|
+
map: map,
|
55
|
+
heatmap: { enabled: false },
|
72
|
-
|
56
|
+
query: {
|
73
|
-
|
57
|
+
select: "col4",
|
74
|
-
|
58
|
+
from: "暗号化されたTableID",
|
75
|
-
|
59
|
+
where: ""
|
76
|
-
|
60
|
+
},
|
61
|
+
options: {
|
77
|
-
|
62
|
+
styleId: 3,
|
78
|
-
|
63
|
+
templateId: 4
|
79
|
-
iconName: "ylw_circle"
|
80
|
-
|
64
|
+
}
|
81
|
-
|
82
|
-
}]
|
83
65
|
});
|
84
66
|
|
67
|
+
if (isMobile) {
|
68
|
+
var legend = document.getElementById('googft-legend');
|
69
|
+
var legendOpenButton = document.getElementById('googft-legend-open');
|
70
|
+
var legendCloseButton = document.getElementById('googft-legend-close');
|
71
|
+
legend.style.display = 'none';
|
72
|
+
legendOpenButton.style.display = 'block';
|
73
|
+
legendCloseButton.style.display = 'block';
|
74
|
+
legendOpenButton.onclick = function() {
|
75
|
+
legend.style.display = 'block';
|
76
|
+
legendOpenButton.style.display = 'none';
|
77
|
+
}
|
78
|
+
legendCloseButton.onclick = function() {
|
79
|
+
legend.style.display = 'none';
|
80
|
+
legendOpenButton.style.display = 'block';
|
81
|
+
}
|
82
|
+
}
|
85
83
|
}
|
86
84
|
|
87
85
|
google.maps.event.addDomListener(window, 'load', initialize);
|
@@ -89,22 +87,14 @@
|
|
89
87
|
</head>
|
90
88
|
|
91
89
|
<body>
|
92
|
-
<div id="Joken">
|
93
|
-
<select id="group" name="pgr" size="1" onChange="MapWrite(1);">>
|
94
|
-
<option value="%">ALL</option>
|
95
|
-
<option value="gr1">グループ1</option>
|
96
|
-
<option value="gr2">グループ2</option>
|
97
|
-
<option value="gr3">グループ3</option>
|
98
|
-
<option value="gr4">グループ4</option>
|
99
|
-
<option value="gr5">グループ5</option>
|
100
|
-
</select>
|
101
|
-
|
102
|
-
</div>
|
103
90
|
<div id="googft-mapCanvas"></div>
|
104
91
|
</body>
|
92
|
+
</html>
|
105
93
|
|
106
94
|
###試したこと
|
107
|
-
Fusion tablesの設定で『リンクの共有』で『オ
|
95
|
+
Fusion tablesの設定で『リンクの共有』で『オフ-特定のユーザ』を試したのですが、
|
96
|
+
データの取得方法がわからず、断念しました。
|
97
|
+
(上記HTML&Scriptをそのまま起動しましたが、ピンは表示されませんでした。)
|
108
98
|
|
109
99
|
###補足情報(言語/FW/ツール等のバージョンなど)
|
110
100
|
HTML
|