[OpenLayers-Users] WMSGetFeatureInfo doesnt seem to work

Andreas Hocevar ahocevar at opengeo.org
Wed Sep 2 18:12:14 EDT 2009


Hi,

just a guess: try specifying the srs as projection property in the layer
option, not as (commented out) srs property in the layer params.

Regards,
Andreas.

Dominik Wiedner wrote:
> Hi guys,
>
> Currently I try to find my way in to OpenLayers.
>
> The problem, I'm currently facing, is that this code:
>
> function load () {
> var map = new OpenLayers.Map('map');
> var wms = new OpenLayers.Layer.WMS(
> "OpenLayers WMS", "http://labs.metacarta.com/wms/vmap0",
> {
> layers: 'basic',
> //srs: 'EPSG:31467',
> format: 'image/gif'
> }
> );
> var studiwohn = new OpenLayers.Layer.WMS(
> "Studentenwohnheime ", "http://localhost:8080/geoserver/wms",
> {
> layers: 'topp:Studentenwohnheime',
> //srs: 'EPSG:31467',
> transparent: 'true',
> format: 'image/gif'
> }
> );
> map.addLayers([wms, studiwohn]);
> map.zoomToMaxExtent();
> 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.FramedCloud(
> "chicken", map.getLonLatFromPixel(event.xy),
> null,
> event.text,
> null,
> true
> ));
> }
> }
> });
> map.addControl(info);
> info.activate();
> map.addControl(new OpenLayers.Control.LayerSwitcher());
> }
>
> doesn't work very well, when I click on one of my features in the Layer
> "Studentenwohnheime", i can see that a query is submitted to the server, but
> no result is being sent back.
>
> Kind regards,
> Dominik
>   


-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.




More information about the Users mailing list