[mapserver-users] PHP mapscript: drawing labels as top layer

Jim Sproull sproull.j at emstechnologies.ca
Fri Nov 29 08:57:45 EST 2002


Hi all,

 I'm developing a mapscript application using the latest (3.6.3) version
of mapserver with the php module.  I'm trying to perform the fairly
basic function of drawing a map, followed by assigning a custom colour
to a particular shape, followed by all relevant labels (from the label
cache).  Unfortunately, it seems no matter what I do, the shape always
sits on top of the labels.  Here's the general idea:

// $this->mapObject is predefined
$imgObj = $this->mapObject->prepareImage();

// My own method to get a particular shape
$Shape = $this->getShape();
$Shape->draw($this->mapObject, $Layer, $imgObj);

$this->mapObject->drawLabelCache($imgObj);

$mapImage = $this->mapObject->draw();
$mapImage->pasteImage($imgObj, 0);

This always pastes the shape object over the labels.  If I draw the map
object first, then draw the shape, then finally the label cache, it
works. However that method draws the labels twice, and almost doubles
the processing time.  Is there a way to draw the proper layer order
without duplicating labels?


-- 
Jim Sproull <sproull.j at emstechnologies.ca>
EMS Technologies




More information about the mapserver-users mailing list