|
打开页面,只显示一小点地图,如下图:
调整IE窗口大小后(点“最大化”和“向下还原”按钮)后,地图的图像变大了,如下图:
偶尔一打开也能全部打开地图,请大家帮帮忙呀!谢谢哈!
代码如下:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LkdWeb.aspx.cs" Inherits="AppBox.Client.LkdWeb" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>访问用户界面事件中的参数</title>
<style type="text/css">
#maps
{
height: 500px;
}
</style>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&language=zh-CN"></script>
<script language="javascript" type="text/javascript">
var map;
//初始化
function initialize() {
var Latlng = new google.maps.LatLng(39.363882, 116.044922);
var Options = {
zoom: 6, center: Latlng, mapTypeId: google.maps.MapTypeId.ROADMAP
}
map = new google.maps.Map(document.getElementById("maps"), Options);
//在点击地图处添加图标
google.maps.event.addListener(map, "click", function (event) {
placeMarker(event.latLng);
});
}
function placeMarker(location) {
//创建图标,并将图标标题设置为点击地址
var clickedLocation = new google.maps.LatLng(location);
var address = location.lat() + "," + location.lng();
var marker = new google.maps.Marker({
position: location, map: map, title: address
});
map.setCenter(location);
//弹出点击地理位置
alert(address);
}
//在window的load事件中加载地图
google.maps.event.addDomListener(window, "load", initialize);
</script>
</head>
<body>
<form id="form1" runat="server">
<xageManager ID="ageManager1" AutoSizePanelID="anel1" runat="server" />
<xanel ID="anel1" runat="server" BodyPadding="5px" EnableLargeHeader="false" EnableBackgroundColor="true"
ShowBorder="false" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start"
ShowHeader="false" Title="用户管理">
<Items>
<x:Form ID="Form2" runat="server" Height="36px" BodyPadding="5px" ShowHeader="false"
ShowBorder="false" LabelAlign="Right" EnableBackgroundColor="true">
<Rows>
<x:FormRow ID="FormRow1" runat="server">
<Items>
<x:TextBox ID="txt_weidu" runat="server" Label="纬度" Text=""></x:TextBox>
<x:TextBox ID="txt_jingdu" Label="经度" Text="" runat="server"></x:TextBox>
<x:Button ID="btnChaXun" Icon="StyleGo" runat="server" Text="查询" />
</Items>
</x:FormRow>
</Rows>
</x:Form>
<x:ContentPanel ID="ContentPanel1" runat="server" BodyPadding="5px"
EnableBackgroundColor="true" ShowBorder="true" ShowHeader="False">
<div id="maps">
</div>
</x:ContentPanel>
</Items>
</xanel>
</form>
</body>
</html>
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|