4

I need to put checkbox with name "Zoom to extents" which will zoom to full map extent (first extent which appears by opening web page). Can someone help me? In mapfile I have this "EXTENT 563090 5072655 588220 5093325".

againstflow
  • 5,034
  • 18
  • 56
  • 87

2 Answers2

3

Maybe this tutorial can help: http://docs.huihoo.com/mapserver/5.2.1/mapscript/php/by_example.html

This code will zoom out, zoom in, pan, and restore to full extent the image displayed in the previous example.

underdark
  • 84,148
  • 21
  • 231
  • 413
  • That tutorial is for using PHP mapscript (note: current version is at http://mapserver.org/mapscript/php/by_example.html, search the page for 'Full Extent'). If you want "old school" CGI mapserver, try this tutorial: http://biometry.gis.umn.edu/tutorial/sections.html and/or the CGI variables page http://mapserver.org/cgi/controls.html. – neuhausr Jun 13 '11 at 14:25
0

you can do it by changing BBOX in URL with javascript like this for example,

HTML:

<div onclick="func()>
   <label><input type="checkbox" id="checking">Zoom to extent</label>
</div>

javascript:

function func(){
    document.getElementById("imageID").src = "http://localhost/cgi-bin/mapserv.exe?map=../MAP.map....&BBOX=[full extent]&..."
}
Neperin
  • 66
  • 6