[OpenLayers-Users] TileCache and error "Zero length data returned from layer"

Christopher Schmidt crschmidt at metacarta.com
Fri Dec 22 10:01:38 EST 2006


On Fri, Dec 22, 2006 at 01:12:29PM -0000, Duarte Carreira wrote:
> I'm responding to myself - maybe this will help someone else. 
> 
> Tilecache wasn't working even for localhost mapservices or intranet.
> 
> After reading the Tile Map Service Specification, I read the notice
> stating IIS does not conform to the CGI specification regarding
> path_info. So I followed the instructions to set this up given on the MS
> link (http://support.microsoft.com/kb/q184320/).

That's unfortunate. I'll document that in the next TileCache release.

> After this, the error did not occur if the mapservice was on the
> Intranet. But I was getting no images in my map...
> 
> After digging a bit more, I looked at the generated source in Firefox,
> and all images were being styled with 'display: none' and had a
> "src=tilecache.py?......" without the complete url (localhost/....).
> I edited the test page pointing the layer to a complete url, and finally
> got tilecache working.

This part is a problem with OpenLayers 2.2 -- relative URLs don't work.
We've got an open bug on this that I haven't had time to review a patch
on -- I'm sorry about the fact that this was causing you pain.

> Another solution was using this line from the demo on
> http://labs.metacarta.com/wms-c/demo.html:
> 
> OpenLayers.Tile.Image.prototype = OpenLayers.Class.inherit(
> OpenLayers.Tile.Image, { checkImgURL: function() {} });
> 
> Now, everything works only on intranet mapservices, and every attempt to
> use external mapservices resulted in the same zero length error.

If you run Python on the command line, and use urllib to open a URl
which is failing, does it work? Open a command line prompt on the
server, run Python, and then type:

import urllib
data = urllib.urlopen("http://example.com/cgi-bin/mapserv?request=GetCapabilities")
print len(data.read())

If you get 0, or an exception of some kind, then this won't work, and
you probably want to talk to your network administrator and ask why --
typically, this indicates that the server can not speak to port 80
outbound.

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list