質問編集履歴
3
コードを```で囲みました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -32,17 +32,9 @@
|
|
32
32
|
|
33
33
|
javascriptの情報を下記に記します。
|
34
34
|
|
35
|
-
```
|
36
|
-
|
37
|
-
var map;
|
38
|
-
|
39
|
-
var marker = [];
|
40
|
-
|
41
|
-
var infoWindow = [];
|
42
|
-
|
43
|
-
|
44
35
|
|
45
36
|
|
37
|
+
```
|
46
38
|
|
47
39
|
function initMap() {
|
48
40
|
|
@@ -79,3 +71,7 @@
|
|
79
71
|
};
|
80
72
|
|
81
73
|
request.send();
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
```
|
2
問題点のコードだけに編集しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -30,123 +30,7 @@
|
|
30
30
|
|
31
31
|
|
32
32
|
|
33
|
-
|
33
|
+
javascriptの情報を下記に記します。
|
34
|
-
|
35
|
-
HTML
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
```<!DOCTYPE html>
|
40
|
-
|
41
|
-
<html lang="en">
|
42
|
-
|
43
|
-
<head>
|
44
|
-
|
45
|
-
<meta charset="UTF-8">
|
46
|
-
|
47
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
48
|
-
|
49
|
-
<title>マンション、ビジネス、ショップ</title>
|
50
|
-
|
51
|
-
<link rel="stylesheet" type="text/css" href="sitakarauenisuraido(css).css">
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
<script async defer
|
56
|
-
|
57
|
-
src="https://maps.googleapis.com/maps/api/js?&callback=initMap"> //google API取得
|
58
|
-
|
59
|
-
</script>
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
<script src="allareamap.js"></script>
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
<script>
|
74
|
-
|
75
|
-
function slideUp(){
|
76
|
-
|
77
|
-
document.getElementById("slideup_content").style.top = "35px";
|
78
|
-
|
79
|
-
document.getElementById("slidebaUp").style.display="none";
|
80
|
-
|
81
|
-
document.getElementById("slidebaDown").style.display="block";
|
82
|
-
|
83
|
-
};
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
function slideDown(){
|
88
|
-
|
89
|
-
document.getElementById("slideup_content").style.top = "740px";
|
90
|
-
|
91
|
-
document.getElementById("slidebaUp").style.display="block";
|
92
|
-
|
93
|
-
document.getElementById("slidebaDown").style.display="none";
|
94
|
-
|
95
|
-
};
|
96
|
-
|
97
|
-
</script>
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
</head>
|
102
|
-
|
103
|
-
<body>
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
<div class="box">
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
<div id="map"></div>
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
<input type="button" id="slidebaUp" value="スライドアップ!" onclick="slideUp()">
|
116
|
-
|
117
|
-
<input type="button" id="slidebaDown" value="スライドダウン! " onclick="slideDown()">
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
<div id="slideup_content">
|
122
|
-
|
123
|
-
<!--ここにスライドアップしたときに表示したい内容を記述-->
|
124
|
-
|
125
|
-
<div id="mansyon">
|
126
|
-
|
127
|
-
</div>
|
128
|
-
|
129
|
-
<div id="business">
|
130
|
-
|
131
|
-
</div>
|
132
|
-
|
133
|
-
<div id="shop">
|
134
|
-
|
135
|
-
</div>
|
136
|
-
|
137
|
-
</div>
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
</div>
|
142
|
-
|
143
|
-
</body>
|
144
|
-
|
145
|
-
</html>
|
146
|
-
|
147
|
-
```
|
148
|
-
|
149
|
-
javascript
|
150
34
|
|
151
35
|
```
|
152
36
|
|
@@ -194,176 +78,4 @@
|
|
194
78
|
|
195
79
|
};
|
196
80
|
|
197
|
-
request.send();
|
81
|
+
request.send();
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
function setData(markerData){
|
202
|
-
|
203
|
-
var mansyon_html=""
|
204
|
-
|
205
|
-
var business_html=""
|
206
|
-
|
207
|
-
var shop_html=""
|
208
|
-
|
209
|
-
var icon;
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
for (var i = 0; i < markerData.results.length; i++) {
|
214
|
-
|
215
|
-
var markerLatLng = new google.maps.LatLng({
|
216
|
-
|
217
|
-
lat: Number(markerData.results[i]['lat']),
|
218
|
-
|
219
|
-
lng: Number(markerData.results[i]['lng'])
|
220
|
-
|
221
|
-
});
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
if (markerData.results[i]['種別'] === 'マンション情報'){
|
226
|
-
|
227
|
-
icon = new google.maps.MarkerImage('グリーンマーカー.png')
|
228
|
-
|
229
|
-
} else if(markerData.results[i]['種別']==='ビジネス情報'){
|
230
|
-
|
231
|
-
icon = new google.maps.MarkerImage('ピンクマーカー.png')
|
232
|
-
|
233
|
-
} else {
|
234
|
-
|
235
|
-
icon = new google.maps.MarkerImage('イエローマーカー.PNG');
|
236
|
-
|
237
|
-
}
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
marker[i] = new google.maps.Marker({
|
242
|
-
|
243
|
-
position: markerLatLng,
|
244
|
-
|
245
|
-
map: map,
|
246
|
-
|
247
|
-
icon:icon
|
248
|
-
|
249
|
-
});
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
var name = markerData.results[i]['name'];
|
254
|
-
|
255
|
-
var houmonritu=markerData.results[i]['訪問率']
|
256
|
-
|
257
|
-
var kuikiNo=markerData.results[i]['区域NO']
|
258
|
-
|
259
|
-
var type=markerData.results[i]['タイプ']
|
260
|
-
|
261
|
-
var caution=markerData.results[i]['注意事項']
|
262
|
-
|
263
|
-
var address = markerData.results[i]['address'];
|
264
|
-
|
265
|
-
var card = markerData.results[i]['card'];
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
if (markerData.results[i]['種別'] === 'マンション情報'){
|
272
|
-
|
273
|
-
var setHtml = name + houmonritu + '<br>' + kuikiNo + '<br>' + type +
|
274
|
-
|
275
|
-
'<br>'+caution+'<br>'+address+'<br>'+'<a href='+card+'>'+card+'</a>'
|
276
|
-
|
277
|
-
} else if(markerData.results[i]['種別'] === 'ビジネス情報'){
|
278
|
-
|
279
|
-
var setHtml = name + houmonritu + '<br>'+kuikiNo + '<br>' +type +
|
280
|
-
|
281
|
-
'<br>'+caution+'<br>'+address+'<br>'+'<a href='+card+'>'+card+'</a>'
|
282
|
-
|
283
|
-
}else{
|
284
|
-
|
285
|
-
var setHtml = name + houmonritu + '<br>'+kuikiNo + '<br>' +type +
|
286
|
-
|
287
|
-
'<br>'+caution+'<br>'+address+'<br>'+'<a href='+card+'>'+card+'</a>'
|
288
|
-
|
289
|
-
}
|
290
|
-
|
291
|
-
infoWindow[i] = new google.maps.InfoWindow({
|
292
|
-
|
293
|
-
content: setHtml
|
294
|
-
|
295
|
-
if (markerData.results[i]['種別'] === 'マンション情報'){
|
296
|
-
|
297
|
-
mansyon_html += '<a href="javascript:myclick(' + i + ')">' + name + houmonritu+'</a><br />';
|
298
|
-
|
299
|
-
}else if (markerData.results[i]['種別'] === 'ビジネス情報') {
|
300
|
-
|
301
|
-
business_html += '<a href="javascript:myclick(' + i + ')">' + name + houmonritu+'</a><br />';
|
302
|
-
|
303
|
-
}else{
|
304
|
-
|
305
|
-
shop_html += '<a href="javascript:myclick(' + i + ')">' + name + houmonritu+'</a><br />';
|
306
|
-
|
307
|
-
}
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
markerEvent(i);
|
312
|
-
|
313
|
-
}
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
document.getElementById("mansyon").innerHTML = '<input id="openClose" type="checkbox"></input>'+'マン
|
318
|
-
|
319
|
-
ション区域<br>' + mansyon_html;
|
320
|
-
|
321
|
-
document.getElementById("business").innerHTML = '<input id="openClose" type="checkbox"></input>'+'マン
|
322
|
-
|
323
|
-
ション区域<br>' + business_html;
|
324
|
-
|
325
|
-
document.getElementById("shop").innerHTML = '<input id="openClose" type="checkbox"></input>'+'ショップ
|
326
|
-
|
327
|
-
区域<br>' + shop_html;
|
328
|
-
|
329
|
-
}
|
330
|
-
|
331
|
-
}
|
332
|
-
|
333
|
-
var openWindow;
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
function markerEvent(i) {
|
338
|
-
|
339
|
-
marker[i].addListener('click', function() {
|
340
|
-
|
341
|
-
myclick(i);
|
342
|
-
|
343
|
-
});
|
344
|
-
|
345
|
-
}
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
function myclick(i) {
|
350
|
-
|
351
|
-
document.getElementById("slideup_content").style.top="740px";
|
352
|
-
|
353
|
-
document.getElementById("slidebaUp").style.display="block";
|
354
|
-
|
355
|
-
document.getElementById("slidebaDown").style.display="none";
|
356
|
-
|
357
|
-
if(openWindow){
|
358
|
-
|
359
|
-
openWindow.close();
|
360
|
-
|
361
|
-
}
|
362
|
-
|
363
|
-
infoWindow[i].open(map, marker[i]);
|
364
|
-
|
365
|
-
openWindow = infoWindow[i];
|
366
|
-
|
367
|
-
}
|
368
|
-
|
369
|
-
```
|
1
コードを```で囲みました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -34,7 +34,9 @@
|
|
34
34
|
|
35
35
|
HTML
|
36
36
|
|
37
|
+
|
38
|
+
|
37
|
-
<!DOCTYPE html>
|
39
|
+
```<!DOCTYPE html>
|
38
40
|
|
39
41
|
<html lang="en">
|
40
42
|
|
@@ -142,11 +144,11 @@
|
|
142
144
|
|
143
145
|
</html>
|
144
146
|
|
145
|
-
|
147
|
+
```
|
146
148
|
|
147
149
|
javascript
|
148
150
|
|
149
|
-
|
151
|
+
```
|
150
152
|
|
151
153
|
var map;
|
152
154
|
|
@@ -363,3 +365,5 @@
|
|
363
365
|
openWindow = infoWindow[i];
|
364
366
|
|
365
367
|
}
|
368
|
+
|
369
|
+
```
|