Template example (but other demo on the web are still very useful for basic commands): I have a div which must contain something created by Mapserver, so I use a particular CGI variable and Mapserver constructs that element (the legend, the reference map, ...) Use square brackets [ ] for defining the cgi-variables.

<div>
       [cgi-variable]
</div>

or if you want to view the actual scale

<input name="scale" value="[scale]" />

Mapserver itself puts the real actual scale value in the value attribute of the input.

Hope this helps
Bye, Carlo


john tse ha scritto:
thanks for the reply, however, i've been playing around with it the last few days and still no luck for a customized zoom button. It would be most useful if anyone can actually show me a sample script of how to put something similar together so that i can learn from it. I don't get how the template fits with the CGI.

On Sun, Apr 13, 2008 at 11:20 PM, Carlo Pelliconi <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    I think you should try strarting with mapserver basic, not javascript.
    Mapserver CGI documentation (for functions) here:
    http://mapserver.gis.umn.edu/docs/reference/cgi/controls
    Then, for the template (i.e. the html which embeds the map):
    
http://mapserver.gis.umn.edu/docs/reference/templatereference/templatereference/view
    I've never used javascript for functions such as zoom in, because
    mapserver itself has them already defined.
    Good work.

    Carlo



    john tse ha scritto:

        Hi,Guys

         I'm currently doing a volunteer project and i need to get a
        zoom to button to work.
        This is the code i have right now

        <html>
        <body>
        <head>
        <script type = "text/javascript">
        // zoom to Region

           function GoRegion()  {

        //    alert(document.mapserv.mapzoomarea.value);

             document.mapserv.target="";

             document.mapserv.mode.value="browse";

             document.mapserv.imgext.value =
        (document.mapserv.mapzoomarea.value);

             document.mapserv.submit();
        </script>
        </head>

         <select name="mapzoomarea" onChange="GoRegion();">

           <option>Zoom to Region</option>

           <option>------------------------</option>

           <option value="5457203 487104 5451873 482304">Reserve
        2</option>

           <option value="5435308 491431 5434498 490403">Reserve
        4</option>

           <option value="5425919 541,907 5502970 444168">Musqueam
        Statement Of Intent</option>

           <option value="5435189 475830 5457751 504449">Richmond
        Boundary</option>

           <option value="5448859 481843 5463269 500122">Vancouver
        Boundary </option>
             <option value="5432692 482228 5457268 515426">North Arm
        Fraser River </option>

           </select>
        </body>
        </html>

        it doesn't do anything, and i have no idea what's wrong with
        it, any help will be much appreciated.

        thanx
        ------------------------------------------------------------------------

        _______________________________________________
        mapserver-users mailing list
        [email protected]
        <mailto:[email protected]>
        http://lists.osgeo.org/mailman/listinfo/mapserver-users


-- ing. Carlo Pelliconi
    [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
    SIS.TER S.p.A.
    www.sis-ter.it <http://www.sis-ter.it>
    via Mentana, 10
    40026 Imola (BO) Italy

    ATTENZIONE!
    Questo documento è indirizzato esclusivamente al destinatario.
    Tutte le
    informazioni ivi contenute, compresi eventuali allegati, sono soggette
    a riservatezza secondo i termini del D.Lgs. 196/2003 in materia di
    "privacy" e ne è proibita l'utilizzazione da parte di altri
    soggetti. Si ricorda che la diffusione l'utilizzo e/o la
    conservazione dei dati ricevuti per errore costituisce violazione
    di carattere penale ai sensi dell'art. 616 Codice penale
    (Violazione, sottrazione e soppressione di corrispondenza). Se
    avesse ricevuto per errore questo messaggio, La preghiamo
    cortesemente di contattare il mittente al più presto e di
    cancellare il messaggio subito dopo. Grazie.

    ATTENTION!
    This message is being sent from Sis.Ter S.p.A. and may contain
    information which is confidential or privileged. If you are not
    the intended recipient, please advise the sender immediately by
    reply e-mail and delete this message and any attachments without
    retaining a copy. Any unauthorized use of the content of this
    message is a breach of your duty to respect the confidentiality of
    the correspondence between other persons and can expose the
    responsible party to civil and/or criminal penalties (D.Lgs.
    196/2003 "Tutela della privacy" e art. 616 Codice penale
    "Violazione, sottrazione e soppressione di corrispondenza"), and
    may constitute a more serious offence. Thanks.

    ACHTUNG!
    Dieses Dokument ist ausschließlich dem Empfänger vorbehalten. Die
    darin enthaltenen Informationen, auch jene in etwaigen Anlagen,
    gelten im Sinne des Dekrets Nr. 196/2003 in Sachen "Privacy" als
    streng vertraulich und dürfen von anderen Personen nicht verwende
    werden. Wer diese Mitteilung irrtümlicherweise erhält ist gebeten
    uns umgehend zu informieren und anschließend die Mitteilung zu
    vernichten. Vielen Dank.





--
ing. Carlo Pelliconi
[EMAIL PROTECTED]
SIS.TER S.p.A.
www.sis-ter.it
via Mentana, 10
40026 Imola (BO) Italy
tel     +39 0542 364034
fax     +39 0542 612130




ATTENZIONE!
Questo documento è indirizzato esclusivamente al destinatario. Tutte le
informazioni ivi contenute, compresi eventuali allegati, sono soggette
a riservatezza secondo i termini del D.Lgs. 196/2003 in materia di
"privacy" e ne è proibita l'utilizzazione da parte di altri soggetti. Si 
ricorda che la diffusione l'utilizzo e/o la conservazione dei dati ricevuti per errore 
costituisce violazione di carattere penale ai sensi dell'art. 616 Codice penale 
(Violazione, sottrazione e soppressione di corrispondenza). Se avesse ricevuto per errore 
questo messaggio, La preghiamo cortesemente di contattare il mittente al più presto e di 
cancellare il messaggio subito dopo. Grazie.

ATTENTION!
This message is being sent from Sis.Ter S.p.A. and may contain information which is confidential or 
privileged. If you are not the intended recipient, please advise the sender immediately by reply 
e-mail and delete this message and any attachments without retaining a copy. Any unauthorized use 
of the content of this message is a breach of your duty to respect the confidentiality of the 
correspondence between other persons and can expose the responsible party to civil and/or criminal 
penalties (D.Lgs. 196/2003 "Tutela della privacy" e art. 616 Codice penale 
"Violazione, sottrazione e soppressione di corrispondenza"), and may constitute a more 
serious offence. Thanks.

ACHTUNG!
Dieses Dokument ist ausschließlich dem Empfänger vorbehalten. Die darin enthaltenen 
Informationen, auch jene in etwaigen Anlagen, gelten im Sinne des Dekrets Nr. 196/2003 in 
Sachen "Privacy" als streng vertraulich und dürfen von anderen Personen nicht 
verwende werden. Wer diese Mitteilung irrtümlicherweise erhält ist gebeten uns umgehend 
zu informieren und anschließend die Mitteilung zu vernichten. Vielen Dank.

_______________________________________________
mapserver-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to