[mapserver-users] Is there a way to add a single click zoom button

boesiii boesiii at yahoo.com
Mon Jan 19 16:30:32 EST 2009


PG


I added the script and the button control but I am not sure about the third
item you mentioned.  I added the lines "<input type="hidden" name="imgxy"
value="[center]" />
<input type="hidden" name="zoom" value="2" />" in the mapserver variables
section but when I click the button nothing happens?

What is the problem?




Pietro Giannini wrote:
> 
> Yes, but using some javascript in template html.
> 
> if you want to zoomin 2x:
> 
> <script language="JavaScript">
>  function zoom2x()
>  {
>  	document.forms['mapserv'].imgxy.value = [mapwidth]/2 + " " +
> [mapheight]/2;
>  	document.forms['mapserv'].zoom.value = 2;
>  	document.forms['mapserv'].submit();
>  }
> </script>
> 
> called from a button control:
> <input type="button" value="zoom in 2 X" onclick="javascript:zoom2x();">
> 
> assuming that you have an hidden field named 'imgxy' and a control
> (select, radio, another hidden fiedl...) named 'zoom' in a form named
> 'mapserv'.
> 
> ciao
> .......................pg
> 
> -- 
> Pietro Giannini
> Bytewise srl - Area GIS
> 41°50'38.58"N 12°29'13.39"E
> 
> 
> 
> On Mer, Gennaio 14, 2009 18:34, boesiii wrote:
>>
>> by just using the map file and html template file.
>> --
>> View this message in context:
>> http://n2.nabble.com/Is-there-a-way-to-add-a-single-click-zoom-button-tp2158109p2158109.html
>> Sent from the Mapserver - User mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> mapserver-users mailing list
>> mapserver-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>>
> 
> 
> 
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
> 

-- 
View this message in context: http://n2.nabble.com/Is-there-a-way-to-add-a-single-click-zoom-button-tp2158109p2183552.html
Sent from the Mapserver - User mailing list archive at Nabble.com.



More information about the mapserver-users mailing list