MapTools.org

[maplab-users] MapSession_RW not working

Paul Spencer pgs@magma.ca
Tue, 13 May 2003 12:00:02 -0400 (EDT)
I think I see the problem.  drawmap.php can operate with the map session stuff in either 
mode but it needs to know *which* mode it is in.  If you check the documentation in 
drawmap.php, you should see some comments about a URL parameter 
called "map_session_mode".  I believe it assumes MapSession_R if you pass nothing or 0 
(map_session_mode=0) for this value, and MapSession_RW if you pass a 1 for this value 
(map_session_mode=1).

If drawmap.php is assuming MapSession_R and you are actually using MapSession_RW then you 
will only every see the original map file with no changes, which is what you are 
experiencing.

The fix is to modify the drawMainMap to be aware of the difference between MapSession_R 
and MapSession_RW.  I'm not sure what the best approach for this is, but the short term 
hack would be to modify the URL generated here to append &map_session_mode=1 to the URL 
(I don't have the code in front of me, so it is possible this is the wrong name and/or 
value, but check drawmap.php to see exactly what it says there).

Cheers,

Paul

--
Paul Spencer
Applications and Software Development
DM Solutions Group Inc.
http://www.dmsolutions.ca



On May 13, "Matt Doggett" <mdoggett@coas.oregonstate.edu> wrote:
> 
> If that's the case then the application (as delivered by DMSolutions) is
> broke because that's exactly what I'm doing.  As best I can determine,
> the problem is in the drawMainMap function and/or the
> wrapper/drawmap.php script. I've even tried modifying the URL (in
> drawMainMap) passed to the drawmap.php script to explicitly use the
> temporary mapfile (e.g. drawmap.php?gszMapName=$tmpMAPFILE) but drawmap
> will never render anything but the original .map file.
> 
> Any other suggestions?
> 
> matt
> 
> > -----Original Message-----
> > From: Sacha Fournier [mailto:sfournier@dmsolutions.ca]
> > Sent: Tuesday, May 13, 2003 5:13 AM
> > To: mdoggett@coas.oregonstate.edu
> > Cc: maplab-users@dmsolutions.ca
> > Subject: Re: [maplab-users] MapSession_RW not working
> > 
> > Hi Matt,
> > 
> > Theorictly you only have to change your object to RW and set the temp
> > directory of your object by calling
> > $obj->setTempDir([tmp_dir_of_your_maps]);
> > 
> > Sacha
> > 
> > Matt Doggett wrote:
> > > I am trying to customize my GmapFactory application to generate a
> > > dynamic mapfile based on user inputs to an HTML form.
> > > After extensive trial/error I finally have a feel for how the Gmap
> > > application works and this led me to declaring a MapSession_RW
> object
> > > for $oMapSession (rather than the default MapSession_R object
> > > instantiated in globprefs.php).
> > > However, when I do this, the map display will not update at
> all...zoom,
> > > pan, selecting different layers, etc are all ignored and only the
> > > original (default) map is displayed in the Rosa applet.
> > > If I look in $gszTmpMapPath I find the temporary mapfiles that are
> > > created, and these mapfiles do reflect the changes made by the user.
> > > My question then is what additional change should I make so that the
> > > rosa applet gets the correct (modified) mapfile to display?
> > > This may be related to using map_session_mode=1 but I can't seem to
> get
> > > that to work either.
> > > Anyone else been down this road???
> > >
> > > Md
> > >
> > > (RedHat8.0, Apache2.0, Mapserver 3.6.4, Php4.2.3)
> > >
> > > Matt Doggett
> > > Spatial Climate Analysis Service
> > > Oregon State University
> > > 316 Strand Ag Hall
> > > Corvallis, OR 97331
> > > (541)737-9153
> > > mdoggett@coas.oregonstate.edu
> > >
> > >
> > >
> > > _______________________________________________
> > > Maplab-users mailing list
> > > Maplab-users@dmsolutions.ca
> > > <a href='http://lists.dmsolutions.ca/mailman/listinfo/maplab-
users'>http://lists.dmsolutions.ca/mailman/listinfo/maplab-users</a>
> > >
> > 
> > --
> > Sacha Fournier
> > Applications Developer
> > DM Solutions Group
> > sfournier@dmsolutions.ca
> > tel: 418.696.5056
> > fax: 418.696.5056
> > 
> > www.dmsolutions.ca
> > --
> > -------------------------------------------------
> > /"\  ASCII Ribbon Campaign against HTML
> > \ /  email and proprietary format
> >   X   attachments.
> > / \
> > -------------------------------------------------
> 
> _______________________________________________
> Maplab-users mailing list
> Maplab-users@dmsolutions.ca
> <a href='http://lists.dmsolutions.ca/mailman/listinfo/maplab-
users'>http://lists.dmsolutions.ca/mailman/listinfo/maplab-users</a>
> 


This archive was generated by Pipermail.