[Mapserver-users] How to Draw Annotation Layer Last

Hankley, Chip Chip.Hankley at GASAI.Com
Tue Jan 21 13:47:46 EST 2003


Dan,

try using 'drawLabelCache' from MapScript right before you render your final
image:

  $img = $map->draw();
  $map->drawLabelCache($img);
  $url = $img->saveWebImage(MS_PNG, $map->transparent, $map->interlace, 50);

Chip Hankley


-----Original Message-----
From: Ed McNierney [mailto:ed at topozone.com]
Sent: Tuesday, January 21, 2003 12:30 PM
To: Dan Barron; mapserver-users at lists.gis.umn.edu
Subject: RE: [Mapserver-users] How to Draw Annotation Layer Last


Dan -

That seems very odd.  Can you try making the layer TYPE POINT and see if
that changes anything (just a stab in the dark)? 

    - Ed
-----Original Message-----
From: Dan Barron [mailto:dbarron at ddive.com]
Sent: Tuesday, January 21, 2003 1:23 PM
To: Ed McNierney; mapserver-users at lists.gis.umn.edu
Subject: RE: [Mapserver-users] How to Draw Annotation Layer Last


Ed,

Thanks for the reply.  I have and had tried moving the layer definition to
the beginning and the end of the map file with the same results.  I had
figured it to be more php/mapscript related issue, though when I draw the
layer last in php/mapscript I also have the same result - the annotation
layer is drawn under the other layers.  Any other ideas?

Thanks,

Dan

At 12:04 PM 1/21/2003 -0500, Ed McNierney wrote:

Dan -
 
MapServer draws all layers in order in the mapfile from bottom to top - that
is, each layer in turn is drawn on top of all preceding layers.  Put your
annotation layer as the last layer in the file.
 
    - Ed

Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA  01863
ed at topozone.com
(978) 251-4242 

-----Original Message-----

From: Dan Barron [mailto:dbarron at ddive.com]

Sent: Tuesday, January 21, 2003 11:49 AM

To: mapserver-users at lists.gis.umn.edu

Subject: [Mapserver-users] How to Draw Annotation Layer Last


Hello,


I have searched through the archives w/o much luck on determining what I am
doing wrong.  


I am using MapServer v3.5 and am trying to draw an annotation layer so it is
always the last layer to be drawn and shows on top of all other layers.
Right now it is always drawn under my other layers and is not seen.  I also
use PHP/Mapscript to create the maps and have tried to force this layer to
be drawn last, w/o success.  Can anyone clue me in on the method to ensure
this layer is always draw last, either via the map file only or via
php/mapscript?  Below is the map file entry for the layer and the
php/mapscript snippet.


Thanks!



LAYER

 NAME 'credits'

 STATUS ON

 TRANSFORM false

 TYPE annotation

 FEATURE

   POINTS 5 10 END

   TEXT '© www.destinationdive.com' 

 END

 CLASS

   LABEL

     TYPE truetype

     FONT verdana

     SIZE 8

     ANTIALIAS true

     COLOR 0 0 0 

     POSITION UR

   END

 END

END



// ~~~ DRAW Credits Layers ~~~

$creditsLayer = $map->getLayerByName( 'credits' );

$creditsLayer->set( 'status', MS_ON );

$creditsLayer->draw( $image );


// ~~~ DRAW the PNG files for map, scalebar, and reference map ~~~

$image_url_PNG=$image->saveWebImage(MS_PNG,1,1,0);



Dan Barron

Principal / Founder

Destination Software LLC - developers of Destination DIVE"

dbarron at ddive.com

http://www.destinationdive.com

(619) 275-5346




More information about the mapserver-users mailing list