[OpenLayers-Users] Select Output data from Multi layer

Zuhex gmduky at hotmail.com
Fri Apr 23 15:46:43 EDT 2010


Hello,

I am new for GeoServer and Openlayers. I am used GeoServer 2. 
I have created my map by merge mulit layers. I am used Layer Preview
function in GeoServer with multi layers for preview.So when I click on my
map in order to see the output data (I mean the detail of that point). It
had shown the data of every layers.

My question, 
How can I see my specification output data, such as layer number 2,without
the output data of other layers.


Thanks in advance

(My GetFeatureInfo code)

     var info = new OpenLayers.Control.WMSGetFeatureInfo({
            url: 'http://localhost:8080/geoserver/wms', 
            title: 'Identify features by clicking',
            queryVisible: true,
            eventListeners: {
                getfeatureinfo: function(event) {
                    map.addPopup(new OpenLayers.Popup.FramedCloud(
                        "chicken", 
                        map.getLonLatFromPixel(event.xy),
                        null,
                        event.text,
                        null,
                        true
                    ));
                }
            }
        });		
		map.addControl(info);
        info.activate(); 
        map.addControl(new OpenLayers.Control.LayerSwitcher());
				
	// wire up the option button
                // support GetFeatureInfo
                map.events.register('click', map, function (e) {
                    document.getElementById('nodelist').innerHTML =
"Loading... please wait...";
					if(map.layers[0].visibility==true) {
                    var params = {
                        REQUEST: "GetFeatureInfo",
                        EXCEPTIONS: "application/vnd.ogc.se_xml",
                        BBOX: map.getExtent().toBBOX(),
                        X: e.xy.x,
                        Y: e.xy.y,
                        INFO_FORMAT: 'text/html',
                        QUERY_LAYERS: map.layers[0].params.LAYERS,
                        FEATURE_COUNT: 50,
                        Srs: 'EPSG:24047',
                        WIDTH: map.size.w,
                        HEIGHT: map.size.h,
                        format: format};
                   
OpenLayers.loadURL("http://localhost:8080/geoserver/wms", params, this,
setHTML, setHTML); 
						}
                    OpenLayers.Event.stop(e);
                });
            }
-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Select-Output-data-from-Multi-layer-tp4952344p4952344.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list