[OpenLayers-Users] queryVisible doesn't seem to work

Jaled Alcaraz soulstriker at gmail.com
Thu Oct 13 15:47:06 EDT 2011


Hi all!

I'm really new to the GIS and JavaScript world and I'm creating my project.

I have a problem making that only the info in the visible layers of my map
return info.
I'm using a GetFeatureInfo code generated by GeoServer, here it is.

                // setup layers
                tiled = new OpenLayers.Layer.WMS(
                    "Geoserver layers - Tiled",
"http://soulstriker.homeip.net:8080/geoserver/wms",
                    {
                        LAYERS: 'faja5:provi_f5',
                        STYLES: '',
                        format: format,
                        tilesOrigin : map.maxExtent.left + ',' +
map.maxExtent.bottom
                    },
                    {
                        buffer: 0,
                        displayOutsideMaxExtent: true,
                        isBaseLayer: true
                    } 
                );
				
                tiled3 = new OpenLayers.Layer.WMS(
                    "Geoserver layers - Tiled3",
"http://soulstriker.homeip.net:8080/geoserver/wms",
                    {
                        LAYERS: 'faja5:provi_f5',
                    },
                    {
                        isBaseLayer: false
                    } 
                );
				
                tiled2 = new OpenLayers.Layer.WMS(
                    "Geoserver layers - Tiled2",
"http://soulstriker.homeip.net:8080/geoserver/wms",
                    {
                        LAYERS: 'faja5:munis',
						transparent: "true",
						format: "image/png",
						visibility: false,
						//singleTile:true
                    },
                    {
                        isBaseLayer: false
                    } 
                );
				
        
                map.addLayers([tiled,tiled2]);

map.events.register('click', map, function (e) {
    document.getElementById('nodelist').innerHTML = "Cargando... espere por
favor...";
    var params = {
    REQUEST: "GetFeatureInfo",
    EXCEPTIONS: "application/vnd.ogc.se_xml",
	BBOX: map.getExtent().toBBOX(),
    SERVICE: "WMS",
    VERSION: "1.1.1",
    X: e.xy.x,
    Y: e.xy.y,
    INFO_FORMAT: 'text/html',
    QUERY_LAYERS: "faja5:munis,faja5:provi_f5",
    FEATURE_COUNT: 50,
    Layers: "faja5:munis,faja5:provi_f5",
    WIDTH: map.size.w,
    HEIGHT: map.size.h,
    format: format,
	queryVisible: true,
    styles: map.layers[0].params.STYLES,
    srs: map.layers[0].params.SRS};
    // merge filters
    if(map.layers[0].params.CQL_FILTER != null) {
		params.cql_filter = map.layers[0].params.CQL_FILTER;
	} 
    if(map.layers[0].params.FILTER != null) {
		params.filter = map.layers[0].params.FILTER;
	}
    if(map.layers[0].params.FEATUREID) {
		params.featureid = map.layers[0].params.FEATUREID;
    }
    OpenLayers.loadURL("http://soulstriker.homeip.net:8080/geoserver/wms",
params, this, setHTML, setHTML);
    OpenLayers.Event.stop(e);
});

When I load the map a click somewhere, it doesn't matter with layer is
visible, it allways shows data from all the layers.

Any help?

Thank you!

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/queryVisible-doesn-t-seem-to-work-tp6890292p6890292.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list