[mapserver-users] Re: Annotations not appearing on map with phpMapscript - Solution

NVohra at eq-technologic.com NVohra at eq-technologic.com
Tue Nov 26 23:22:16 EST 2002


Hello,
     I am sorry for not posting the solution before, but was just testing
it thoroughly.
     The main difference in my original Layer definition, in the map file,
and the working is that i kept
     LABELCACHE on in place of off. After that realisation, I found it to
be quite straight forward.

     php file code :

     $layer = $map->getLayerByName('line3');
     $class = $layer->getClass(0);
     $class->setExpression("([ID] == 15004 || [ID] == 14683)");   //testing
for data with just two object ids
     $layer->draw($image);

     map file :

     LAYER
          NAME line3
          TYPE annotation
          DATA line2
          STATUS DEFAULT
          LABELCACHE off      #originally this was  LABELCACHE on, so not
working
          LABELITEM "LABEL"
          CLASS
               EXPRESSION ([ID] == 0) #to avoid showing data from start
               NAME "ptclass"
               OUTLINECOLOR 199 216 252
               COLOR 199 216 252
               LABEL
                    ANGLE AUTO
                    BUFFER 3
                    FONT arial
                    TYPE truetype
                    SIZE 8
                    COLOR 0 0 0
                    OUTLINECOLOR 199 216 252
                    POSITION cc
                    FORCE true
                    BACKGROUNDCOLOR 255 255 255
               END
          END
     END

I found it working for the following environment:
PHP ver4.0.6 with MapScript Version (Nov 27, 2001) and
MapServer version 3.5 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
SUPPORTS=PROJ SUPPORTS=TTF SUPPORTS=WMS_SERVER
 SUPPORTS=WMS_CLIENT INPUT=EPPL7 INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
on WinNT.

Nischal Vohra
- - - - - - - - - - - -
That one last shot's a Permanent Vacation
And a how high can you fly with broken wings
Life's a journey - not a destination
And I just can't tell just what tomorrow brings -
Aerosmith
- - - - - - - - - - - -





More information about the mapserver-users mailing list