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

geekjack geekjack at 163.com
Thu Aug 19 00:07:55 EDT 2010


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();
-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/How-to-re-format-the-tables-in-popups-tp5438892p5438892.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list