[OpenLayers-Users] Popup CloseBox event hander, how to reference
the popup box from the handler
Janis Elmeris
janis.elmeris at intelligentsystems.lv
Thu Jul 28 09:08:46 EDT 2011
"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
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110728/be44eaf3/attachment-0001.html
More information about the Users
mailing list