0

現在、Googleマップを使用して、最初に天気と雲のGoogleマップレイヤーを使用して米国の地図を表示し、地理位置情報GoogleマップAPIを使用してユーザーの場所にズームインしようとしています. 現在の私の問題は、天気、雲、地理位置情報のいずれも表示せずに、iframe 基本ビュー モード マップ API のみを使用してマップを表示することしかできないことです。私はjavascriptを初めて使用しますが、bodyタグに「map-canvas」というIDのdivがあり、headタグにjavascriptファイルmapWeather.jsがあります。

mapWeather.js:

function initialize() {
var mapOptions = {
zoom: 4,
center: new google.maps.LatLng(37.6,-95.665)
};

var map = new google.maps.Map(document.getElementById('map-canvas'),
  mapOptions);

var weatherLayer = new google.maps.weather.WeatherLayer({
temperatureUnits: google.maps.weather.TemperatureUnit.FAHRENHEIT
});
weatherLayer.setMap(map);

var cloudLayer = new google.maps.weather.CloudLayer();
cloudLayer.setMap(map);
}

 google.maps.event.addDomListener(window, 'load', initialize);
4

1 に答える 1