Label layer...
Rob P.
rob at DATAFLOWDESIGN.COM
Wed Apr 6 07:26:00 PDT 2005
>>>>> "Rob" == Rob P <rob at dataflowdesign.com> writes:
>>>>> "Paul" == Paul james <pauljame at GMAIL.COM> writes:
Paul> Hi, I have a point layer with a label... I´d like to know
Paul> how can I turn on/turn off only the label ... May I do other
Paul> layer ? Sample?? I´m using php/mapscript
Rob> I do it like this:
Rob> $layerObj->set("labelminscale", 0);
Rob> $layerObj->set("labelmaxscale", 0);
Rob> Regards, Rob
Sorry to post twice. The above needs more explanation. To turn off
labelling, set both the labelmin/max scale values to zero. In
php/mapscript, I use code like this:
$layerObj->set("labelminscale", 0);
$layerObj->set("labelmaxscale", 0);
.
By not specifying LABELMIN/MAXSCALE in your map file, you will get
labels. But to turn on labeling from php, I think (never had to turn
them back on) you can set the labelmin/max scale values to bracket the
$mapObj->scale. So if your map scale ($mapObj->scale) is 20000, then
do something like this:
$layerObj->set("labelminscale", 0);
$layerObj->set("labelmaxscale", 100000000);
This is the only way I know. If there's another way, please let me
know.
Rob
Paul> Thank you
Paul> LAYER NAME state TYPE POINT STATUS ON CONNECTIONTYPE POSTGIS
Paul> CONNECTION "user=x password=x dbname=x host= x" DATA
Paul> "the_geom from states" LABELITEM "name" LABELCACHE ON
Paul> CLASS NAME "state_" OUTLINECOLOR 255 0 0 COLOR 10 90 10
Paul> SYMBOL 'circle' SIZE 5 LABEL FONT fritqat SIZE 6 TYPE
Paul> TRUETYPE COLOR 255 0 0 FORCE TRUE OUTLINECOLOR 255 200 200
Paul> PARTIALS TRUE POSITION AUTO END END
--
-------------------
Robert G. Piepul
PO Box 52405
Tulsa OK 74152-0405
918-749-8454
More information about the MapServer-users
mailing list