[Mapserver-users] A Legend question and a Scale question
Richie Pierce
Richard.Pierce at mail.state.ar.us
Fri Feb 13 07:51:59 PST 2004
This is a multi-part message in MIME format.
------_=_NextPart_001_01C3F249.508E86A4
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Hello All,
I am trying to move into using PHP\Mapscripts which I have
never used. I have made some small changes to the GMAP demo and have it
up and running. I have 2 questions.
=20
1) I have set a scale tolerance on some of my layers and I am
trying to get the scale to print to the map so that the user will know
what scale they are at. I grabbed some code from the GMAP demo and have
gotten it to work, somewhat. It works except on the initial load of the
page. When the page loads it prints -1.00000. But when the user clicks
refresh, or zoom, or anything and updates the page. The scale is
printed correctly. I was wondering what I'm missing. I was also
wanting to remove the decimal points and round the scale to a whole
number. Here's my snippet that I use in my include file.
=20
function ARGetScale()
{
GLOBAL $gpoMap;
=20
$nScale =3D $gpoMap->scale;
=20
printf("%f <BR>\n", $nScale);
}
=20
=20
2) Because I have a scale tolerance set on some of my layers I was
wanting the legend to only show the layers that are active. I would
prefer to use PHP\Mapscripts to accomplish this. At the moment all the
layers are showing and they are all checked on because that is how they
are set in the map file. Even though some of them might not be showing
on the map because of their MIN and MAXSCALE settings. Does anyone have
a snippet where they have a legend only show the active layers using
PHP\Mapscripts. I am using the same code that is in the GMap demo.
=20
Any help would be great. Thanks in advance.
=20
=20
Richie
=20
=20
=20
Richie Pierce
GIS Cadastral Specialist
Arkansas Geographic Information Office
124 W. Capitol St.
Little Rock, AR 72201
(w) 501-682-2937
(c) 501-416-CAMP
www.gis.state.ar.us
=20
------_=_NextPart_001_01C3F249.508E86A4
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 10 (filtered)">
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EmailStyle17
{font-family:Arial;
color:windowtext;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
/* List Definitions */
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
-->
</style>
</head>
<body lang=3DEN-US link=3Dblue vlink=3Dpurple>
<div class=3DSection1>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Hello All,</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> =
I
am trying to move into using PHP\Mapscripts which I have never =
used. I
have made some small changes to the GMAP demo and have it up and =
running.
I have 2 questions.</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal style=3D'margin-left:.5in;text-indent:-.25in'><font =
size=3D2
face=3DArial><span style=3D'font-size:10.0pt;font-family:Arial'>1)<font =
size=3D1
face=3D"Times New Roman"><span style=3D'font:7.0pt "Times New =
Roman"'>
</span></font></span></font><font size=3D2 face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial'>I have set a scale tolerance on some of my =
layers and
I am trying to get the scale to print to the map so that the user will =
know
what scale they are at. I grabbed some code from the GMAP demo and =
have gotten
it to work, somewhat. It works except on the initial load of the
page. When the page loads it prints -1.00000. But when the =
user
clicks refresh, or zoom, or anything and updates the page. The =
scale is
printed correctly. I was wondering what I’m missing. I =
was
also wanting to remove the decimal points and round the scale to a whole
number. Here’s my snippet that I use in my include =
file.</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>function ARGetScale()</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>{</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> GLOBAL $gpoMap;</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> $nScale =3D =
$gpoMap->scale;</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> printf("%f <BR>\n", =
$nScale);</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>}</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal style=3D'margin-left:.5in;text-indent:-.25in'><font =
size=3D2
face=3DArial><span style=3D'font-size:10.0pt;font-family:Arial'>2)<font =
size=3D1
face=3D"Times New Roman"><span style=3D'font:7.0pt "Times New =
Roman"'>
</span></font></span></font><font size=3D2 face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial'>Because I have a scale tolerance set on some =
of my
layers I was wanting the legend to only show the layers that are =
active.
I would prefer to use PHP\Mapscripts to accomplish this. At the =
moment
all the layers are showing and they are all checked on because that is =
how they
are set in the map file. Even though some of them might not be =
showing on
the map because of their MIN and MAXSCALE settings. Does anyone =
have a
snippet where they have a legend only show the active layers using =
PHP\Mapscripts.
I am using the same code that is in the GMap demo.</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Any help would be great. Thanks in =
advance.</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Richie</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Richie Pierce</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>GIS Cadastral Specialist</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Arkansas</span></font><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'> Geographic Information =
Office</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>124 </span></font><font size=3D2 face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>W. Capitol =
St</span></font><font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>.</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Little Rock</span></font><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>, </span></font><font =
size=3D2
face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>AR</span></font><font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'> </span></font><font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>72201</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>(w) 501-682-2937</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>(c) 501-416-CAMP</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>www.</span></font><font size=3D2 face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>gis</span></font><font =
size=3D2
face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>.state.ar.us</span></font></=
p>
<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'> </span></font></p>
</div>
</body>
</html>
=00
------_=_NextPart_001_01C3F249.508E86A4--
More information about the MapServer-users
mailing list