为什么这样一段显示google map的代码在运行的时候看不到地图解决方法
为什么这样一段显示google map的代码在运行的时候看不到地图
------解决方案--------------------
可以看到地图啊
你的div style="width:80; height:80" 宽80 高80
- HTML code
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Detail.aspx.cs" Inherits="EMC.obj.Detail" %> <%@ Register src="../component/BannerModule.ascx" tagname="BannerModule" tagprefix="uc3" %> <%@ Register src="../component/ListModule.ascx" tagname="ListModule" tagprefix="uc4" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>EMC设备详情</title> <style type="text/css"> .style1 { width: 110px; } </style> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> <script type="text/javascript"> function initialize() { var latlng = new google.maps.LatLng(-34.397, 150.644); var myOptions = { zoom: 8, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); } </script> </head> <body onload="initialize()"> <form id="form1" runat="server"> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:EMCConnectionString %>" SelectCommand="SELECT [SiteName], [SiteID] FROM [MonitoringSite]"> </asp:SqlDataSource> <div> <uc3:BannerModule ID="BannerModule1" runat="server" /> <uc4:ListModule ID="ListModule1" runat="server" /> </div> <br /><br /> <table width="100%" border="0"> <tr> <td class="style1"> <asp:CheckBoxList ID="CheckBoxList1" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource1" DataTextField="SiteName" DataValueField="SiteID" > </asp:CheckBoxList> </td> <td> <%--google map操作--%> <div id="map_canvas" style="width:80; height:80"></div> </td> </tr> </table> </form> </body> </html>
------解决方案--------------------
可以看到地图啊
你的div style="width:80; height:80" 宽80 高80