teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

3

細かい修正2

2016/02/21 15:28

投稿

Motsu
Motsu

スコア17

title CHANGED
File without changes
body CHANGED
@@ -30,6 +30,6 @@
30
30
 
31
31
 
32
32
  var contentString = shopN.title;
33
- var infowindow = new google.maps.InfoWindow({ content: contentString });
33
+ var infowindowN = new google.maps.InfoWindow({ content: contentString });
34
- google.maps.event.addListener(shopN, 'click', function() { infowindow.open(map,shopN); });
34
+ google.maps.event.addListener(shopN, 'click', function() { infowindowN.open(map,shopN); });
35
35
  ```

2

細かい修正

2016/02/21 15:28

投稿

Motsu
Motsu

スコア17

title CHANGED
File without changes
body CHANGED
@@ -18,12 +18,12 @@
18
18
 
19
19
  ```
20
20
  var contentString = shop1.title;
21
- var infowindow = new google.maps.InfoWindow({ content: contentString });
21
+ var infowindow1 = new google.maps.InfoWindow({ content: contentString });
22
- google.maps.event.addListener(shop1, 'click', function() { infowindow.open(map,shop1); });
22
+ google.maps.event.addListener(shop1, 'click', function() { infowindow1.open(map,shop1); });
23
23
 
24
24
  var contentString = shop2.title;
25
- var infowindow = new google.maps.InfoWindow({ content: contentString });
25
+ var infowindow2 = new google.maps.InfoWindow({ content: contentString });
26
- google.maps.event.addListener(shop2, 'click', function() { infowindow.open(map,shop2); });
26
+ google.maps.event.addListener(shop2, 'click', function() { infowindow2.open(map,shop2); });
27
27
 
28
28
 
29
29
 

1

Infowindowの後にもショップの配列番号●●が必要だったので追記

2016/02/21 15:28

投稿

Motsu
Motsu

スコア17

title CHANGED
File without changes
body CHANGED
@@ -9,8 +9,8 @@
9
9
 
10
10
  // 店舗情報を元に「shop●●」を自動出力
11
11
  var contentString = shop●●.title;
12
- var infowindow = new google.maps.InfoWindow({ content: contentString });
12
+ var infowindow●● = new google.maps.InfoWindow({ content: contentString });
13
- google.maps.event.addListener(shop●●, 'click', function() { infowindow.open(map,shop●●); });
13
+ google.maps.event.addListener(shop●●, 'click', function() { infowindow●●.open(map,shop●●); });
14
14
  ```
15
15
 
16
16
  [参考]