[OpenLayers-Users] RE WMSGetFeatureInfo error (Style (undefined) not defined on layer) ...

stela anders stelaanders at gmail.com
Wed Jan 20 13:12:53 EST 2010


Guys, debuging WMSGetFeatureInfo.js, the  layers[i].params.STYLES is empty
("") ...
Is that the error cause? How to define that STYLES property?

So, just for testing purpose, I commented the follow line:
 //styles: styleNames,

Than I got I Mssql2008 error :

msMSSQL2008LayerGetShape(): Query error. Error executing MSSQL2008 SQL
statement: SELECT convert(varchar(max), oid),convert(varchar(max),
name),the_geom.STAsBinary(),convert(varchar(20), oid) from viwargentina
WHERE
the_geom.STIntersects(Geometry::STGeomFromText('POLYGON((-56.0839061594084
-12.4474347926471,-56.0839061594084 -12.4474347926471,-56.0839061594084
-12.4474347926471,-56.0839061594084 -12.4474347926471,-56.0839061594084
-12.4474347926471))',0)) = 1
-[Microsoft][ODBC SQL Server Driver][SQL Server]

System.FormatException: 24305: *The Polygon input is not valid because the
ring does not have enough distinct points. Each ring of a polygon must
contain at least three distinct points.*

Help me please

Stella

2010/1/20 stela anders <stelaanders at gmail.com>

> Hello Steve...
>
> I done everthing you suggest me...
> But got the same error ...
>
> I also took of Uruguay layer... And use only Argentina layer...
>
> Do you have any other idea? :(
>
> Thanks so much
>
> Stella
>
> 2010/1/19 <Steve.Toutant at inspq.qc.ca>
>
>> In the mapfile, you must define a tolerance and a template for both layer
>> (Argentina and Uruguay)
>> TOLERANCE 0
>> TEMPLATE '../template/query.html'
>>
>> just add "[oid]" in your query.html for now.
>>
>> In OL
>>
>> You are querying every layer with a template. Keep it simple and try first
>> with one layer
>>  var _wmsControl = new OpenLayers.Control.WMSGetFeatureInfo({
>>                    //url : _mapfilex,
>>                     title: 'Click on the map to get information on
>> layers',
>>                     queryVisible: true,
>>                     infoFormat: 'text/html' ,
>>         layers:         [YOURLAYERNAME of new OpenLayers.Layer.WMS.....]
>>                 });
>>
>> give it a try...
>>
>>
>>
>>
>>  *stela anders <stelaanders at gmail.com>*
>>
>> 19/01/2010 02:16 PM
>>   A
>> Steve.Toutant at inspq.qc.ca
>>  cc
>> openlayers user list <users at openlayers.org>, users-bounces at openlayers.org
>> Objet
>> Re: RE [OpenLayers-Users] WMSGetFeatureInfo error (Style (undefined)
>>   not defined on layer) ...
>>
>>
>>
>>
>>
>>
>> Hi Steve...
>>
>> Mapserver version:
>> MapServer version 5.6.0-beta4 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG
>> OUTPUT=WBMP OUTPUT=PDF OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG
>> SUPPORTS=FREETYPE
>> SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT
>> SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER
>> SUPPORTS=SOS_SERVER
>> SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS SUPPORTS=RGBA_PNG
>> INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
>>
>>
>> One layer definition (Mapfile)
>>
>> LAYER
>>         NAME Argentina
>>         METADATA
>>             "wms_title"    "Argentina"   ##required
>>             "wms_feature_info_mime_type" "text/html"
>>         END
>>         GROUP "Test"
>>         TYPE POLYGON
>>         STATUS ON
>>         INCLUDE "Connection.map"  ##MSSQL2008
>>         DATA "the_geom from viwargentina USING UNIQUE oid USING SRID=0"
>>         PROJECTION
>>             "+init=epsg:4326"
>>         END
>>
>>         CLASS
>>             COLOR 255 200 255
>>             STYLE
>>                 OUTLINECOLOR 190 190 190
>>                 WIDTH 1
>>             END
>>         END
>>     END
>>
>>
>> I´m using GeoExt to be able to use Sublayers, one layer definition :
>>
>>                 new OpenLayers.Layer.WMS("Country",
>>                 _mapfile, {
>>                     layers: ['Argentina', 'Uruguay'],
>>                     format: "image/png",
>>                     transparent: "true"
>>                 }, {
>>                     isBaseLayer: true,
>>                     buffer: 0,
>>                     visibility: true
>>                 }),
>>
>> Event to register control:
>> _wmsControl.events.register("getfeatureinfo",map,showInfo);
>>
>> Thanks
>>
>>
>> 2010/1/19 <*Steve.Toutant at inspq.qc.ca* <Steve.Toutant at inspq.qc.ca>>
>>
>> Wich mapServer version?
>> Can you send one layer definition of the mapfile and how you create the Ol
>> layer for this layer?
>> Do you register an event for this control, please provide all the code
>> related to this control.
>> steve
>>
>>
>>
>>   *stela anders <**stelaanders at gmail.com* <stelaanders at gmail.com>*>@**
>> openlayers.org* <http://openlayers.org/>
>> Envoyé par : *users-bounces at openlayers.org*<users-bounces at openlayers.org>
>>
>> 19/01/2010 01:36 PM
>>
>>   A
>> openlayers user list <*users at openlayers.org* <users at openlayers.org>>
>> cc
>>   Objet
>> [OpenLayers-Users] WMSGetFeatureInfo error (Style (undefined) not
>>  defined on layer) ...
>>
>>
>>
>>
>>
>>
>>
>>
>> Hiii !!
>>
>> I´m using Mapserver WMS + Openlayers...
>> I created a WMSGetFeatureInfo control, when I try to use I got that error:
>>
>>
>> <?xml version='1.0' encoding="ISO-8859-1" standalone="no" ?>
>> <!DOCTYPE ServiceExceptionReport SYSTEM "*
>> http://schemas.opengis.net/wms/1.1.0/exception_1_1_0.dtd*<http://schemas.opengis.net/wms/1.1.0/exception_1_1_0.dtd>
>> ">
>> <ServiceExceptionReport version="1.1.0">
>> <ServiceException code="StyleNotDefined">
>> msWMSLoadGetMapParams(): WMS server error. Style (undefined) not defined
>> on layer.
>> </ServiceException>
>> </ServiceExceptionReport>
>>
>>
>> My control :
>>
>>  var _wmsControl = new OpenLayers.Control.WMSGetFeatureInfo({
>>                     url : _mapfilex,
>>                     title: 'Click on the map to get information on
>> layers',
>>                     queryVisible: true,
>>                     infoFormat: 'application/vnd.ogc.wms_xml'
>>                 });
>>
>>
>> All layers on my mapfile have Style defined...
>>
>> Any idea?
>>
>> Thanks
>>
>> Stella_______________________________________________
>> Users mailing list*
>> **Users at openlayers.org* <Users at openlayers.org>*
>> **http://openlayers.org/mailman/listinfo/users*<http://openlayers.org/mailman/listinfo/users>
>>
>>
>>
>>
>>
>>
>>
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100120/e4352039/attachment.html


More information about the Users mailing list