[Mapserver-users] no labels on dynamic layer

Daniel Morissette morissette at dmsolutions.ca
Fri Sep 12 09:33:23 EDT 2003


It could be that the labels are stuck in the labelcache.  Perhaps try 
setting LABELCACHE FALSE on your layer or call $map->drawLabelCache() 
before saving the image.

Daniel



Frieso ter Haseborg wrote:
> Hi,
> 
> I'm just doing some experiments with dynamic layers. Drawing points and
> lines works fine, but I don't get any annotations/labels displayed in my
> map.
> 
> I used the map from the europe-mapscript-example and the code-examples
> from postings like
> http://mapserver.gis.umn.edu/wilma/mapserver-users/0007/msg00096.html
> http://mapserver.gis.umn.edu/data2/wilma/mapserver-users/0203/msg00319.h
> tml
> 
> Any ideas what I'm doing wrong?
> 
> My PHP/MapScript-Code looks like this:
> -----------------------------------
> [...]
> $image=$map->draw();
> 
> $layer =  $map->getLayerByName( "p" );
> $layer->set('status', MS_ON);
> 
> $pt = ms_newPointObj();
> $pt->setXY( -4100000, 10100000 );
> $pt->draw($map, $layer, $image, 0, "Pt1"); // isn't "Pt1" the label to
> be drawn????
> 
> $pt = ms_newPointObj();
> $pt->setXY( 4400000, 10000000 );
> $pt->draw($map, $layer, $image, 0, "Pt2");
> 
> $image_url=$image->saveWebImage(MS_GIF,1,1,0);
> [...]
> -----------------------------------
> 
> 
> and here the map-file:
> -----------------------------------
> [...]
> LAYER
> NAME world
> TYPE POLYGON
> STATUS ON
> DATA europa
> 	LABELITEM "name"
> 	CLASS
> 		OUTLINECOLOR 200 200 200
> 		LABEL
> 			COLOR 0 0 0
> 			POSITION AUTO
> 		END
> 	END
> 	TOLERANCE 10
> END
> 
> LAYER
> NAME p
> TYPE POINT
> STATUS ON	
> 	CLASS
> 		SYMBOL 15
> 		COLOR 255 0 0	
> 		SIZE 20		
> 		LABEL
> 			COLOR 0 0 0      	
> 		END	
> 	END	
> END
> [...]
> -----------------------------------
> 
> 
> TIA,
>  
> Frieso ter Haseborg
> - Software Development - 
>  
> --
> 
> -------------------------------------------------- 
> S&F Datentechnik GmbH&Co.KG 
> Reimersstr. 41b 
> 26789 Leer, Germany
> 




More information about the mapserver-users mailing list