【发布时间】:2013-01-21 12:41:58
【问题描述】:
我正在使用 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/ 解决方案? 谢谢!!!!!!
【问题讨论】:
-
“使用谷歌图书馆时间在地图上显示”到底是什么意思,是指天气预报吗?
-
您是在问如何更改显示的地图大小吗?
-
如果我使用这个文档developers.google.com/maps/documentation/javascript/layers# WeatherLayer
-
不,更改信息的窗口大小,而不是地图。当你点击你的例如你打开一个窗口并看起来滚动
-
更新jsfiddle.net/webyseo/YW2K7/12 请帮帮我?谢谢