It should be substituted. Try with some other simple values like [extent] or [mapx] &nbsp [mapy] on your template and their values should be displayed. You can also try using mode=browse into your url that calls mapserv. www.host.com/cgi-bin/mapserv?mode=browse&map=yourmapfile.map.......
 
saludos
Luis
----- Original Message -----
Sent: Monday, January 30, 2006 11:03 AM
Subject: Re: [UMN_MAPSERVER-USERS] scale?

Muy Bien!
Thanks for that Luis.
 
You say that the subsitution is done by mapserver CGI? I've insterted the following code into my html template as per a previous suggestion:
 

<td>

Map Scale: &nbsp &nbsp &nbsp 1:[scale]

</td>

 

However the output of this code doesnt is as follows:

Map Scale:    1:[scale]

 

It would seem that the scale value isnt being subsituted. Can you suggest what might (or might not) be causing this?

Gracias

Jeremy

 

 

-----Original Message-----
From: Luis Treviño Huerta [mailto:[EMAIL PROTECTED]
Sent: January 30, 2006 11:51 AM
To: Sears, Jeremy; [email protected]
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 > of your template.

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

Regards,

Luis

----- Original Message -----
Sent: Monday, January 30, 2006 10:38 AM
Subject: RE: [UMN_MAPSERVER-USERS] scale?

Thanks for the reply Luis,
I would indeed like to see your code.
 
>>you can use [scale] in your template file.
 
Formating aside, Im assuming that the template file need to have some extra code inorder to subsitute [scale] with the value of the scale. Is this assumption correct? If so, where can I find that code?
 
Thanks
Jeremy
 
-----Original Message-----
From: Luis Treviño Huerta [mailto:[EMAIL PROTECTED]
Sent: January 30, 2006 11:21 AM
To: Sears, Jeremy; [email protected]
Subject: Re: [UMN_MAPSERVER-USERS] scale?

Jeremy:
 
you can use [scale] in your template file.
 
Use some _javascript_ to format the value of scale (like: 1:50,000 or 1:50.000). I have a small code that does this formating using a getElementById. if you want it I can mail it to you.
 
Regards
Luis
----- Original Message -----
Sent: Monday, January 30, 2006 9:45 AM
Subject: [UMN_MAPSERVER-USERS] scale?

Hi All,
This should be an easy question, however I cant find information on it....
 
How does one display the scale of a map? Im looking to have mapserver (or other means?) produce a scale like "1:50 000", rather than the scale bar.
 
Thanks
Jeremy
 
-----Original Message-----
From: UMN MapServer Users List [mailto:[EMAIL PROTECTED]On Behalf Of Jerl Simpson
Sent: January 30, 2006 10:27 AM
To: [email protected]
Subject: [UMN_MAPSERVER-USERS] setting variable value in mapfile

Hello,

I know I can easily use variables in a mapfile, when the value comes from cookies or a GET request.  But what about setting a variable inside the mapfile itself?
Something like:

HIGHWAY_MAX_SCALE=2000000
HIGHWAY_MIN_SCALE=90000

or

HIGHWAY_COLOR="255 250 115"

then be able to use something like:

COLOR  %HIGHWAY_COLOR%

in a CLASS


That way if I decide I want to change a color, I can change it once, and have it take affect for everywhere else?

Thanks,


Jerl

Reply via email to