<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Control_Positioning.aspx.cs"
    Inherits="Samples.Controls.Control_Positioning" %>

<!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>控件定位</title>
    <style type="text/css">
        #maps
        {
            height: 450px;
        }
    </style>

    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&language=zh-CN"></script>

    <script type="text/javascript" language="javascript">

        //地图初始化函数
        function initialize() {
            var Options = {
                zoom: 12,
                center: new google.maps.LatLng(-28.643387, 153.612224),
                mapTypeId: google.maps.MapTypeId.ROADMAP,
                mapTypeControl: true,
                mapTypeControlOptions: {
                    style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,  //MapType 控件以下拉列表形式展现
                    position: google.maps.ControlPosition.BOTTOM  //MapType 控件显示在底部
                },
                navigationControl: true,
                navigartionControlOptions: { style: google.maps.NavigationControlStyle.ZOOM_PAN, //导航控件显示为带有平移控件的标准缩放滑块控件
                    position: google.maps.ControlPosition.TOP_RIGHT//显示在顶部右侧
                },
                scaleControl: true,
                scaleControlOptions: {
                    position: google.maps.ControlPosition.TOP_LEFT//显示在顶部左侧
                }
            }
            var map = new google.maps.Map(document.getElementById("maps"), Options); //创建地图实例

        }
        google.maps.event.addDomListener(window, "load", initialize); //将地图初始化函数绑定到window的load事件
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div id="maps">
    </div>
    </form>
</body>
</html>

posted on 2010-10-21 15:22  WQL.NET  阅读(149)  评论(0编辑  收藏  举报