- 注册时间
- 2014-4-3
- 最后登录
- 2014-5-29
- 阅读权限
- 10
- 积分
- 133
- 精华
- 0
- 帖子
- 32
|
本帖最后由 jissie丢 于 2014-4-8 11:06 编辑
问题:父页面弹出地图坐标弹框,子页面点击确定按钮关闭页面无效是怎么回事? 点击取消可以关闭页面。
父页面信息
<input id="btnMap" class="mini-buttonedit" name="a" textName="b" onbuttonclick="onButtonMap" />
//地图坐标
function onButtonMap(e) {
var btnEdit = this;
mini.open({
url: bootPATH + "../../ybt_window/map_window.aspx",
title: "地图坐标",
width: 690,
height: 570,
ondestroy: function (action) {
if (action == "ok") {
var iframe = this.getIFrameEl();
var data = iframe.contentWindow.GetData();
data = mini.clone(data); //必须
if (data) {
btnEdit.setValue(data.key);
btnEdit.setText(data.key);
}
}
}
});
}
子页面代码
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="map_window.aspx.cs" Inherits="ybtstore.Web.ybt_admins.ybt_window.map_window" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
body, html, #allmap { width: 100%; height: 100%; overflow: hidden; hidden; margin: 0; }
</style>
<link href="../ybt_inc/css/demo.css" rel="stylesheet" />
<script src="../ybt_inc/js/boot.js"></script>
<script src="../ybt_inc/js/jquery-1.6.2.min.js"></script>
<script src="../ybt_inc/js/common.js"></script>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=P7GiMdauXeoRpcWLul11byAn"></script>
<title>地图标记</title>
</head>
<body>
<div class="mini-toolbar" style="text-align:center;line-height:30px;" borderStyle="border:0;">
<label >名称:</label>
<input id="key" class="mini-textbox" style="width:150px;"/>
<a class="mini-button" style="width:60px;">查询</a>
</div>
<div class="mini-fit">
<div style="width: 635px; height: 445px; border: 1px solid gray" id="allmap"></div>
</div>
<div class="mini-toolbar" style="text-align:center;padding-top:8px;padding-bottom:8px;" borderStyle="border:0;">
<a class="mini-button" style="width:60px;" onclick="onOk()">确定</a>
<span style="display:inline-block;width:25px;"></span>
<a class="mini-button" style="width:60px;" onclick="onCancel()">取消</a>
</div>
</body>
</html>
<script type="text/javascript">
//////////////////////////////////
function CloseWindow(action) {
if (window.CloseOwnerWindow) return window.CloseOwnerWindow(action);
else window.close();
}
function onOk() {
CloseWindow("ok");
}
function onCancel() {
CloseWindow("cancel");
}
var lat = Request['lat'];
var lon = Request['lon'];
if (lat == "null" || lat == null) {
lat = 31.23515;
lon = 121.523329;
}
// 百度地图API功能
var map = new BMap.Map("allmap", {
enableMapClick: false
});
var point = new BMap.Point(lon, lat);
map.centerAndZoom(new BMap.Point(lon, lat), 14);
var marker1 = new BMap.Marker(point); // 创建标注
map.addOverlay(marker1); // 将标注添加到地图中
</script>
|
|