[OpenLayers-Dev] Need Help Using Multiple Map Files

Brian Krebs bkrebs at korterra.com
Fri Jan 19 17:09:15 EST 2007


Something else I've noticed.  If I've deleted all customer folders under
the tmp folder, I can log in as customerid1 and have it generate the
correct map and create the correct folder under tmp.  It opens at an
initial zoom level with a scale of 3906.  Then when I log in as
customerid2, I can open up a map that has an initial zoom level with a
scale of 7812.  This also creates the correct map tiles and folder under
tmp.

Here's where things get strange.  While still logged in as customerid2,
I zoom in and out to generate more scale level folders under the
customerid2 folder of tmp.  Now when I log back in as customerid1, it
opens again at the initial zoom level with a scale of 3906 and shows me
the correct map tiles, but when I zoom in or out to a scale level that
hasn't been generated for customerid1 yet, but has been for customerid2,
it shows me the map tiles for customerid2.  I know this is kind of long
winded, so I'll try to break it down.

Log in as customerid1, zoom in and out to generate map tiles for scales
of 1000, 3000 and 5000.

Log in as customerid2, zoom in and out to generate map tiles for scales
of 2000 and 4000.

Log back in as customerid1 where I'm passing a parameter of customerid1
as the map file.  Start at initial zoom scale of 1000, I see customerid1
map tiles.  Zoom out to scale of 2000, I see customerid2 map tiles.
Zoom out to scale of 3000, I see customerid1 map tiles, etc.

It's almost as if it's ignoring what map I'm telling it to use and just
looking anywhere within the tmp folder to see if there's a matching
scale level, regardless of the map parameter.

-----Original Message-----
From: Christopher Schmidt [mailto:crschmidt at metacarta.com] 
Sent: Friday, January 19, 2007 12:44 PM
To: Brian Krebs
Cc: dev at openlayers.org
Subject: Re: [OpenLayers-Dev] Need Help Using Multiple Map Files

On Fri, Jan 19, 2007 at 12:29:15PM -0600, Brian Krebs wrote:
> I'm attempting to use OpenLayers with two different map files.  The
map
> to use is based on the customerid the user logs in with.  


> If I log in as customerid1 and open the map, I see the
customerid1.map.
> When someone else logs in as customerid2, they also see the
> customerid1.map.  What needs to be done to get the correct map to
> display for each customerid?

I don't think you gave enough context.

initializeMapStart takes a mapName parameter. This parameter defines
what map you'll see out of ka-Map. The computation of that mapName
variable seems to be the code that you need to be looking at. (If you
add "alert(mapName)" as the first line of initializeMapStart, it should
tell you what mapName is actually getting in there.)

If you can figure out why that mapName isn't what you expect, I think
you'll be on your way forward.

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Dev mailing list