AW: [OpenLayers-Users] Re: one attribute from getFeatureInfo

vrbikdan vrbikdan at gmail.com
Fri Mar 30 08:38:48 EDT 2012


Hi,
as it's written earlier. My way is changing INFO_FORMAT in WMS layer to gml,
next I used code from Lucia so result is here:

info = new OpenLayers.Control.WMSGetFeatureInfo({
            url: "http://localhost:8080/geoserver/zk/wms", 
            title: 'Identify features by clicking',
            queryVisible: true,
	    layers: '',
	    eventListeners: {
                getfeatureinfo: function(event) {
			for (var i = 0; i < event.features.length; i++) {
                       var feature = event.features[i];
                       var attributes = feature.attributes;
			alert(attributes.zona); }}} //zona is attribute I want
			});
			
map.addControl(info);
info.activate();

If you want one attribute in popup, you will have to try combine it ;)

Dan

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/one-attribute-from-getFeatureInfo-tp4636316p4671191.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list