[Tilecache] OpenLayers, Tilecache and Custom Map using ImageLayer

Nathan Boettcher NathanB at lawtonprinting.com
Fri May 23 17:30:03 EDT 2008


Aha, I'm definitely getting there.  I have a couple of (hopefully) last
questions.

First, I changed the image I'm using from 4000x5083 to 5083x5083 (map with
white background on the sides) and used a max resolution of 19.86 =>
5083/256 = 19.85546875.  So when I modify everything accordingly and look at
max zoom (most zoomed in), I still get one line of black tiles along the
right border...they are exactly 256x256px.  Not sure why it's generating it?

Second, and this is more of a OpenLayers question I think, is there a way I
can keep from zooming all the way out to 1 256x256 tile?  It makes the map
really small and the zoomToMaxExtent starts one zoom level in...which I
would like to be the farthest out I can go. So if the zoom level goes 0-5,
the map starts at 1, but 0 is a single tile.  I would like only 1-5.  I've
tried setting a minResolution of 2.4825 but according to my tests I should
be setting maxResolution to 9.93 instead (regardless of setting
minResolution)...only it messes up the map at that point (ie small map with
lots of black).

-Nathan

-----Original Message-----
From: Christopher Schmidt [mailto:crschmidt at metacarta.com] 
Sent: Friday, May 23, 2008 12:23 PM
To: Nathan Boettcher
Cc: tilecache at openlayers.org
Subject: Re: [Tilecache] OpenLayers, Tilecache and Custom Map using
ImageLayer

On Fri, May 23, 2008 at 11:26:55AM -0700, Nathan Boettcher wrote:
> Glad to know I got the maxExtent part right after looking at the
OpenLayers
> API docs. :)
> 
> So what if I set the maxResolution to 5, does that give me an automatic 5
> zoom levels?  If so, what are they, 0-4?

maxresolution is 'map units per pixel at most zoomed out.' What you want
is 'levels' (TC) / numZoomLevels (OL).

> Also, and this might be related, how do I get the image size so it doesn't
> have black around the border when it generates the tiles?  I monkeyed with
a
> few different sizes but always got the black border.  Is there an optimal
> size so that doesn't happen during the tile generation/seeding?

 Pick a maxResolution which divides your image by an exact number of
   tiles in each direction. IE: 4000 x 4000 image -> 4000 / 256 = 15.625
   maxResolution will divide your image into a single til, and shold
   continue to work as you zoom in.

Regards,
-- 
Christopher Schmidt
MetaCarta




More information about the Tilecache mailing list