mapsize

Richard Greenwood richard.greenwood at GMAIL.COM
Thu Sep 2 13:58:44 PDT 2004


I use the javascript below. There might be a simpler/more elgant
solution, but it works.

Rich

<script language="JavaScript">
      var currMapSize = "[mapsize]";
	function MapSize (size)	{  // constructor
		this.size = size;
	}

	var mapSize = new Array();
		mapSize["Small"] = new MapSize("440 330");
		mapSize["Medium"]= new MapSize("645 485");
		mapSize["Large"] = new MapSize("900 675");

	// populate the map size option list
	function MapSize_place() {
		var s;

		for (name in mapSize) {
			s = "<OPTION value='" + mapSize[name].size + "'";
			s+= (mapSize[name].size == (currMapSize)) ? " selected" : "";
			s+=  ">" + name + "</OPTION>";
			document.write(s);
		}
	}

	MapSize.place = MapSize_place; // make above function a property of
the constructor
</script>

And then in the <BODY> the following:
       <SELECT name="map_size" onChange="reSize(this[selectedIndex].value);">
          <script language="JavaScript">
             MapSize.place();
          </script>
        </SELECT>

-- 
Richard Greenwood
richard.greenwood at gmail.com
www.greenwoodmap.com

On Thu, 2 Sep 2004 15:34:10 -0500, Bj=?ISO-8859-1?Q?=F6rn?= Schaffrath
<2bjoerns at gmx.de> wrote:
> hello,
> 
> i'm looking for a simple way via cgi to make mapsize perisistent. so a user
> can choose a big mapsize (in the mapfile is a small one) and it´s checked
> everytime he submits.
> 
> think something like this:
> 
> <input type="checkbox" NAME="mapsize" VALUE="780 450"
> [mapsize_780_450_check] >780 x 450
> 
> ... but it does not work.
> 
> thanks for your help
> 
> björn
>



More information about the MapServer-users mailing list