ok - got zoom to work - another question
David Fawcett
David.Fawcett at STATE.MN.US
Wed Nov 24 13:48:32 PST 2004
Just another column in the shapefile .dbf
>>> "Joseph Norris" <sirronj at pacbell.net> 11/24/2004 3:38:17 PM >>>
Thanks for this information. And as always it leads to another
question.
When you say add a field to your shapefile - are you referring to just
the
dbf file or is there something I have to do to the shp file itself?
This
would be a general type question on adding any type data to shapefiles
-
what is the process for doing this?
#Joseph Norris (Perl - what else is there?/Linux/CGI/Mysql) print
@c=map chr
$_+100,(6,17,15,16,-68,-3,10,11,16,4,1,14,-68,12,1,14,8,-68,4,-3,-1,7,1,14,-
68,-26,11,15,1,12,4,-68,-22,11,14,14,5,15,-90);
-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at lists.umn.edu]On
Behalf Of David Fawcett
Sent: Wednesday, November 24, 2004 11:35 AM
To: MAPSERVER-USERS at lists.umn.edu
Subject: Re: [UMN_MAPSERVER-USERS] ok - got zoom to work - another
question
Joseph,
The most simple way to do this is to have a field in your shapefile
with text for each label. (e.g. 23 teachers, 10 teachers, etc.)
Call it something like 'labeltext'.
Then in the Layer Object in the Map File for the layer that you want
to
label, place a LABELITEM.
LABELITEM 'labeltext'
If you are just storing the number of teachers in a ZipCode in the
shapefile, you can concatonate a label together by using.
TEXT ([NUM_TEACHERS] Teachers) in your class.
David.
>>> Joseph Norris <sirronj at PACBELL.NET> 11/24/2004 1:11:55 PM >>>
Thanks Dylan,
A question: I have found these parms labelminscale and labelmaxscale.
How
do I set the label for "23 teachers" or "10 teachers" so that - as I
understand when the user zooms into a polygon, the see this label.
Does
that
have something to do with Feature object?
#Joseph Norris (Perl - what else is there?/Linux/CGI/Mysql) print
@c=map chr
$_+100,(6,17,15,16,-68,-3,10,11,16,4,1,14,-68,12,1,14,8,-68,4,-3,-1,7,1,14,-
68,-26,11,15,1,12,4,-68,-22,11,14,14,5,15,-90);
-----Original Message-----
From: Dylan Keon [mailto:keon at nacse.org]
Sent: Wednesday, November 24, 2004 10:32 AM
To: Joseph Norris
Cc: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: Re: [UMN_MAPSERVER-USERS] ok - got zoom to work - another
question
On 11/24/2004 10:13 AM, Joseph Norris wrote:
> The lengthy <elaborate kludge> that you mention is something I
would
like
> to avoid due to the nature of the project. So that leaves me with
the
> open-ended question to all - what suggestions do any and all have
with
> regard to the last part of what I am trying to accomplish - namely -
allow
> the user to zoom into a polygon and see some representation of
what's
> there - a label of the actual number of teachers? I am opened to
that
but
at
> this point in my mapserver education, I am limited in my
understanding of
> Labeling. Can a label be placed within the minscale/maxscale
scenario
so
> that when you zoom in you see the label and when you zoom out it
disappears?
Yes. Look for LABELMINSCALE and LABELMAXSCALE at
http://mapserver.gis.umn.edu/doc42/mapfile-reference.html. Just store
the desired label as an attribute within the shapefile. There are
also
ways to apply labels dynamically via mapscript.
--Dylan
More information about the MapServer-users
mailing list