[OpenLayers-Users] Re: GetFeatureInfo map.events.register for *many* WMS layers

vrbikdan vrbikdan at gmail.com
Fri Apr 29 08:18:00 EDT 2011


Hi,
I haven't time and I have similar problem :(. I have six layers and I need
GetFeatureInfo to get their values. Now, when is some overlaps of two points
from different layers values only from one layer is shown. But I need both
values in one click and another values, when I click on the other point in
my map. I tried advices written in this topic, but anything works. Here is
part of my code:

map.events.register('click', map, function (e) {
                    document.getElementById('infoDiv').innerHTML =
"Loading... please wait...";
                    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: 'body2',
                        FEATURE_COUNT: 50,
                        Layers:
['dp:body2','dp:body3','dp:body4WGS84','dp:body5','dp:body6','dp:body7'],
                        Styles: '',
                        Srs: 'EPSG:900913',
                        WIDTH: map.size.w,
                        HEIGHT: map.size.h,
                        format: 'image/png'	};
                   
OpenLayers.loadURL("http://localhost:8080/geoserver/wms", params, this,
setHTML, setHTML);
                    event=e;
					//OpenLayers.Event.stop(e);
                });

this part of code is six times in my code, only difference is in
QUERY_LAYERS (it is messy, I know). Can you anyone help me?

Thanks for help,
Dan--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/GetFeatureInfo-map-events-register-for-many-WMS-layers-tp3644430p6316662.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list