[Mapserver-users] How to Draw Annotation Layer Last

Dan Barron dbarron at ddive.com
Tue Jan 21 15:07:56 EST 2003


--=====================_7244625==.ALT
Content-Type: text/plain; charset="iso-8859-1"; format=flowed
Content-Transfer-Encoding: quoted-printable

Thanks Ed & Chip,

I tried to set the layer to type point and the problem persists.

When I try to use the 'drawLabelCache()' method I get the following error=20
at the line of the php/mapscript file making the method call -

Fatal error: MapServer Error in msGetBitmapFont(): Invalid bitmap font.
Must be one of tiny, small, medium, large or giant.

Currently I have the annotation layer as the last layer entry in the map=20
file - and it is still being drawn over by the other layers.  Could it be=20
how I am defining my other layers?  Here is an example:

LAYER
   NAME 'states'
   TYPE POLYGON
   STATUS ON
   DATA 'north_america/usa/statesp020'
   MAXSCALE 26000000
   MINSCALE 1
   GROUP 'north_america'
   CLASS
     NAME 'states'
     OUTLINECOLOR 204 204 204
     COLOR 255 255 204
     LABEL
      COLOR 0 0 0
         SIZE SMALL
     END
   END
END


Am I possibly running into a v3.5 issue?

Dan

At 12:47 PM 1/21/2003 -0600, Hankley, Chip wrote:
Dan,

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

   $img =3D $map->draw();
   $map->drawLabelCache($img);
   $url =3D $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 '=A9 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 =3D $map->getLayerByName( 'credits' );

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

$creditsLayer->draw( $image );


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

$image_url_PNG=3D$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

_______________________________________________
Mapserver-users mailing list
Mapserver-users at lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users

--=====================_7244625==.ALT
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html>
<body>
<tt>Thanks Ed &amp; Chip,<br><br>
I tried to set the layer to type point and the problem=20
persists.<br><br>
When I try to use the 'drawLabelCache()' method I get the following error
at the line of the php/mapscript file making the method call - <br><br>
<a name=3D"hilite"></a>Fatal error: MapServer Error in msGetBitmapFont():
Invalid bitmap<a name=3D"hilite"></a> font.<br>
</b>Must be one of tiny, small, medium, large or giant. <br><br>
Currently I have the annotation layer as the last layer entry in the map
file - and it is still being drawn over by the other layers.&nbsp; Could
it be how I am defining my other layers?&nbsp; Here is an
example:<br><br>
LAYER<br>
&nbsp; NAME 'states'<br>
&nbsp; TYPE POLYGON<br>
&nbsp; STATUS ON<br>
&nbsp; DATA 'north_america/usa/statesp020'<br>
&nbsp; MAXSCALE 26000000<br>
&nbsp; MINSCALE 1<br>
&nbsp; GROUP 'north_america'<br>
&nbsp; CLASS<br>
&nbsp;&nbsp;&nbsp; NAME 'states'<br>
&nbsp;&nbsp;&nbsp; OUTLINECOLOR 204 204 204<br>
&nbsp;&nbsp;&nbsp; COLOR 255 255 204<br>
&nbsp;&nbsp;&nbsp; LABEL<br>
&nbsp;&nbsp;&nbsp;&nbsp; COLOR 0 0 0<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>SIZE
SMALL<br>
&nbsp;&nbsp;&nbsp; END<br>
&nbsp; END<br>
END<br><br>
<br>
Am I possibly running into a v3.5 issue?<br><br>
Dan<br><br>
At 12:47 PM 1/21/2003 -0600, Hankley, Chip wrote:<br>
Dan,<br><br>
try using 'drawLabelCache' from MapScript right before you render your
final<br>
image:<br><br>
&nbsp; $img =3D $map-&gt;draw();<br>
&nbsp; $map-&gt;drawLabelCache($img);<br>
&nbsp; $url =3D $img-&gt;saveWebImage(MS_PNG, $map-&gt;transparent,
$map-&gt;interlace, 50);<br><br>
Chip Hankley<br><br>
<br>
-----Original Message-----<br>
From: Ed McNierney
[<a href=3D"mailto:ed at topozone.com"=
 eudora=3D"autourl">mailto:ed at topozone.com</a>]<br>
Sent: Tuesday, January 21, 2003 12:30 PM<br>
To: Dan Barron; mapserver-users at lists.gis.umn.edu<br>
Subject: RE: [Mapserver-users] How to Draw Annotation Layer=20
Last<br><br>
<br>
Dan -<br><br>
That seems very odd.&nbsp; Can you try making the layer TYPE POINT and
see if<br>
that changes anything (just a stab in the dark)? <br><br>
&nbsp;&nbsp;&nbsp; - Ed<br>
-----Original Message-----<br>
From: Dan Barron
[<a href=3D"mailto:dbarron at ddive.com"=
 eudora=3D"autourl">mailto:dbarron at ddive.com</a>]<br>
