[OpenLayers-Users] WMSGetFeatureInfo

Eric Lemoine eric.lemoine at camptocamp.com
Wed Mar 24 01:44:19 EDT 2010


On Tuesday, March 23, 2010, Francesco D'Amore
<francesco.damore at gmail.com> wrote:
> Hi All!!!!
>
> I'm so Sorry if the my question will be trivial but a tried to find
> some thing in the mail list archive but it doesn't work!!!!!
>
> I'm very new bie in OpenLayers and I have a problem with WMSGetFeatureInfo.
>
> With GeoExt I try to use the control in order to get some information
> about WMS Services and display it in a Cloud:
>
> var popup;
>         //Feture info....
>         info = new OpenLayers.Control.WMSGetFeatureInfo({
>             url: 'http://160.97.133.1:8080/geoserver/wms',
>             title: 'Identify features by clicking',
>             queryVisible: true,
>             eventListeners: {
>                 getfeatureinfo: function(evento) {
>                     mymap.addPopup(new OpenLayers.Popup.FramedCloud(
>                         "chicken",
>                         mymap.getLonLatFromPixel(evento.xy),
>                         null,
>                         evento.text,
>                         null,
>                         true
>                     ));
>                 }
>             }
>         });
>         mymap.addControl(info);
>         info.activate();
>
> Where a click in the map, the call crash because no "default" Style is
> defined in the Service called!!!! I use Geoserver and all style are
> defined for each services deployed.
> With firebug I cached the GetFeatureInfo request:
>
> http://160.97.133.1:8080/geoserver/wms?service=WMS&version=1.1.0&request=GetFeatureInfo&layers=IIA%3Ait_province,IIA%3Ait_comuni&query_layers=IIA%3Ait_province,IIA%3Ait_comuni&styles=undefined,undefined&bbox=-1167350.587686%2C4784467.947295%2C3827350.587686%2C5415532.052705&srs=EPSG%3A900913&feature_count=10&x=482&y=84&height=129&width=1021&info_format=text%2Fhtml
>
>
> and the response is:
>
> <?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE
> ServiceExceptionReport SYSTEM
> "http://schemas.opengis.net/wms/1.1.1/WMS_exception_1_1_1.dtd">
> <ServiceExceptionReport version="1.1.1" >   <ServiceException
> code="StyleNotDefined">
>       No default style has been defined for IIA:it_province
> </ServiceException></ServiceExceptionReport>
>
> In the request the style is "undefined"...... this is very strange
> because I thing that that style must setted to null.....  some think
> like Stile=&....... and not "undefined". In the OpenLayer examples
> coming in the downloaded package, the reguest is without any style and
> the systems works.
>
> Any suggestions???? How can I get the request string without Style
> "undefined"?????

Hi. It sounds to me that this is a problem with your GeoServer
configuration. Make sure you set a default style for your featuretype.

Cheers,

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com



More information about the Users mailing list