質問編集履歴
1
修正コードの追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -61,3 +61,85 @@
|
|
61
61
|
###試したこと
|
62
62
|
|
63
63
|
map.panTo(latlng)をmap.panTo(map.latlng)に変えてみたり、とんちんかんな手探り修正を試みましたが解決できませんでした。ネームスペースの問題なんだろうとは思うのですが、どう修正すればよいでしょうか?
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
###追加で試したこと
|
68
|
+
|
69
|
+
htmlの内容
|
70
|
+
|
71
|
+
```
|
72
|
+
|
73
|
+
<head>
|
74
|
+
|
75
|
+
<script src="//maps.google.com/maps/api/js?key=XXX"></script>
|
76
|
+
|
77
|
+
<script type="text/javascript" src="js/set.js"></script>
|
78
|
+
|
79
|
+
</head>
|
80
|
+
|
81
|
+
```
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
set.jsの内容
|
86
|
+
|
87
|
+
```
|
88
|
+
|
89
|
+
/******************/
|
90
|
+
|
91
|
+
/* Google Map *****/
|
92
|
+
|
93
|
+
function initialize() {
|
94
|
+
|
95
|
+
var latlng = new google.maps.LatLng(35.681298, 139.7662469);
|
96
|
+
|
97
|
+
var myOptions = {
|
98
|
+
|
99
|
+
zoom: 18,
|
100
|
+
|
101
|
+
center: latlng,
|
102
|
+
|
103
|
+
mapTypeId: google.maps.MapTypeId.LOADMAP,
|
104
|
+
|
105
|
+
scrollwheel: false,
|
106
|
+
|
107
|
+
disableDefaultUI: false,
|
108
|
+
|
109
|
+
};
|
110
|
+
|
111
|
+
var map = new google.maps.Map(document.getElementById('googlemaps'), myOptions);
|
112
|
+
|
113
|
+
var lopanMarker = new google.maps.Marker({
|
114
|
+
|
115
|
+
position: latlng,
|
116
|
+
|
117
|
+
map: map,
|
118
|
+
|
119
|
+
});
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
google.maps.event.addDomListener(window, "resize", function() {
|
124
|
+
|
125
|
+
var center = map.getCenter();
|
126
|
+
|
127
|
+
google.maps.event.trigger(map, "resize");
|
128
|
+
|
129
|
+
map.setCenter(center);
|
130
|
+
|
131
|
+
});
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
var styledMapOptions = { name: '東京駅' }
|
136
|
+
|
137
|
+
}
|
138
|
+
|
139
|
+
google.maps.event.addDomListener(window, 'load', initialize);
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
/******************/
|
144
|
+
|
145
|
+
```
|