Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm refactoring the code used to getfeatureinfo from geoserver running on port 8080 at The old version uses OpenLayers.loadURL and successfully requests the response from the server. The code is like:'click', map, function (e) {            
        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: layers_on,
                FEATURE_COUNT: 1,
                Layers: layers_on,
                Styles: '',
                WIDTH: map.size.w,
                HEIGHT: map.size.h,
                format: format,
                srs: map.layers[0].params.SRS};

                OpenLayers.loadURL("http://localhost:8080/geoserver/wms", params, this, setHTML, setHTML);
                OpenLayers.loadURL("", params, this, setHTML, setHTML);


With the new code I try something like this:

popup = new OpenLayers.Control.WMSGetFeatureInfo({
            url: offline ? 'http://localhost:8080/geoserver/wms' : '',
            layers: unbaseLayers,
            layerUrls: offline ? ['http://localhost:8080/geoserver/wms'] : [''],
            title: 'Identify features by clicking',
            queryVisible: true,
            maxFeatures: 1,
            eventListeners: {
                getfeatureinfo: function(event) {
                    if (console) {
                    if (event.text.length > 1088) { // nezobrazí prázdné bubliny
                        map.addPopup(new OpenLayers.Popup.FramedCloud(
                nogetfeatureinfo: function(event) {
                    if (console) {

If I look into Firebug network log, I see that the clicking the map doesn't send any request to the geoserver (it runs fine on localhost though). Is this just a proxy related problem? I've already read about need to set up a proxy when running geoserver on the different port than a website. But it's really puzzling me there is no request being sent. Might it be a typo? I can't see any.

What if I am not able to set up a proxy, do I have any other option?

PS: All I get as a result is object of nogetfeatureinfo type.

share|improve this question
up vote 1 down vote accepted

The problem is the cross-domain request. The problem is not related on which port Geoserver is listening, the problem is that you can't do an AJAX request (getFeatureInfo in your case) on different domains.


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.