openlayersgeoservergetfeatureinfo

Geoserver GetFeatureInfo WMS Requests Do Not Work When Using GeoWebCache Layer


I have been trying for the last few days to get my map GeoWebCache layers from Geoserver to display GetFeatureInfo in a popup event. When I was using WMS layers, GetFeatureInfo was working as requested. Ever since I started caching my layers using GeoWebCache, I am unable to GetFeatureInfo. So far I think I am supposed to proxy my WMS server, but honestly I really have no idea what to do. IF anyone knows anything or has suggestions I'd really really appreciate it and thank you for taking your time to help me.

elshae


Solution

  • Finally I have stumbled across here:

    http://getsatisfaction.com/opengeo/topics/error_in_wmsgetfeatureinfo#reply_2612983

    new OpenLayers.Control.WMSGetFeatureInfo({
    
        url: "http://localhost:8080/geoserver/wms", 
    
        layerUrls: ["http://localhost:8080/geoserver/gwc/service/wms"],
    
        title: 'Identify features by clicking',
    
        queryVisible: true
    
    });
    

    Turns out what I was missing was layerUrls: ["http://localhost:8080/geoserver/gwc/service/wms"]

    This means: consider the layerUrls (i.e. your gwc urls), but issue requests to the url (i.e. your wms url).

    elshae