Implementing combo boxes
Barend Köbben
kobben at ITC.NL
Fri Jan 12 01:36:48 PST 2007
Hi,
I dont know about implementing them "In" Mapserver. I think you'd implement them on a Dynamic Webpage and use the combo-list choices to feed to MapServer. Below's a quick snippet how I would do that using JSP. Exchange with your script language of choice...
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String mySHPpath = request.getRealPath("/") + "SHP"; //get path on server that points to SHP directory
int myFilesNum;
String[] MyFilesList;
File myDir = new File(mySHPpath);
if (myDir == null) {
out.println("<br/>ERROR: SHP directory not found at " + mySHPpath + " <br/>");
} else {
MyFilesList = myDir.list();
if (MyFilesList == null) {
out.println("<br/>ERROR: no SHP files found in directory " + mySHPpath + " <br/>");
} else {
myFilesNum = MyFilesList.length;
%>
<select name="fileBox">
<% for (int i = 0; i < myFilesNum; i++) {%>
<option value="<%=MyFilesList[i]%>"><%=MyFilesList[i]%></option>
<%}%>
</select>
--
Barend Köbben
International Institute for Geo-information Sciences and Earth Observation (ITC)
PO Box 6, 7500AA Enschede (The Netherlands)
ph: +31-(0)534874253; mobile: +31-(0)622344955
________________________________
From: UMN MapServer Users List on behalf of Willem Coetzer
Sent: Fri 1/12/07 09:15
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: [UMN_MAPSERVER-USERS] Implementing combo boxes
Does anyone have experiencing implementing combo boxes in Mapserver. I want the combo boxes to list shapefiles that the user can add to the display and legend. I just need a broad approach or any tips.
Thanks
Willem
More information about the MapServer-users
mailing list