質問編集履歴
6
文字修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -30,7 +30,7 @@
|
|
30
30
|
|
31
31
|
|
32
32
|
|
33
|
-
firefoxの開発ツール&エミュレーター(アドオ
|
33
|
+
firefoxの開発ツール&エミュレーター(アドオン:User-Agent Switcher)ではiOS Safari12.1.1の場合、select内のoptionは選択できない状況にあります。
|
34
34
|
|
35
35
|
※展開しません。
|
36
36
|
|
5
経過報告
test
CHANGED
File without changes
|
test
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
|
13
13
|
|
14
14
|
|
15
|
-
**【問題点】Windows10(firefox・Chrome)では問題無く表示動作しているのですが、スマートフォン(Android9 Google Chorme・iPhone Safari ※iOSバージョン不明)において、挙動がおかしな状況にありま・・・。**
|
15
|
+
**【問題点】Windows10(firefox・Chrome)では問題無く表示動作しているのですが、スマートフォン(Android9 Google Chorme・iPhone Safari ※iOSバージョン不明)において、挙動がおかしな状況にあります・・・。**
|
16
16
|
|
17
17
|
|
18
18
|
|
@@ -24,7 +24,9 @@
|
|
24
24
|
|
25
25
|
|
26
26
|
|
27
|
-
clickイベントが適用されているのが原因か?とも思ったのですが、touchend等に変更しても改善出来ませんでした。(iPhoneは未確認なので後日確認予定です)
|
27
|
+
clickイベントが適用されているのが原因か?とも思ったのですが、touchend等に変更しても改善出来ませんでした。(~~iPhoneは未確認なので後日確認予定です~~)
|
28
|
+
|
29
|
+
※確認してもらいましたが、やはり改善されない状況の様です。
|
28
30
|
|
29
31
|
|
30
32
|
|
4
スペルミス修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
|
13
13
|
|
14
14
|
|
15
|
-
**【問題点】Windows10(firefox・Chrome)では問題無く表示動作しているのですが、スマートフォン(Android9 Google Chorme・iPhone Safari ※iOSバージョン不明)において、挙動がおかしな状況にありま
|
15
|
+
**【問題点】Windows10(firefox・Chrome)では問題無く表示動作しているのですが、スマートフォン(Android9 Google Chorme・iPhone Safari ※iOSバージョン不明)において、挙動がおかしな状況にありま・・・。**
|
16
16
|
|
17
17
|
|
18
18
|
|
3
test
CHANGED
File without changes
|
test
CHANGED
@@ -106,9 +106,9 @@
|
|
106
106
|
|
107
107
|
|
108
108
|
|
109
|
-
<link rel="stylesheet" href="/leaf
|
109
|
+
<link rel="stylesheet" href="/leaflet/leaflet.css">
|
110
|
-
|
110
|
+
|
111
|
-
<link rel="stylesheet" href="/leaf
|
111
|
+
<link rel="stylesheet" href="/leaflet/L.Control.Zoominfo.css">
|
112
112
|
|
113
113
|
|
114
114
|
|
@@ -116,19 +116,19 @@
|
|
116
116
|
|
117
117
|
|
118
118
|
|
119
|
-
<script src="/leaf
|
119
|
+
<script src="/leaflet/leaflet.js"></script>
|
120
|
-
|
120
|
+
|
121
|
-
<script src="/leaf
|
121
|
+
<script src="/leaflet/L.Control.Zoominfo.js"></script>
|
122
|
-
|
123
|
-
|
124
|
-
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
-
<link rel="stylesheet" href="/leaf
|
125
|
+
<link rel="stylesheet" href="/leaflet/leaflet.locationlist.css">
|
126
|
-
|
126
|
+
|
127
|
-
<script src="/leaf
|
127
|
+
<script src="/leaflet/leaflet.locationlist.js"></script>
|
128
|
-
|
129
|
-
|
130
|
-
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
-
<script src="/leaf
|
131
|
+
<script src="/leaflet/map.js"></script>
|
132
132
|
|
133
133
|
</head>
|
134
134
|
|
@@ -260,7 +260,7 @@
|
|
260
260
|
|
261
261
|
var iconRed = L.icon({
|
262
262
|
|
263
|
-
iconUrl: 'leaf
|
263
|
+
iconUrl: 'leaflet/img/ico/ico1-red.png',
|
264
264
|
|
265
265
|
iconSize: [25, 41],
|
266
266
|
|
@@ -268,7 +268,7 @@
|
|
268
268
|
|
269
269
|
tooltipAnchor:[2, -45],
|
270
270
|
|
271
|
-
shadowUrl: 'leaf
|
271
|
+
shadowUrl: 'leaflet/img/ico/ico0-shadow.png',
|
272
272
|
|
273
273
|
shadowSize: [26, 9],
|
274
274
|
|
2
変数スペルミス修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -172,7 +172,7 @@
|
|
172
172
|
|
173
173
|
|
174
174
|
|
175
|
-
var Nora
|
175
|
+
var NormalView = L.tileLayer('https://cyberjapandata.gsi.go.jp/xyz/pale/{z}/{x}/{y}.png', {
|
176
176
|
|
177
177
|
attribution: "<a href='https://maps.gsi.go.jp/development/ichiran.html' target='_blank'>地理院タイル</a>",
|
178
178
|
|
@@ -192,7 +192,7 @@
|
|
192
192
|
|
193
193
|
|
194
194
|
|
195
|
-
Nora
|
195
|
+
NormalView.addTo(map);
|
196
196
|
|
197
197
|
|
198
198
|
|
@@ -220,7 +220,7 @@
|
|
220
220
|
|
221
221
|
|
222
222
|
|
223
|
-
map.removeLayer(Nora
|
223
|
+
map.removeLayer(NormalView);
|
224
224
|
|
225
225
|
map.removeLayer(LargeView);
|
226
226
|
|
@@ -238,13 +238,13 @@
|
|
238
238
|
|
239
239
|
|
240
240
|
|
241
|
-
map.removeLayer(Nora
|
241
|
+
map.removeLayer(NormalView);
|
242
242
|
|
243
243
|
map.removeLayer(LargeView);
|
244
244
|
|
245
245
|
|
246
246
|
|
247
|
-
Nora
|
247
|
+
NormalView.addTo(map);
|
248
248
|
|
249
249
|
|
250
250
|
|
1
ソースコードを追加しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -35,3 +35,401 @@
|
|
35
35
|
|
36
36
|
|
37
37
|
お手数おかけしますが宜しくお願いします。
|
38
|
+
|
39
|
+
必用なファイルと修正を加えたコードは以下をご覧ください。
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
---
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
**◆追加したファイル。**
|
48
|
+
|
49
|
+
**leaflet.css**
|
50
|
+
|
51
|
+
**leaflet.js**
|
52
|
+
|
53
|
+
[https://github.com/Leaflet/Leaflet](https://github.com/Leaflet/Leaflet)
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
**L.Control.Zoominfo.css**
|
58
|
+
|
59
|
+
**L.Control.Zoominfo.js**
|
60
|
+
|
61
|
+
[https://github.com/flaviocarmo/Leaflet.zoominfo/](https://github.com/flaviocarmo/Leaflet.zoominfo/)
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
**leaflet.locationlist.css**
|
66
|
+
|
67
|
+
**leaflet.locationlist.js**
|
68
|
+
|
69
|
+
[https://github.com/mithron/leaflet.locationlist](https://github.com/mithron/leaflet.locationlist)
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
**◆以下追加及び変更したファイル**
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
**◆leaflet.locationlist.js**
|
80
|
+
|
81
|
+
文字数制限で入力できませんでしたのでご了承ください。
|
82
|
+
|
83
|
+
leaflet.locationlist.js 内の **click** を **touchend** に変更しました。
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
**◆map.html**
|
90
|
+
|
91
|
+
```ここに言語を入力
|
92
|
+
|
93
|
+
<!DOCTYPE html>
|
94
|
+
|
95
|
+
<html lang="ja">
|
96
|
+
|
97
|
+
<head>
|
98
|
+
|
99
|
+
<meta charset="UTF-8">
|
100
|
+
|
101
|
+
<meta name="viewport" content="width=device-width, user-scalable=no, maximum-scale=1.0, minimum-scale=1.0">
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
<title>MAP SAMPLE</title>
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
<link rel="stylesheet" href="/leafret/leaflet.css">
|
110
|
+
|
111
|
+
<link rel="stylesheet" href="/leafret/L.Control.Zoominfo.css">
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
<script src="/leafret/leaflet.js"></script>
|
120
|
+
|
121
|
+
<script src="/leafret/L.Control.Zoominfo.js"></script>
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
<link rel="stylesheet" href="/leafret/leaflet.locationlist.css">
|
126
|
+
|
127
|
+
<script src="/leafret/leaflet.locationlist.js"></script>
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
<script src="/leafret/map.js"></script>
|
132
|
+
|
133
|
+
</head>
|
134
|
+
|
135
|
+
<body onload="init()">
|
136
|
+
|
137
|
+
<div id="map" style="width:960px;height:700px"></div>
|
138
|
+
|
139
|
+
</body>
|
140
|
+
|
141
|
+
</html>
|
142
|
+
|
143
|
+
```
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
**◆map.js**
|
148
|
+
|
149
|
+
```ここに言語を入力
|
150
|
+
|
151
|
+
function init() {
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
var map = L.map('map',{
|
156
|
+
|
157
|
+
preferCanvas: true,
|
158
|
+
|
159
|
+
minZoom: 11,
|
160
|
+
|
161
|
+
maxZoom: 18,
|
162
|
+
|
163
|
+
zoominfoControl: true,
|
164
|
+
|
165
|
+
zoomControl: false
|
166
|
+
|
167
|
+
});
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
map.setView([35.681230987174175, 139.76694817590177], 11);
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
var NoramlView = L.tileLayer('https://cyberjapandata.gsi.go.jp/xyz/pale/{z}/{x}/{y}.png', {
|
176
|
+
|
177
|
+
attribution: "<a href='https://maps.gsi.go.jp/development/ichiran.html' target='_blank'>地理院タイル</a>",
|
178
|
+
|
179
|
+
opacity: 1.0
|
180
|
+
|
181
|
+
})
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
var LargeView = L.tileLayer('https://cyberjapandata.gsi.go.jp/xyz/pale/{z}/{x}/{y}.png', {
|
186
|
+
|
187
|
+
attribution: "<a href='https://maps.gsi.go.jp/development/ichiran.html' target='_blank'>地理院タイル</a>",
|
188
|
+
|
189
|
+
opacity: 0.5
|
190
|
+
|
191
|
+
})
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
NoramlView.addTo(map);
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
map.zoominfoControl.setPosition('bottomright');
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
var zoomFlag = true;
|
208
|
+
|
209
|
+
var zoom = "";
|
210
|
+
|
211
|
+
map.on('zoom', function () {
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
zoom = map.getZoom();
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
if (zoom >= 14 && zoomFlag == true) {
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
map.removeLayer(NoramlView);
|
224
|
+
|
225
|
+
map.removeLayer(LargeView);
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
LargeView.addTo(map);
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
zoomFlag = false;
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
}else if (zoom < 14 && zoomFlag == false) {
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
map.removeLayer(NoramlView);
|
242
|
+
|
243
|
+
map.removeLayer(LargeView);
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
NoramlView.addTo(map);
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
zoomFlag = true;
|
252
|
+
|
253
|
+
}
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
})
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
var iconRed = L.icon({
|
262
|
+
|
263
|
+
iconUrl: 'leafret/img/ico/ico1-red.png',
|
264
|
+
|
265
|
+
iconSize: [25, 41],
|
266
|
+
|
267
|
+
iconAnchor: [9, 41],
|
268
|
+
|
269
|
+
tooltipAnchor:[2, -45],
|
270
|
+
|
271
|
+
shadowUrl: 'leafret/img/ico/ico0-shadow.png',
|
272
|
+
|
273
|
+
shadowSize: [26, 9],
|
274
|
+
|
275
|
+
shadowAnchor: [-2, 10]
|
276
|
+
|
277
|
+
});
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
var LocationVal = [];
|
282
|
+
|
283
|
+
var markerList = [
|
284
|
+
|
285
|
+
{ marker_name:"東京タワー", marker_latlng:[35.65859791456946, 139.74541144061445], marker_url:"https://www.tokyotower.co.jp/" ,marker_direction:"top", marker_zoom:18 },
|
286
|
+
|
287
|
+
{ marker_name:"東京スカイツリー", marker_latlng:[35.71008010331086, 139.81071112712235], marker_url:"https://www.tokyo-skytree.jp/" ,marker_direction:"top", marker_zoom:18 },
|
288
|
+
|
289
|
+
{ marker_name:"上野動物園", marker_latlng:[35.716976132736804, 139.7712747831497], marker_url:"https://www.tokyo-zoo.net/zoo/ueno/" ,marker_direction:"top", marker_zoom:18 }
|
290
|
+
|
291
|
+
];
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
var HtmlContents = [];
|
298
|
+
|
299
|
+
var DirectionVal = "";
|
300
|
+
|
301
|
+
var OffsetVal = "";
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
|
306
|
+
|
307
|
+
var iconMarkers = L.featureGroup();
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
var AddClassName = [];
|
312
|
+
|
313
|
+
for (var i=0; i<markerList.length; i++) {
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
HtmlContents[i] = '<div class="Tooltip"><strong class="block">' + markerList[i].marker_name + '</strong></div>';
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
if(markerList[i].marker_direction == 'bottom') {
|
322
|
+
|
323
|
+
DirectionVal = 'bottom';
|
324
|
+
|
325
|
+
OffsetVal = L.point(2, 45);
|
326
|
+
|
327
|
+
}
|
328
|
+
|
329
|
+
else if(markerList[i].marker_direction == 'right') {
|
330
|
+
|
331
|
+
DirectionVal = 'right';
|
332
|
+
|
333
|
+
OffsetVal = L.point(20, 17);
|
334
|
+
|
335
|
+
}
|
336
|
+
|
337
|
+
else if(markerList[i].marker_direction == 'left') {
|
338
|
+
|
339
|
+
DirectionVal = 'left';
|
340
|
+
|
341
|
+
OffsetVal = L.point(-20, 17);
|
342
|
+
|
343
|
+
}else{
|
344
|
+
|
345
|
+
DirectionVal = 'top';
|
346
|
+
|
347
|
+
OffsetVal = L.point(0, 0);
|
348
|
+
|
349
|
+
}
|
350
|
+
|
351
|
+
|
352
|
+
|
353
|
+
LocationVal[i] = markerList[i]["marker_url"];
|
354
|
+
|
355
|
+
|
356
|
+
|
357
|
+
|
358
|
+
|
359
|
+
iconMarkers.addLayer( L.marker(
|
360
|
+
|
361
|
+
markerList[i].marker_latlng,{title:markerList[i].marker_name,icon:iconRed}).bindTooltip(HtmlContents[i],{
|
362
|
+
|
363
|
+
permanent:true,direction:DirectionVal,offset:OffsetVal
|
364
|
+
|
365
|
+
}) );
|
366
|
+
|
367
|
+
|
368
|
+
|
369
|
+
iconMarkers.addTo(map);
|
370
|
+
|
371
|
+
|
372
|
+
|
373
|
+
}
|
374
|
+
|
375
|
+
|
376
|
+
|
377
|
+
map.fitBounds(iconMarkers.getBounds());
|
378
|
+
|
379
|
+
|
380
|
+
|
381
|
+
MarkerSet(markerList, map);
|
382
|
+
|
383
|
+
|
384
|
+
|
385
|
+
}
|
386
|
+
|
387
|
+
|
388
|
+
|
389
|
+
function MarkerSet(markerList, map) {
|
390
|
+
|
391
|
+
|
392
|
+
|
393
|
+
var locList = [];
|
394
|
+
|
395
|
+
|
396
|
+
|
397
|
+
$(".leaflet-marker-pane img").each(function(i) {
|
398
|
+
|
399
|
+
|
400
|
+
|
401
|
+
locList.push( { title: markerList[i]["marker_name"] , latlng: markerList[i]["marker_latlng"], zoom: markerList[i]["marker_zoom"] } );
|
402
|
+
|
403
|
+
|
404
|
+
|
405
|
+
if(markerList[i]["marker_url"] != "") {
|
406
|
+
|
407
|
+
$(this).on('click', function() {
|
408
|
+
|
409
|
+
location.href = markerList[i]["marker_url"];
|
410
|
+
|
411
|
+
});
|
412
|
+
|
413
|
+
}
|
414
|
+
|
415
|
+
|
416
|
+
|
417
|
+
})
|
418
|
+
|
419
|
+
|
420
|
+
|
421
|
+
var locListCtrl = new L.control.locationlist({
|
422
|
+
|
423
|
+
locationsList: locList,
|
424
|
+
|
425
|
+
showList:true
|
426
|
+
|
427
|
+
});
|
428
|
+
|
429
|
+
map.addControl(locListCtrl);
|
430
|
+
|
431
|
+
|
432
|
+
|
433
|
+
}
|
434
|
+
|
435
|
+
```
|