scale?

Chip Taylor work at XWB.COM
Mon Jan 30 08:57:20 PST 2006


Gracias Luis.  This is very helpful.

 

Chip Taylor

Prepared Response, Inc

 

  _____  

From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On
Behalf Of Luis Treviño Huerta
Sent: Monday, January 30, 2006 8:51 AM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: Re: [UMN_MAPSERVER-USERS] scale?

 

Jeremy:

 

The substitution of the [scale] value is done by mapserver CGI.

this is the javascript function:

function TomaEscala(scale){

var escala, escalaStr, decimal;

escala = scale; 

escala *= 100; 

escala = Math.round(escala); 

escala /= 100; 

escalaStr = Math.abs(escala).toString(); 

entero = escalaStr.substr (0,escalaStr.length-3);

if (entero.length > 3) {

    longitud = entero.length % 3;

    while (longitud < entero.length) {

    if (longitud == 0) {

        longitud = 3;

    }

    entero = entero.substr (0,longitud) + "," +
entero.substr(longitud,entero.length);

    longitud += 4;

    }

 }

  escalaStr = entero;

   if (document.createTextNode){

   var mytext=document.createTextNode(escalaStr)

   document.getElementById("MyElementID").appendChild(mytext)

   }

}

You can call this fuction on the <body onload="TomaEscala([scale]);"> of
your template.

(some words are in spanish but I'm sure is not a problem)

Regards,

Luis

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20060130/4574cfac/attachment.htm>


More information about the MapServer-users mailing list