<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7654.12">
<TITLE>Re: [OpenLayers-Users] How to re-format the tables in popups?</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>As you are using getFeatureInfo you are displaying a table generated by<BR>
your wms-server (which seems to be Geoserver, right?).<BR>
<BR>
In that case I guess the simplest fix is to edit the getfeatureInfo<BR>
templete in geoserver, as described here:<BR>
<A HREF="http://geoserver.org/display/GEOSDOC/GetFeatureInfo+templates">http://geoserver.org/display/GEOSDOC/GetFeatureInfo+templates</A><BR>
<BR>
<BR>
(technically i guess you could try and alter the returned html in<BR>
javascript, but i wouldn't go there...)<BR>
<BR>
-atle<BR>
<BR>
On 08/19/2010 06:07 AM, geekjack wrote:<BR>
> <A HREF="http://osgeo-org.1803224.n2.nabble.com/file/n5438892/popup.png">http://osgeo-org.1803224.n2.nabble.com/file/n5438892/popup.png</A><BR>
><BR>
> Hi All!<BR>
> See the Image ?<BR>
> I use the codes below to get features , and the features showed like<BR>
> that which is a long and unfriendly table in the map.<BR>
> now I got two problems:<BR>
> (1)I just want some attributes of the clicked feature. for example .<BR>
> when I click the map on the "WY",I just want the popup show its "state_name"<BR>
> and "state_fips" of "WY",<BR>
> (2) and the next step I want to do is puting the data in a more<BR>
> friendly tableļ¼such as this:<BR>
> <A HREF="http://osgeo-org.1803224.n2.nabble.com/file/n5438892/2.png">http://osgeo-org.1803224.n2.nabble.com/file/n5438892/2.png</A> ,<BR>
> what should be change and how? thank you!!<BR>
><BR>
> part of my codes:<BR>
> var state = new OpenLayers.Layer.WMS(<BR>
> "state 2","<A HREF="http://localhost:8081/geoserver/wms">http://localhost:8081/geoserver/wms</A>",<BR>
> {<BR>
> layers: 'topp:states',<BR>
> styles: '',<BR>
> srs: 'EPSG:4326',<BR>
> format: format<BR>
> } );<BR>
> info = new OpenLayers.Control.WMSGetFeatureInfo({<BR>
> url: '<A HREF="http://localhost:8081/geoserver/wms'">http://localhost:8081/geoserver/wms'</A>,<BR>
> title: 'Identify features by clicking',<BR>
> queryVisible: true,<BR>
> eventListeners: {<BR>
> getfeatureinfo: function(event){<BR>
> if(event.text.length != 687) {<BR>
> map.addPopup(new OpenLayers.Popup.FramedCloud(<BR>
> "chicken",<BR>
> map.getLonLatFromPixel(event.xy),<BR>
> null,<BR>
> event.text,<BR>
> null,<BR>
> true<BR>
> ));<BR>
> }<BR>
> }<BR>
> }<BR>
> });<BR>
> map.addControl(info);<BR>
> info.activate();<BR>
> <BR>
<BR>
<BR>
--<BR>
Atle Frenvik Sveen<BR>
Utvikler<BR>
Geomatikk IKT AS<BR>
tlf: 45 27 86 89<BR>
atle.frenvik.sveen@geomatikk.no<BR>
<BR>
</FONT>
</P>
</BODY>
</HTML>