[OpenLayers-Users] WMSGetFeatureInfo with Proxy - blocked by server?

zimmi zimmicz at gmail.com
Thu Mar 21 02:17:46 PDT 2013


Hi,
I'm running a Geoserver on Tomcat listening on port 8080. If I try to use a
proxy to push a request to the Geoserver, I only get a nogetfeatureinfo
event. Please see the code below:

OpenLayers.ProxyHost = "proxy.php?url=";

var infoControls = 
        {
            click: new OpenLayers.Control.WMSGetFeatureInfo
                ({
                    url: 'http://edpp.cz:8080/geoserver/wms',
                    title: 'WMS GetFeatureInfo',
                    layers: unbaseLayers,
                    queryVisible: true,
                    maxFeatures: 1,
                    infoFormat: 'text/plain',//'application/vnd.ogc.gml',
                    eventListeners: {
                        beforegetfeatureinfo: function(e) {
                            console.log(e);
                            var layers = [];
                            for (var a = map.layers.length-1 ; a >= 0; a -=
1)  {
                                if (map.layers[a].params.LAYERS != 0 &&
map.layers[a].params.LAYERS != map.baseLayer.params.LAYERS &&
map.layers[a].params.LAYERS.indexOf('zabaged') === -1) {
                                    layers.push(map.layers[a]);
                                }
                            }
                            this.layers = layers;
                        },

                        getfeatureinfo: function(event) {
                            popup = new OpenLayers.Popup.FramedCloud(
                                "chicken",
                                map.getLonLatFromPixel(event.xy),
                                null,
                                GenPopText(event),
                                null,
                                true
                            );
                            if (map.popups[0]) {
                                map.popups[0].destroy();
                            }
                            map.addPopup(popup);
                        },
                        nogetfeatureinfo: function(event) {
                            console.log(event);
                        }
                    }
                })

        };


    infoControls['click'].events.register("getfeatureinfo", this, null);
    map.addControl(infoControls['click']);
    infoControls.click.activate();

This code *works* both on my localhost and a hosting I use for my personal
homepage. However, if I use it on a Geoserver hosting, it fails to send the
request. That's the strangest part of the problem.

As i am not an expert on setting proxies, tomcat etc., I'm looking for a
hint. Might this be anything hosting related - e. g. tomcat blocking the
request?

Thank you.



--
View this message in context: http://osgeo-org.1560.n6.nabble.com/WMSGetFeatureInfo-with-Proxy-blocked-by-server-tp5041994.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list