Discussion:
[OpenLayers-Users] WMSGetFeatureInfo error (Style (undefined) not defined on layer) ...
stela anders
2010-01-19 18:36:16 UTC
Permalink
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">
<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
S***@inspq.qc.ca
2010-01-19 18:49:59 UTC
Permalink
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 <***@gmail.com>@openlayers.org
Envoyé par : users-***@openlayers.org
19/01/2010 01:36 PM

A
openlayers user list <***@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">
<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
***@openlayers.org
http://openlayers.org/mailman/listinfo/users
stela anders
2010-01-19 19:16:12 UTC
Permalink
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
Post by S***@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
19/01/2010 01:36 PM
A
cc
Objet
[OpenLayers-Users] WMSGetFeatureInfo error (Style (undefined) not
defined on layer) ...
Hiii !!
IŽm using Mapserver WMS + Openlayers...
<?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>
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
http://openlayers.org/mailman/listinfo/users
S***@inspq.qc.ca
2010-01-19 19:43:22 UTC
Permalink
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 <***@gmail.com>
19/01/2010 02:16 PM

A
***@inspq.qc.ca
cc
openlayers user list <***@openlayers.org>, users-***@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 <***@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 <***@gmail.com>@openlayers.org
Envoyé par : users-***@openlayers.org
19/01/2010 01:36 PM


A
openlayers user list <***@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">
<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
***@openlayers.org
http://openlayers.org/mailman/listinfo/users
stela anders
2010-01-20 11:20:40 UTC
Permalink
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
Post by S***@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...
19/01/2010 02:16 PM
A
cc
Objet
Re: RE [OpenLayers-Users] WMSGetFeatureInfo error (Style (undefined)
not defined on layer) ...
Hi Steve...
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
new OpenLayers.Layer.WMS("Country",
_mapfile, {
layers: ['Argentina', 'Uruguay'],
format: "image/png",
transparent: "true"
}, {
isBaseLayer: true,
buffer: 0,
visibility: true
}),
_wmsControl.events.register("getfeatureinfo",map,showInfo);
Thanks
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
openlayers.org* <http://openlayers.org/>
19/01/2010 01:36 PM
A
cc
Objet
[OpenLayers-Users] WMSGetFeatureInfo error (Style (undefined) not
defined on layer) ...
Hiii !!
IŽm using Mapserver WMS + Openlayers...
<?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>
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*
**http://openlayers.org/mailman/listinfo/users*<http://openlayers.org/mailman/listinfo/users>
stela anders
2010-01-20 18:12:53 UTC
Permalink
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(&#39;POLYGON((-56.0839061594084
-12.4474347926471,-56.0839061594084 -12.4474347926471,-56.0839061594084
-12.4474347926471,-56.0839061594084 -12.4474347926471,-56.0839061594084
-12.4474347926471))&#39;,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
Post by stela anders
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
Post by S***@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...
19/01/2010 02:16 PM
A
cc
Objet
Re: RE [OpenLayers-Users] WMSGetFeatureInfo error (Style (undefined)
not defined on layer) ...
Hi Steve...
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
new OpenLayers.Layer.WMS("Country",
_mapfile, {
layers: ['Argentina', 'Uruguay'],
format: "image/png",
transparent: "true"
}, {
isBaseLayer: true,
buffer: 0,
visibility: true
}),
_wmsControl.events.register("getfeatureinfo",map,showInfo);
Thanks
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
openlayers.org* <http://openlayers.org/>
19/01/2010 01:36 PM
A
cc
Objet
[OpenLayers-Users] WMSGetFeatureInfo error (Style (undefined) not
defined on layer) ...
Hiii !!
IŽm using Mapserver WMS + Openlayers...
<?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>
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*
**http://openlayers.org/mailman/listinfo/users*<http://openlayers.org/mailman/listinfo/users>
_______________________________________________
Users mailing list
http://openlayers.org/mailman/listinfo/users
David Fawcett
2010-01-21 14:45:46 UTC
Permalink
Stella,

