As you are using getFeatureInfo you are displaying a table generated by your wms-server (which seems to be Geoserver, right?).
In that case I guess the simplest fix is to edit the getfeatureInfo templete in geoserver, as described here: http://geoserver.org/display/GEOSDOC/GetFeatureInfo+templates (technically i guess you could try and alter the returned html in javascript, but i wouldn't go there...) -atle On 08/19/2010 06:07 AM, geekjack wrote: > http://osgeo-org.1803224.n2.nabble.com/file/n5438892/popup.png > > Hi All! > See the Image ? > I use the codes below to get features , and the features showed like > that which is a long and unfriendly table in the map. > now I got two problems: > (1)I just want some attributes of the clicked feature. for example . > when I click the map on the "WY",I just want the popup show its "state_name" > and "state_fips" of "WY", > (2) and the next step I want to do is puting the data in a more > friendly tableļ¼such as this: > http://osgeo-org.1803224.n2.nabble.com/file/n5438892/2.png , > what should be change and how? thank you!! > > part of my codes: > var state = new OpenLayers.Layer.WMS( > "state 2","http://localhost:8081/geoserver/wms", > { > layers: 'topp:states', > styles: '', > srs: 'EPSG:4326', > format: format > } ); > info = new OpenLayers.Control.WMSGetFeatureInfo({ > url: 'http://localhost:8081/geoserver/wms', > title: 'Identify features by clicking', > queryVisible: true, > eventListeners: { > getfeatureinfo: function(event){ > if(event.text.length != 687) { > map.addPopup(new OpenLayers.Popup.FramedCloud( > "chicken", > map.getLonLatFromPixel(event.xy), > null, > event.text, > null, > true > )); > } > } > } > }); > map.addControl(info); > info.activate(); > -- Atle Frenvik Sveen Utvikler Geomatikk IKT AS tlf: 45 27 86 89 atle.frenvik.sv...@geomatikk.no
_______________________________________________ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users