[OpenLayers-Users] Popup can not be closed when zooming

Ivan Grcic igrcic at gmail.com
Thu Jun 11 04:45:54 EDT 2009


Hi Asle, this migh help also, especiall if you are using some strategy
like BBOX with wfs layer:

wfsLayer.events.register('loadstart', this, function (evt){
        if(selectedFeature && selectedFeature.popup){
            selectControls.unselect(PARAMS.selectedFeature);
           //selectControls.unselectAll();  <= this might also work
        }
}

i was banging my head with this one for some time, then i figured out
that features are NOT being unselected before they are removed from
the layer (BBOX has changed => new features are fetched)

that way the popup stays on map but that feature that the popup has
been opened on doesnt exist anymore, and there was no way to close the
popup.
registering loadstart event and unselecting feature there before the
strategy loads new features did the job!

hope it helps someone,

cheers

On Tue, Jun 9, 2009 at 2:15 PM, Alexandre Dube<adube at mapgears.com> wrote:
> Hi,
>
>  Just put a break point on this line :
>            if (*feature.popup[]*= null){
>
>  Then, using the "script" tag and at the right the "watch" tab, you will
> then be able to see all variables and object currently available,
> including "this" (which should be your map object).
>
>  There's plenty of tutorials on the web that could help.  Just google
> "firebug how to use" for example.
>
> Best of luck,
>
> Alexandre
>
>
> Asle Benoni wrote:
>> Ok. Not really sure where to put this, when does it fire?
>>
>>         function checkPopup(feature) {
>>             if (*feature.popup[]*= null){
>>             feature.popup.destroy();
>>             }
>>         }
>>
>>         map.events.register("moveend", map, checkPopup);
>> I have FireBug but do not really know what to check :-(
>>
>> Forgive my small knowledge here.
>>
>> /asle
>>
>
>
> --
> Alexandre Dubé
> Mapgears
> www.mapgears.com
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>



-- 
Ivan Grcic



More information about the Users mailing list