<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000099" bgcolor="#ffffff">
<small><font face="Verdana">"this" in the callback function should
point to the related pop-up. So, using this.feature should
achieve your ultimate goal, if you create a reference to the
feature when creating the pop-up.<br>
<br>
Janis</font></small><br>
<br>
On 2011.06.09. 20:49, JK Chen wrote:
<blockquote
cite="mid:75E6E48D29E14B4C93DA8ADFCA6D205A0BE7CCF6@Mercury.usurf.usu.edu"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="Generator" content="Microsoft Word 14 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
h3
        {mso-style-priority:9;
        mso-style-link:"Heading 3 Char";
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:13.5pt;
        font-family:"Times New Roman","serif";}
h4
        {mso-style-priority:9;
        mso-style-link:"Heading 4 Char";
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.Heading3Char
        {mso-style-name:"Heading 3 Char";
        mso-style-priority:9;
        mso-style-link:"Heading 3";
        font-family:"Times New Roman","serif";
        font-weight:bold;}
span.Heading4Char
        {mso-style-name:"Heading 4 Char";
        mso-style-priority:9;
        mso-style-link:"Heading 4";
        font-family:"Times New Roman","serif";
        font-weight:bold;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I am trying to figure out a way to access
the owner poup that contains closebox, when the close box is
clicked.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Searching for API, I don’t see a way. Any
idea? <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">A feature in my program owns the popup. My
ultimate goal is access the feature object in the CloseBox
event handler.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks for your help.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">JK<o:p></o:p></p>
<p class="MsoNormal">-----------------------<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style=""><b><span style="font-size: 13.5pt;
font-family: "Times New
Roman","serif";">addCloseBox<o:p></o:p></span></b></p>
<table class="MsoNormalTable" border="0" cellpadding="0"
cellspacing="0">
<tbody>
<tr>
<td style="padding: 0in;">
<table class="MsoNormalTable" border="0" cellpadding="0"
cellspacing="0">
<tbody>
<tr>
<td style="padding: 0in;" nowrap="nowrap">
<p class="MsoNormal"><span style="font-size:
12pt; font-family: "Times New
Roman","serif";">addCloseBox:
function(<o:p></o:p></span></p>
</td>
<td style="padding: 0in;" nowrap="nowrap">
<p class="MsoNormal"><span style="font-size:
12pt; font-family: "Times New
Roman","serif";">callback<o:p></o:p></span></p>
</td>
<td style="padding: 0in;" nowrap="nowrap">
<p class="MsoNormal"><span style="font-size:
12pt; font-family: "Times New
Roman","serif";">)<o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style=""><b><span style="font-size: 12pt;
font-family: "Times New
Roman","serif";">Parameters<o:p></o:p></span></b></p>
<table class="MsoNormalTable" border="0" cellpadding="0"
cellspacing="0">
<tbody>
<tr>
<td style="padding: 0in;">
<p class="MsoNormal"><span style="font-size: 12pt;
font-family: "Times New
Roman","serif";">callback<o:p></o:p></span></p>
</td>
<td style="padding: 0in;">
<p class="MsoNormal"><span style="font-size: 12pt;
font-family: "Times New
Roman","serif";"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size: 12pt;
font-family: "Times New
Roman","serif";">{Function} The
callback to be called when the close button is
clicked.<o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="padding: 0in;">
<div style="border-width: medium medium 1pt;
border-style: none none solid; border-color:
-moz-use-text-color -moz-use-text-color windowtext;
padding: 0in 0in 1pt;">
<p class="MsoNormal" style="border: medium none;
padding: 0in;"><span style="font-size: 12pt;
font-family: "Times New
Roman","serif";"><o:p> </o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-size: 12pt;
font-family: "Times New
Roman","serif";">
closeBoxCallBack = function (evt)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size: 12pt;
font-family: "Times New
Roman","serif";">
{<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size: 12pt;
font-family: "Times New
Roman","serif";">
//this.data.selected = false;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size: 12pt;
font-family: "Times New
Roman","serif";">
//polygon1.data.selected = false;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size: 12pt;
font-family: "Times New
Roman","serif";">
//vector_layer.drawFeature(polygon1);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size: 12pt;
font-family: "Times New
Roman","serif";">
console.log("closeBoxCallBack called ",
evt.target);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size: 12pt;
font-family: "Times New
Roman","serif";">
//polygon1.popup.hide();<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size: 12pt;
font-family: "Times New
Roman","serif";">
});<o:p></o:p></span></p>
</td>
<td style="padding: 0in;">
<p class="MsoNormal"><span style="font-size: 12pt;
font-family: "Times New
Roman","serif";"><o:p> </o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/openlayers-users">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a>
</pre>
</blockquote>
</body>
</html>