[OpenLayers-Users] features.length is 0 (beginner question)

juhulian hansfux1 at web.de
Sun Sep 18 05:40:46 EDT 2011


Hi there,
I'm using the standard example for a getfeatureinfo popup and now I want to
use some of the attribute data of the feature that was clicked, but the
event.features array is just empty when I try the alert... 

 info = new OpenLayers.Control.WMSGetFeatureInfo({
            url: 'http://localhost:8080/geoserver/wms/', 
            title: 'Identify features by clicking',
            queryVisible: true,
            eventListeners: {
            getfeatureinfo: function(event) {
                    alert(event.features.length);
                    map.addPopup(new OpenLayers.Popup.FramedCloud(
                        "chicken", //id
                        map.getLonLatFromPixel(event.xy), //koord auf dem
event
                        null, //contentsize
                        event.text, //contentHtml
                        null, //anchor
                        true //closeBox
                    ),true);  
                }
            }
        });

any help is appreciated,
julian

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/features-length-is-0-beginner-question-tp6805453p6805453.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list