【发布时间】:2014-09-01 12:18:27
【问题描述】:
我在此应用程序中添加了一个文本框和搜索按钮。我想输入一个位置并单击搜索按钮,然后它会显示带有天气详细信息的适当位置。我尝试了很多方法,但都行不通。所以谁有代码,然后请与我分享。 谢谢你。
<!DOCTYPE html>
<html>
<head id="Head1" runat="server">
<meta charset="utf-8">
<title>Weather layer</title>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&libraries=weather"></script>
<script>
function initialize() {
var mapOptions = {
center: new google.maps.LatLng(12.9667, 77.5667),
zoom: 6,
mapTypeId: google.maps.MapTypeId.WeatherLayer
};
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);
</script>
</head>
<body>
<form id="form1" runat="server">
<div id="map-canvas"style="height:400px;width:400px;"></div>
<asp:Button ID="Button1" runat="server" Text="Proceed" />
<input id="searchTextField" type="text" size="50"style="height:auto;width:320px;">
</form>
</body>
</html>
【问题讨论】:
-
那么问题出在哪里?似乎 GridView 中只有 2 列或更少的列
-
记住列是从零开始的
-
GridView1.Columns[2].Visible = false;
-
@Cheese 我在 gridview 中有 4 列。我想通过单击按钮删除或隐藏运行时列之一。?
标签: c# asp.net google-maps google-weather-api