[Mapserver-users] queryfile - strange results

Raw, Jeremy JRaw at ci.durham.nc.us
Thu Mar 4 05:56:08 PST 2004


The difficulty is that the backslash directory separator (standard on
Windows) is also a Javascript "escape" character (standard on not-Windows).
The value [queryfile] is substituted literally into the template and when it
is parsed by Javascript, the slashes get eaten up, regardless of the quoting
you may attempt do in the Javascript (so no amount of Javascript string
replacement will save you).

If it is possible to force the file path to use forward slashes as directory
separators (perhaps by using forward slashes when specifying IMAGEPATH
"C:/inetpub/wwwroot/tmp/") the problem should go away.

Caveat: I've done a fair amount of Javascript but I'm very new to Mapserver;
there may be a better/easier way to force Mapserver to use forward slashes
in the queryfile pathname, or to double the backslashes (e.g.
c:\\inetpub\\wwwroot\\tmp\\). If so, I'd be interested in hearing about
it...

---
Jeremy Raw
Transportation Planner
City of Durham / DCHC MPO
919-560-4366 ext. 308 / jraw at ci.durham.nc.us

-----Original Message-----
From: Steve McCrone [mailto:ms57 at streamyx.com] 
Sent: Thursday, March 04, 2004 5:17 AM
To: mapserver-users at lists.gis.umn.edu
Cc: Richard Greenwood
Subject: [Mapserver-users] queryfile - strange results

I'm doing an itemquery and wish to keep the polygon selected highlighted
after further interaction with the map.

In my tempalte file, I use  -

<SCRIPT language=JavaScript>
     var qfile = ("[queryfile]".substring(0,1) != "[") ? "[queryfile]"  :
"";
</SCRIPT>

And then further down in the body, I use -

<SCRIPT language=JavaScript>
   if (qfile) {
    document.write("<input type='hidden' name='queryfile'
value='[queryfile]'>");
   }
</SCRIPT>

Appears logical. However, the string for the full path for the queryfile is
strange. Once I pan the map after selecting the found polygon, I get the
following -

msLoadQuery(): Unable to access file. (C:Inetpubwwwroot
mpDEMO1078391348536.qy)

Notice the wierd string for the location of the *.qy. Further down on my
page, I have simply palced [queryfile], and it displays the correct full
path of the query file -

C:\Inetpub\wwwroot\tmp\DEMO1078391348536.qy.

Obviously, it cannot access the file C:Inetpubwwwroot
mpDEMO1078391348536.qy, since it makes no sense.

Any ideas?

Thanks


_______________________________________________
Mapserver-users mailing list
Mapserver-users at lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users



More information about the MapServer-users mailing list