The below info indicates a problem in MapServer, not OpenLayers. I would
set OpenLayers aside for a little bit and get your map working in basic
MapServer CGI mode=map. This will confirm that MapServer can draw the data
based on your query to MS SQL Server.

Once you know that the data source works, then go back to making WMS calls.


If you have more questions on this, I would suggest posting to the MapServer
list.

David.
Post by stela anders
Guys, debuging WMSGetFeatureInfo.js, the layers[i].params.STYLES is empty
("") ...
Is that the error cause? How to define that STYLES property?
//styles: styleNames,
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(&#39;POLYGON((-56.0839061594084
-12.4474347926471,-56.0839061594084 -12.4474347926471,-56.0839061594084
-12.4474347926471,-56.0839061594084 -12.4474347926471,-56.0839061594084
-12.4474347926471))&#39;,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
Post by stela anders
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
Post by S***@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...
19/01/2010 02:16 PM
A
cc
Objet
Re: RE [OpenLayers-Users] WMSGetFeatureInfo error (Style (undefined)
not defined on layer) ...
Hi Steve...
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
new OpenLayers.Layer.WMS("Country",
_mapfile, {
layers: ['Argentina', 'Uruguay'],
format: "image/png",
transparent: "true"
}, {
isBaseLayer: true,
buffer: 0,
visibility: true
}),
_wmsControl.events.register("getfeatureinfo",map,showInfo);
Thanks
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
openlayers.org* <http://openlayers.org/>
19/01/2010 01:36 PM
A
cc
Objet
[OpenLayers-Users] WMSGetFeatureInfo error (Style (undefined) not
defined on layer) ...
Hiii !!
IŽm using Mapserver WMS + Openlayers...
<?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>
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*
**http://openlayers.org/mailman/listinfo/users*<http://openlayers.org/mailman/listinfo/users>
_______________________________________________
Users mailing list
http://openlayers.org/mailman/listinfo/users
_______________________________________________
Users mailing list
http://openlayers.org/mailman/listinfo/users
stela anders
2010-01-25 14:15:05 UTC
Permalink
It was a MSSQL2008 error...
Now, IŽm trying to get a WMSGetFeatureInfo of a Point layer...

But I always got NO features .

function showInfo(evt) {
alert(evt.text);
}

The text property is returning :
Content-type: application/vnd.ogc.se_xml

<?xml version='1.0' encoding="ISO-8859-1" standalone="no" ?>
<!DOCTYPE ServiceExceptionReport SYSTEM "
http://schemas.opengis.net/wms/1.1.1/exception_1_1_1.dtd">
<ServiceExceptionReport version="1.1.1">
<ServiceException>
</ServiceException>
</ServiceExceptionReport>

Any idea?

Thanks

Stella
Post by David Fawcett
Stella,
The below info indicates a problem in MapServer, not OpenLayers. I would
set OpenLayers aside for a little bit and get your map working in basic
MapServer CGI mode=map. This will confirm that MapServer can draw the data
based on your query to MS SQL Server.
Once you know that the data source works, then go back to making WMS calls.
If you have more questions on this, I would suggest posting to the
MapServer list.
David.
Post by stela anders
Guys, debuging WMSGetFeatureInfo.js, the layers[i].params.STYLES is empty
("") ...
Is that the error cause? How to define that STYLES property?
//styles: styleNames,
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(&#39;POLYGON((-56.0839061594084
-12.4474347926471,-56.0839061594084 -12.4474347926471,-56.0839061594084
-12.4474347926471,-56.0839061594084 -12.4474347926471,-56.0839061594084
-12.4474347926471))&#39;,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
Post by stela anders
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
Post by S***@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...
19/01/2010 02:16 PM
A
cc
Objet
Re: RE [OpenLayers-Users] WMSGetFeatureInfo error (Style (undefined)
not defined on layer) ...
Hi Steve...
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
new OpenLayers.Layer.WMS("Country",
_mapfile, {
layers: ['Argentina', 'Uruguay'],
format: "image/png",
transparent: "true"
}, {
isBaseLayer: true,
buffer: 0,
visibility: true
}),
_wmsControl.events.register("getfeatureinfo",map,showInfo);
Thanks
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
openlayers.org* <http://openlayers.org/>
19/01/2010 01:36 PM
A
cc
Objet
[OpenLayers-Users] WMSGetFeatureInfo error (Style (undefined) not
defined on layer) ...
Hiii !!
IŽm using Mapserver WMS + Openlayers...
<?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>
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*
**http://openlayers.org/mailman/listinfo/users*<http://openlayers.org/mailman/listinfo/users>
_______________________________________________
Users mailing list
http://openlayers.org/mailman/listinfo/users
_______________________________________________
Users mailing list
http://openlayers.org/mailman/listinfo/users
David Fawcett
2010-01-25 15:05:52 UTC
Permalink
I would use FireBug to capture that getFeatureInfo call and then try that by
itself and see if you get any error.

