我正在使用Google图书馆时间在地图上显示它。Google天气预报图表
我遇到的问题是显示的第一个窗口非常小,必须滚动。 如何控制此窗口的大小?
其次,我只想显示我给出的坐标的地图,并向我展示我想要的最少时间。我怎么做?
这是我在here代码:
function generartiempo(36.745,-3.87665,'mapatiempo') {
var mapOptions = {
zoom: 11,
center: new google.maps.LatLng(lat,lng,true),
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var infowindow = new google.maps.InfoWindow();
var map = new google.maps.Map(document.getElementById('mapatiempo'),
mapOptions);
var weatherLayer = new google.maps.weather.WeatherLayer({
temperatureUnits: google.maps.weather.TemperatureUnit.CELSIUS,
windSpeedUnit: google.maps.weather.WindSpeedUnit.KILOMETERS_PER_HOUR
});
weatherLayer.setMap(weatherLayer.getMap() ? null : map);
var cloudLayer = new google.maps.weather.CloudLayer();
cloudLayer.setMap(map);
}
<div id="mapatiempo"></div>
#mapatiempo {
width: 268px;
height: 200px;
border: 1px solid #AAAAA8;
margin-bottom: 5px;
margin-top: 15px;
}
谁能帮助? 编辑示例:http://jsfiddle.net/webyseo/YW2K7/12/ 解决方案? 谢谢!!!!!
您的意思是“使用Google图书馆的时间在地图上显示它”,您的意思是天气预报? –
您是否在问如何更改显示的地图大小? – geocodezip
如果我使用此文档https://developers.google.com/maps/documentation/javascript/layers# WeatherLayer – jcarlosweb