[Mapserver-users] Zoom In to a defined area

Palle Due Larsen palle at mail-online.dk
Wed Sep 3 09:38:37 EDT 2003


Another possibility is 
newExtent =
msForm.ViewArea.options[msForm.ViewArea.selectedIndex].value.replace(/
/g, "+");

That will replace the blanks with +'s.

Best Regadrs

Pall Due Larsen
Carl Bro GIS&IT

-----Original Message-----
From: "Lowther, David W" <dlowther at ou.edu>
To: mapserver-users at lists.gis.umn.edu
Date: Wed, 3 Sep 2003 07:56:46 -0500
Subject: RE: [Mapserver-users] Zoom In to a defined area

> Jeff,
> 
> First - yes, it is correct to set IMGEXT.
> 
> Your problem is with javascript - that was my biggest hurdle also.
> 
> What you want to do is:
> A - get the value of the selected element of the combo box
> B - assign it to imgext in your mapserv form
> C - submit the form.
> 
> Only javascript could make this difficult...
> 
> Try this:
> 
> function AreaSelected(){
> 	msForm = document.myform;
> 	//a
> 	newExtent =
> msForm.ViewArea.options[msForm.ViewArea.selectedIndex].value;
> 	//b
> 	msForm.imgext.value = newExtent;
> 	//c
> 	msForm.submit();
> }
> 
> Dave
> 
> > -----Original Message-----
> > From: Jeff L. [mailto:nf10 at hotmail.com] 
> > Sent: Wednesday, September 03, 2003 7:34 AM
> > To: dlowther at ou.edu; palle at mail-online.dk; 
> > mapserver-users at lists.gis.umn.edu
> > Subject: Re: [Mapserver-users] Zoom In to a defined area
> > 
> > 
> > Hi Palle and David,
> > 
> > I tried to change my code by setting mapext to the ViewArea 
> > value, but no 
> > success so far.
> > When i select an option from my combo box, the map is 
> > redrawed but with the 
> > old mapext value.
> > It's seems that i'm not setting correctly the new mapext. 
> > MapServer is using 
> > it's mapext value not the one i'm setting.
> > 
> > I'm using this code snippet. Any help how to set correctly mapext
> is 
> > appreciated.
> > 
> > function AreaSelected()
> > {
> >       if (document.forms[0].ViewArea.selectedIndex != 0 &&
> >           document.forms[0].ViewArea.selectedIndex !=1)
> >          {
> >             mapext = document.forms[0].ViewArea.value;
> >             document.forms[0].submit();
> >         }
> > }
> > ...
> > 
> > <form method=GET action="[program]" name=myform>
> > ...
> > 
> > <SELECT NAME="ViewArea"  onChange="AreaSelected()">
> >    <OPTION VALUE="">Go to</OPTION>
> >    <OPTION VALUE="">- - - - - - - - - - - - - </OPTION>
> >    <OPTION VALUE="-180 45 180 90">Area 1</OPTION>
> >    <OPTION VALUE="-180 0 180 45">Area 2</OPTION>
> > </SELECT >
> > 
> > ...
> > <input type="hidden" name="imgxy" value="299.5 299.5">
> > <input  type="hidden" name="imgext" value="[mapext]"> // Is 
> > this is correct 
> > ?
> > ....
> > 
> > </form>
> > 
> > 
> > 
> > Jeff Lacoste
> > 
> > _________________________________________________________________
> > MSN 8 with e-mail virus protection service: 2 months FREE*  
> > http://join.msn.com/?page=features/virus
> > 
> > 
> > 
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users

Få en gratis emailkonto her: www.mail-online.dk 
-----------------------------------------------
Deltag i en lille konkurrence på nettet, og
vind et gavekort på 50.000 kroner...
KLIK HER: www.directoffice.dk/konkurrence





More information about the mapserver-users mailing list