[OpenLayers-Users] WFSGetFeatureInfo and OpenLayers.Popup.FramedCloud

Raffaele Morelli raffaele.morelli at gmail.com
Fri May 10 06:09:30 PDT 2013


2013/5/10 Jerome A. Wendell <jawendell at suddenlink.net>

> Inside your getfeatureinfo request, use a conditional statement testing
> for features before the popup is called, such as:****
>
> ** **
>
>                 if(event.features.length > 0){****
>
>                 ..****
>
> ..****
>
> }****
>
> ** **
>
> Hope this helps,****
>
> ** **
>
> Jerome
>

It helps but the WMS request is sent anyway, but apart from that it doesn't
work
event.features.length=0 but the popup doesn't show up

Here is my code snippet

getfeatureinfo: function(event) {
                if(event.features.length > 0) {
                        map.addPopup(new OpenLayers.Popup.FramedCloud(
                            "sostegno",
                            map.getLonLatFromPixel(event.xy),
                            null,
                            event.text,
                            null,
                            true
                        ));
                    }
                }
            }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20130510/0e7ae3bb/attachment.html>


More information about the Users mailing list