[Geoserver-users] GWC Layers Do Not Return GetFeatureInfo

Hello Geoserver List,

I have been checking the Geoserver and GeoWebCache documentation for days
and I do not know how to have my cached layers return the getfeatureinfo on
my WMS server. I understand that the two are in different locations, but I
would imagine that the popup would still generate the feature info without
issues. I am very grateful for your time and considerations.

//One of my Layers:

var tib_townships = new OpenLayers.Layer.WMS(
                        "Townships",
"http://localhost:8080/geoserver/gwc/service/wms", {layers:
'cite:tib_townships', transparent: true}, {isBaseLayer: false,
displayInLayerSwitcher: true, visibility: true, minScale:
3466752.1306573446}
                   );

//Here is my popup code:

var info = new OpenLayers.Control.WMSGetFeatureInfo({
                      url: 'http://localhost:8080/geoserver/wms’,
                      title: 'Identify features by clicking',
                      queryVisible: true,
                      eventListeners: {
                          getfeatureinfo: function(event){
                             map.addPopup( new
OpenLayers.Popup.AnchoredBubble(
                                  "chicken",
                                  map.getLonLatFromPixel(event.xy),
                                  null,
                                   event.text,
                                  null,
                                  true
                                  
                              ));

I should mention I've also tried url:
'http://localhost:8080/geoserver/gwc/service/wms’, and when I do this, my
browser is attempting to send a request somewhere...why does it ignore it
completely with url: 'http://localhost:8080/geoserver/wms’, I mean I would
expect for a request to at least be attempted :?

I should also point out that using GWC layers are making my map legend
useless as it seems it is not picking up my SLD for points and lines...

Sincerely,

elshae

--
View this message in context: http://old.nabble.com/GWC-Layers-Do-Not-Return-GetFeatureInfo-tp30088025p30088025.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

GWC is not a proxy for WMS, so it won’t handle the other operations like GetFeatureInfo etc… At least not on 2.0.x. I beleive on trunk Gabriel has been working on gwc acting as a true proxy but i am not sure about how far long that is.

As for your GetFeatureInfo request not working against geoserver directly my guess would be the same origin policy. Anything other than an image must come from the same server that is serving up your openlayers app. Where are you are running your OL map from? So you either have to proxy for geoserver on the same host/port you are accessing your html from, or run your OL from localhost:8080 by putting it into the www directory inside of the geoserver data directory.

-Justin

On Fri, Oct 29, 2010 at 12:02 PM, elshae <itintern12@anonymised.com> wrote:

Hello Geoserver List,

I have been checking the Geoserver and GeoWebCache documentation for days
and I do not know how to have my cached layers return the getfeatureinfo on
my WMS server. I understand that the two are in different locations, but I
would imagine that the popup would still generate the feature info without
issues. I am very grateful for your time and considerations.

//One of my Layers:

var tib_townships = new OpenLayers.Layer.WMS(
“Townships”,
http://localhost:8080/geoserver/gwc/service/wms”, {layers:
‘cite:tib_townships’, transparent: true}, {isBaseLayer: false,
displayInLayerSwitcher: true, visibility: true, minScale:
3466752.1306573446}
);

//Here is my popup code:

var info = new OpenLayers.Control.WMSGetFeatureInfo({
url: ‘http://localhost:8080/geoserver/wms’,
title: ‘Identify features by clicking’,
queryVisible: true,
eventListeners: {
getfeatureinfo: function(event){
map.addPopup( new
OpenLayers.Popup.AnchoredBubble(
“chicken”,
map.getLonLatFromPixel(event.xy),
null,
event.text,
null,
true

));

I should mention I’ve also tried url:
http://localhost:8080/geoserver/gwc/service/wms’, and when I do this, my
browser is attempting to send a request somewhere…why does it ignore it
completely with url: ‘http://localhost:8080/geoserver/wms’, I mean I would
expect for a request to at least be attempted :?

I should also point out that using GWC layers are making my map legend
useless as it seems it is not picking up my SLD for points and lines…

Sincerely,

elshae


View this message in context: http://old.nabble.com/GWC-Layers-Do-Not-Return-GetFeatureInfo-tp30088025p30088025.html
Sent from the GeoServer - User mailing list archive at Nabble.com.


Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev


Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users


Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

It doesn’t seem to be the same origin policy…The code I showed above is from an HTML file in the www directory, and I am providing the feature info popup with a url of ‘http://localhost:8080/geoserver/wms’. When I check firebug, nothing comes up in the console window. It’s like it doesn’t even make the attempt to send the request to Geoserver and I really don’t understand why not. Even more so because when I provide the popup with the url of ‘http://localhost:8080/geoserver/gwc/service/wms’, an request is sent but of course nothing is returned since there is no data there. I really appreciate your feedback Justin :), if anyone can suggest anything else that would be great too since I still cannot make sense of this behavior.

Thank you,

elshae

On Mon, Nov 1, 2010 at 10:15 AM, Justin Deoliveira <jdeolive@anonymised.com> wrote:

GWC is not a proxy for WMS, so it won’t handle the other operations like GetFeatureInfo etc… At least not on 2.0.x. I beleive on trunk Gabriel has been working on gwc acting as a true proxy but i am not sure about how far long that is.

As for your GetFeatureInfo request not working against geoserver directly my guess would be the same origin policy. Anything other than an image must come from the same server that is serving up your openlayers app. Where are you are running your OL map from? So you either have to proxy for geoserver on the same host/port you are accessing your html from, or run your OL from localhost:8080 by putting it into the www directory inside of the geoserver data directory.

-Justin

On Fri, Oct 29, 2010 at 12:02 PM, elshae <itintern12@anonymised.com> wrote:

Hello Geoserver List,

I have been checking the Geoserver and GeoWebCache documentation for days
and I do not know how to have my cached layers return the getfeatureinfo on
my WMS server. I understand that the two are in different locations, but I
would imagine that the popup would still generate the feature info without
issues. I am very grateful for your time and considerations.

//One of my Layers:

var tib_townships = new OpenLayers.Layer.WMS(
“Townships”,
http://localhost:8080/geoserver/gwc/service/wms”, {layers:
‘cite:tib_townships’, transparent: true}, {isBaseLayer: false,
displayInLayerSwitcher: true, visibility: true, minScale:
3466752.1306573446}
);

//Here is my popup code:

var info = new OpenLayers.Control.WMSGetFeatureInfo({
url: ‘http://localhost:8080/geoserver/wms’,
title: ‘Identify features by clicking’,
queryVisible: true,
eventListeners: {
getfeatureinfo: function(event){
map.addPopup( new
OpenLayers.Popup.AnchoredBubble(
“chicken”,
map.getLonLatFromPixel(event.xy),
null,
event.text,
null,
true

));

I should mention I’ve also tried url:
http://localhost:8080/geoserver/gwc/service/wms’, and when I do this, my
browser is attempting to send a request somewhere…why does it ignore it
completely with url: ‘http://localhost:8080/geoserver/wms’, I mean I would
expect for a request to at least be attempted :?

I should also point out that using GWC layers are making my map legend
useless as it seems it is not picking up my SLD for points and lines…

Sincerely,

elshae


View this message in context: http://old.nabble.com/GWC-Layers-Do-Not-Return-GetFeatureInfo-tp30088025p30088025.html
Sent from the GeoServer - User mailing list archive at Nabble.com.


Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev


Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users


Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

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&quot;,

    layerUrls: ["http://localhost:8080/geoserver/gwc/service/wms&quot;\],

    title: 'Identify features by clicking',

    queryVisible: true

});

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

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

elshae

--
View this message in context: http://old.nabble.com/GWC-Layers-Do-Not-Return-GetFeatureInfo-tp30088025p30107381.html
Sent from the GeoServer - User mailing list archive at Nabble.com.