[Mapserver-users] Itasca Demo DHTML Help?

Jerod Clabaugh jclabaugh at mac.com
Mon Jul 5 19:07:25 PDT 2004


Hello all:

I have been  able to modify the MS 4 Itasca demo to use my map file 
and data.  Basically I want the use of the DHTML rubber band zoom box 
(dbox) but without using frames.  I have been struggling and haven't 
been able to modify the code to not use frames.  I want the query 
section to use a popup window instead of a lower frame.  I'm not so 
concerned with the actually scripting necessary for the popup action 
itself but rather how to modify Steve Lime's code to remove the 
frames in the demo while still providing a functional zoom box.

Does anyone have a simple solution for  this using this DHTML zoom 
box without frames?

Cheers,

Jerod Clabaugh
Belize Biodiversity Mapping Service
http://www.iwlearn.net/belize


Page 1 --> Page 2--> Frame A
		Frame B

======PAGE 1 ======

<head>
     <title>MapServer Itasca Application</title>
     <script language="javascript">
       function submit_form() {
         var template = 
document.demo.map_web_template.options[document.demo.map_web_template.selectedIndex].value;
         if(template.indexOf("frame") != -1) document.demo.action = 
"frames.html";
         if(template.indexOf("dhtml") != -1) document.demo.action = 
"frames_dhtml.html";
       }
     </script>
   </head>

  <!-- EDIT THE FORM ACTION -->
     <form name="demo" method="GET" action="/cgi-bin/mapserv" 
onSubmit="submit_form()">

       <input type="hidden" name="layer" value="district">
       <input type="hidden" name="zoomsize" value=2>

       <!-- EDIT THESE HIDDEN VARIABLES -->
       <input type="hidden" name="map" 
value="/Library/Apache2/htdocs/belize/demo.map">
       <input type="hidden" name="program" value="/cgi-bin/mapserv">
       <input type="hidden" name="root" value="/workshop">
       <input type="hidden" name="map_web_imagepath" 
value="/Library/Apache2/htdocs/tmp/">
       <input type="hidden" name="map_web_imageurl" value="/tmp/">

       <select name="map_web_template" size="1">
         <option value="itasca_basic.html"> Basic Application
         <option value="itasca_adds_scalebar.html">   -- 
Adds second scalebar
         <option value="itasca_adds_pan.html">   -- Adds pan controls
         <option value="itasca_adds_frames.html">   -- Adds frames
         <option value="itasca_adds_dhtml.html">   -- Adds 
dhtml rubber-band box
       </select>
       <input type="submit" value="Initialize"></center>

     </form>


===== PAGE 2=====
<head>
     <title>MapServer - Itasca Application</title>
     <script language="javascript">
       function load_map_frame() {
         var template;
         var query = location.search.substring(1);
         var pairs = query.split("&");
         for(var i = 0; i < pairs.length; i++) {
          var pos = pairs[i].indexOf('=');
           if (pos == -1) continue;
           var name = pairs[i].substring(0,pos);
           if(name == 'map_web_template') {
             template = pairs[i].substring(pos+1);
	    template = unescape(template.replace(/\+/g, " "));
             break;
           }
         }
         parent.map_frame.location.href = template + "?" + query;
       }
     </script>
   </head>
   <frameset rows="*,100" frameborder="0" border="0" onLoad="load_map_frame()">
     <frame src="blank.html" name="map_frame" marginwidth="5" 
marginheight="5" scrolling="YES">
     <frame src="blank.html" name="query_frame" marginwidth="5" 
marginheight="5" scrolling="YES">
   </frameset>





More information about the MapServer-users mailing list