Sent: Tuesday, January 21, 2003 1:23 PM<br>
To: Ed McNierney; mapserver-users at lists.gis.umn.edu<br>
Subject: RE: [Mapserver-users] How to Draw Annotation Layer=20
Last<br><br>
<br>
Ed,<br><br>
Thanks for the reply.&nbsp; I have and had tried moving the layer
definition to<br>
the beginning and the end of the map file with the same results.&nbsp; I
had<br>
figured it to be more php/mapscript related issue, though when I draw
the<br>
layer last in php/mapscript I also have the same result - the
annotation<br>
layer is drawn under the other layers.&nbsp; Any other ideas?<br><br>
Thanks,<br><br>
Dan<br><br>
At 12:04 PM 1/21/2003 -0500, Ed McNierney wrote:<br><br>
Dan -<br>
&nbsp;<br>
MapServer draws all layers in order in the mapfile from bottom to top -
that<br>
is, each layer in turn is drawn on top of all preceding layers.&nbsp; Put
your<br>
annotation layer as the last layer in the file.<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp; - Ed<br><br>
Ed McNierney<br>
President and Chief Mapmaker<br>
TopoZone.com / Maps a la carte, Inc.<br>
73 Princeton Street, Suite 305<br>
North Chelmsford, MA&nbsp; 01863<br>
ed at topozone.com<br>
(978) 251-4242 <br><br>
-----Original Message-----<br><br>
From: Dan Barron
[<a href=3D"mailto:dbarron at ddive.com"=
 eudora=3D"autourl">mailto:dbarron at ddive.com</a>]<br><br>
Sent: Tuesday, January 21, 2003 11:49 AM<br><br>
To: mapserver-users at lists.gis.umn.edu<br><br>
Subject: [Mapserver-users] How to Draw Annotation Layer Last<br><br>
<br>
Hello,<br><br>
<br>
I have searched through the archives w/o much luck on determining what I
am<br>
doing wrong.&nbsp; <br><br>
<br>
I am using MapServer v3.5 and am trying to draw an annotation layer so it
is<br>
always the last layer to be drawn and shows on top of all other
layers.<br>
Right now it is always drawn under my other layers and is not seen.&nbsp;
I also<br>
use PHP/Mapscript to create the maps and have tried to force this layer
to<br>
be drawn last, w/o success.&nbsp; Can anyone clue me in on the method to
ensure<br>
this layer is always draw last, either via the map file only or via<br>
php/mapscript?&nbsp; Below is the map file entry for the layer and
the<br>
php/mapscript snippet.<br><br>
<br>
Thanks!<br><br>
<br><br>
LAYER<br><br>
&nbsp;NAME 'credits'<br><br>
&nbsp;STATUS ON<br><br>
&nbsp;TRANSFORM false<br><br>
&nbsp;TYPE annotation<br><br>
&nbsp;FEATURE<br><br>
&nbsp;&nbsp; POINTS 5 10 END<br><br>
&nbsp;&nbsp; TEXT '=A9
<a href=3D"http://www.destinationdive.com/" eudora=3D"autourl">www.destinati=
ondive.com</a>'
<br><br>
&nbsp;END<br><br>
&nbsp;CLASS<br><br>
&nbsp;&nbsp; LABEL<br><br>
&nbsp;&nbsp;&nbsp;&nbsp; TYPE truetype<br><br>
&nbsp;&nbsp;&nbsp;&nbsp; FONT verdana<br><br>
&nbsp;&nbsp;&nbsp;&nbsp; SIZE 8<br><br>
&nbsp;&nbsp;&nbsp;&nbsp; ANTIALIAS true<br><br>
&nbsp;&nbsp;&nbsp;&nbsp; COLOR 0 0 0 <br><br>
&nbsp;&nbsp;&nbsp;&nbsp; POSITION UR<br><br>
&nbsp;&nbsp; END<br><br>
&nbsp;END<br><br>
END<br><br>
<br><br>
// ~~~ DRAW Credits Layers ~~~<br><br>
$creditsLayer =3D $map-&gt;getLayerByName( 'credits' );<br><br>
$creditsLayer-&gt;set( 'status', MS_ON );<br><br>
$creditsLayer-&gt;draw( $image );<br><br>
<br>
// ~~~ DRAW the PNG files for map, scalebar, and reference map
~~~<br><br>
$image_url_PNG=3D$image-&gt;saveWebImage(MS_PNG,1,1,0);<br><br>
<br><br>
Dan Barron<br><br>
Principal / Founder<br><br>
Destination Software LLC - developers of Destination DIVE&quot;<br><br>
dbarron at ddive.com<br><br>
<a href=3D"http://www.destinationdive.com/"=
 eudora=3D"autourl">http://www.destinationdive.com</a><br><br>
(619) 275-5346<br><br>
_______________________________________________<br>
Mapserver-users mailing list<br>
Mapserver-users at lists.gis.umn.edu<br>
<a href=3D"http://lists.gis.umn.edu/mailman/listinfo/mapserver-users"=
 eudora=3D"autourl">http://lists.gis.umn.edu/mailman/listinfo/mapserver-user=
s</a><br>
</body>
</html>

--=====================_7244625==.ALT--




More information about the mapserver-users mailing list