If not, set OpenLayers aside and get a valid getFeatureInfo request working
by directly hitting your WMS instance. If you have problems with that, ask
the MapServer list.

There are several things that you need to do to make a getFeatureInfo
request to work with MapServer. There are required metadata elements in
your mapfile, and the layer needs to be queryable (needs a template).

David.
Post by stela anders
It was a MSSQL2008 error...
Now, IŽm trying to get a WMSGetFeatureInfo of a Point layer...
But I always got NO features .
function showInfo(evt) {
alert(evt.text);
}
Content-type: application/vnd.ogc.se_xml
<?xml version='1.0' encoding="ISO-8859-1" standalone="no" ?>
<!DOCTYPE ServiceExceptionReport SYSTEM "
http://schemas.opengis.net/wms/1.1.1/exception_1_1_1.dtd">
<ServiceExceptionReport version="1.1.1">
<ServiceException>
</ServiceException>
</ServiceExceptionReport>
Any idea?
Thanks
Stella
Stella,
Post by David Fawcett
The below info indicates a problem in MapServer, not OpenLayers. I would
set OpenLayers aside for a little bit and get your map working in basic
MapServer CGI mode=map. This will confirm that MapServer can draw the data
based on your query to MS SQL Server.
Once you know that the data source works, then go back to making WMS calls.
If you have more questions on this, I would suggest posting to the
MapServer list.
David.
Post by stela anders
Guys, debuging WMSGetFeatureInfo.js, the layers[i].params.STYLES is
empty ("") ...
Is that the error cause? How to define that STYLES property?
//styles: styleNames,
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(&#39;POLYGON((-56.0839061594084
-12.4474347926471,-56.0839061594084 -12.4474347926471,-56.0839061594084
-12.4474347926471,-56.0839061594084 -12.4474347926471,-56.0839061594084
-12.4474347926471))&#39;,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
Post by stela anders
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
Post by S***@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...
19/01/2010 02:16 PM
A
cc
Objet
Re: RE [OpenLayers-Users] WMSGetFeatureInfo error (Style (undefined)
not defined on layer) ...
Hi Steve...
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
new OpenLayers.Layer.WMS("Country",
_mapfile, {
layers: ['Argentina', 'Uruguay'],
format: "image/png",
transparent: "true"
}, {
isBaseLayer: true,
buffer: 0,
visibility: true
}),
_wmsControl.events.register("getfeatureinfo",map,showInfo);
Thanks
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
openlayers.org* <http://openlayers.org/>
19/01/2010 01:36 PM
A
cc
Objet
[OpenLayers-Users] WMSGetFeatureInfo error (Style (undefined) not
defined on layer) ...
Hiii !!
IŽm using Mapserver WMS + Openlayers...
<?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>
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*
**http://openlayers.org/mailman/listinfo/users*<http://openlayers.org/mailman/listinfo/users>
_______________________________________________
Users mailing list
http://openlayers.org/mailman/listinfo/users
_______________________________________________
Users mailing list
http://openlayers.org/mailman/listinfo/users
Continue reading on narkive:
Loading...