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 having trouble with a select feature example in Geoserver and open layers. For some reason the request returns nothing.

Here's the stripped down version that produces this:

I have a small wms layer(~100 parcels) with polygons, and address data that I am overlaying Google Maps with a projection. It displays correctly.

map = map(...); //standard map creation
gmap = ...; // standard street map creation
wmslayer = new OpenLayers.Layer.WMS(
            {'layers': 'test:parcel', 'format':'image/png', 'transparent':'true'},
            {'opacity': 0.5, 'isBaseLayer': false, 'visibility' : false, 'zoomMin' : 15}

Then I create the click control...

infoControls = 
            click: new OpenLayers.Control.WMSGetFeatureInfo
                url: '', 
                title: 'Get parcel data',
                layers: [wmslayer],
                queryVisible: true

Added the layers, add the control and activate it

map.addLayers([gmap, wmslayer]);

infoControls[0].events.register("getfeatureinfo", this, showInfo);

//show info callback
function showInfo(evt) {    

But when i click on the map inside I parcel, it gives the alert is blank, and so is the features in firebug (from console.log(evt)).

The GET request in firebug is red.

BBOX    -10845148.716676,5165071.048543,-10843335.725912,5166002.624825
FORMAT  image/png
INFO_FORMAT text/html
LAYERS  test:parcel
QUERY_LAYERS    test:parcel
REQUEST GetFeatureInfo
SRS EPSG:900913
WIDTH   759
X   582
Y   246

Edit: The database is CRS is 4327 and projecting it to Google Mercator... Do I need to project the BBox of the request back to 4327 before I send the WMS request? How can I do this?

Here is the Geoserver log of the request

2011-07-22 14:49:01,301 INFO [geoserver.wms] - 
Request: getFeatureInfo
    GetMapRequest = 
GetMap Request
 version: 1.1.1
 output format: image/png
 width height: 759,390
 bbox: ReferencedEnvelope[-1.0845637448332E7 : -1.0842011466804E7, 5164278.964868 : 5166142.117432]
 layers: test:parcel
 styles: polygon
    QueryLayers = [org.geoserver.wms.MapLayerInfo@a837896f]
    XPixel = 385
    YPixel = 144
    FeatureCount = 10
    InfoFormat = text/html
    Exceptions = application/vnd.ogc.se_xml
    Version = 1.1.1
    Request = GetFeatureInfo
    BaseUrl =
    Get = false
    RawKvp = {INFO_FORMAT=text/html, BBOX=-10845637.448332,5164278.964868,-10842011.466804,5166142.117432, QUERY_LAYERS=test:parcel, SERVICE=WMS, HEIGHT=390, REQUEST=GetFeatureInfo, STYLES=, WIDTH=759, FEATURE_COUNT=10, VERSION=1.1.1, FORMAT=image/png, LAYERS=test:parcel, Y=144, X=385, SRS=EPSG:900913}
    RequestCharset = null
share|improve this question
You made sure WMS is enabled on your geoserver? – CaptDragon Jul 22 '11 at 16:31
Can you post firebugs response? or is it not present? – CaptDragon Jul 22 '11 at 16:32
@capdragon Hello! Yes WMS is enabled. The response section is blank. – Nate Jul 22 '11 at 16:46
is the page served from the same address as your geoserver? if not you'll need a proxy – iant Jul 22 '11 at 17:47
if the ports are different then you need a proxy or to relay the tomcat/geoserver through apache see – iant Jul 23 '11 at 10:04
up vote 2 down vote accepted

So mostly for future readers of this question - when you are doing getFeatureInfo requests to a different server (which includes a difference in the port number) you need a proxy - see for more discussion.

share|improve this answer
I have the same issue with openlayers 3. Pl see this question ... ->… – Parth Trivedi Dec 5 '15 at 6:06

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.