[OpenLayers-Users] How to re-format the tables in popups?

geekjack geekjack at 163.com
Fri Aug 20 03:49:40 EDT 2010


Yes you are right ,I am making it right! Thank you!

At 2010-08-19 17:52:29,"Sveen Atle Frenvik (Geomatikk IKT) [via OSGeo.org]" <ml-node+5439553-1421303118-281288 at n2.nabble.com> wrote:
Re: [OpenLayers-Users] How to re-format the tables in popups?

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
[hidden email]




_______________________________________________
Users mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/users



View message @http://osgeo-org.1803224.n2.nabble.com/How-to-re-format-the-tables-in-popups-tp5438892p5439553.html
To unsubscribe from How to re-format the tables in popups?,click here.


-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/How-to-re-format-the-tables-in-popups-tp5438892p5443445.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100820/0528e52a/attachment.html


More information about the Users mailing list