[OpenLayers-Users] RE: Error messages displayed on the map

Duong Minh-Tri duong.minh-tri at ext.jrc.ec.europa.eu
Thu Jun 9 03:40:14 EDT 2011


Hi again,
I've found the solution for my problem: just set the parameter 'exception'
of the WMS layer to 'application/vnd.ogc.se_xml', then WMS no longer returns
exception message inside the image. Or we can apply the patch
http://trac.osgeo.org/openlayers/attachment/ticket/3261/3261.patch  to
remove the default value 'application/vnd.ogc.se_inimage' of parameter
'exception'.
 
Best regards,
Minh-Tri
 



  _____  

From: Duong Minh-Tri [mailto:duong.minh-tri at ext.jrc.ec.europa.eu] 
Sent: Wednesday, June 08, 2011 4:21 PM
To: 'openlayers-users at lists.osgeo.org'
Subject: Error messages displayed on the map


Hi all,
 
I am trying to add a WMS layer to the map. Sometimes the WMS service doesn't
work properly and the layer can't be displayed properly. But on the map I
see the pink tiles and the error message for each tile: 
"code="internalError"Rendering process failed
Unable to obtain connection: Cannot get a connection, pool error Timeout
waiting for idle object"
I think those error messages comes from WMS service and I am not able to fix
those error. However, at least I don't want display them on the map. I want
to display instead other message, shorter and more friendly to user, and not
on the map. 
 
I've tried to overwrite OpenLayers.Util.onImageLoadError by a blank
function. Then no pink tiles are displayed, but the text error messages
still there. 
I also check the GetMapRequest generated by OpenLayers. This is one of them:
http://kartta.liikennevirasto.fi/maaliikenne/ows?SERVICE=WMS
<http://kartta.liikennevirasto.fi/maaliikenne/ows?SERVICE=WMS&amp;&LAYERS=ka
tselupalvelu%3Adigiroad&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=appl
ication%2Fvnd.ogc.se_inimage&FORMAT=image%2Fjpeg&SRS=EPSG%3A4326&BBOX=0,-90,
90,0&WIDTH=256&HEIGHT=256>
&amp;&LAYERS=katselupalvelu%3Adigiroad&VERSION=1.1.1&REQUEST=GetMap&STYLES=&
EXCEPTIONS=application%2Fvnd.ogc.se_inimage&FORMAT=image%2Fjpeg&SRS=EPSG%3A4
326&BBOX=0,-90,90,0&WIDTH=256&HEIGHT=256
When I view this link on Firefox (when server has some problems and return
errors), it displays a transparent image together with the error message
inside. But the image does not contain the message (I check by saving the
image and viewing) The image is just a small transparent blank image. So the
message comes to Firefox in a secret way I don't know.
 
I guess that the WMS service still returns an image to OpenLayers, so
OpenLayers.Util.onImageLoadError can't trigger. But it returns some error
message together with the image. Maybe OpenLayers can receive those message
as well and display them. But how can I detect when it happens and prevent
OpenLayers to display those error messages?
 
Any help is appreciated. 
 
Thanks,
 
 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110609/0da95eda/attachment.html


More information about the Users mailing list