"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.

Janis

On 2011.06.09. 20:49, JK Chen wrote:

Hi,

I am trying to figure out a way to access the owner poup that contains closebox, when the close box is clicked.

Searching for API, I don’t see a way. Any idea?

A feature in my program owns the popup. My ultimate goal is access the feature object in the CloseBox event handler.

Thanks for your help.

JK

-----------------------

*addCloseBox*

addCloseBox: function(

        

callback

        

)

*Parameters*

callback

        

{Function} The callback to be called when the close button is clicked.

closeBoxCallBack = function (evt)

                                                   {

//this.data.selected = false;

//polygon1.data.selected = false;

//vector_layer.drawFeature(polygon1);

console.log("closeBoxCallBack called ", evt.target);

//polygon1.popup.hide();

                                                   });

        


_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to