質問編集履歴

1

よりわかりやすく

2017/07/21 04:10

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -22,10 +22,26 @@
22
22
 
23
23
  作成中のコードは以下になります。
24
24
 
25
-
26
-
27
25
  どうかお力添えの程よろしくお願い申し上げます。
28
26
 
27
+
28
+
29
+ html▼
30
+
31
+ ```
32
+
33
+ <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
34
+
35
+ <script src="以下のjsのパス" charset="UTF-8"></script>
36
+
37
+ <div id="map_canvas-1"></div>
38
+
39
+ ```
40
+
41
+
42
+
43
+ js▼
44
+
29
45
  ```
30
46
 
31
47
  var currentInfoWindow = null;
@@ -128,21 +144,21 @@
128
144
 
129
145
 
130
146
 
131
- //−−−−−−−−−−−マーカ3−−−−−−−−−−−−−
147
+ //−−−−−−−−−−−マーカ2−−−−−−−−−−−−−
132
-
148
+
133
- var LatLng3 = new google.maps.LatLng(34.4718128,134.3301713);
149
+ var LatLng2 = new google.maps.LatLng(34.4718128,134.3301713);
134
-
150
+
135
- var contentString3 =
151
+ var contentString2 =
136
152
 
137
153
  '<div class="mapbox">test2</div>';
138
154
 
139
- var infowindow3 = new google.maps.InfoWindow({
155
+ var infowindow2 = new google.maps.InfoWindow({
140
-
156
+
141
- content: contentString3
157
+ content: contentString2
142
-
158
+
143
- });
159
+ });
144
-
160
+
145
- var image3 = new google.maps.MarkerImage('sample.png',
161
+ var image2 = new google.maps.MarkerImage('sample.png',
146
162
 
147
163
  new google.maps.Size(55, 72),
148
164
 
@@ -150,7 +166,7 @@
150
166
 
151
167
  new google.maps.Point(0, 32));
152
168
 
153
- var shadow3 = new google.maps.MarkerImage('http://maps.google.co.jp/mapfiles/ms/icons/rail.shadow.png',
169
+ var shadow2 = new google.maps.MarkerImage('http://maps.google.co.jp/mapfiles/ms/icons/rail.shadow.png',
154
170
 
155
171
  new google.maps.Size(64, 64),
156
172
 
@@ -158,17 +174,17 @@
158
174
 
159
175
  new google.maps.Point(0, 32));
160
176
 
161
- var marker3 = new google.maps.Marker({
177
+ var marker2 = new google.maps.Marker({
162
-
178
+
163
- position: LatLng3,
179
+ position: LatLng2,
164
180
 
165
181
  map: map,
166
182
 
167
183
  title: "test2",
168
184
 
169
- icon: image3,
185
+ icon: image2,
170
-
186
+
171
- shadow: shadow3,
187
+ shadow: shadow2,
172
188
 
173
189
  animation: google.maps.Animation.DROP
174
190
 
@@ -178,7 +194,7 @@
178
194
 
179
195
  //★インフォウィンドウ1つだけ表示
180
196
 
181
- google.maps.event.addListener(marker3, 'click', function() { //★クリックアクション
197
+ google.maps.event.addListener(marker2, 'click', function() { //★クリックアクション
182
198
 
183
199
  if (currentInfoWindow) {
184
200
 
@@ -186,9 +202,9 @@
186
202
 
187
203
  }
188
204
 
189
- infowindow3.open(map, marker3);
205
+ infowindow2.open(map, marker2);
190
-
206
+
191
- currentInfoWindow = infowindow3;
207
+ currentInfoWindow = infowindow2;
192
208
 
193
209
  });
194
210