[mapserver-users] duplicate labels

andy andy at squeakycode.net
Fri Jul 17 21:05:03 EDT 2009


Lars Lingner wrote:
> Andy Colson schrieb:
> [...]
>>>> The help says layer.sizeUnits "Sets the unit of CLASS object SIZE", does
>>>> that include label font size?
>>> it sets the unit of the object size, not the size itself. The font size
>>> is controlled by the SIZE parameter (LABEL object)
>>>
>> Then why did the labels font size change?
> 
> I'm not sure about this. If I'm changing sizeunits from meters to
> kilometers, my style looks realy awkward but my labels are stay the same.
> 
> 
>> Here is my entire mapfile, the annotate_pin layer is at the bottom:
>>
>> MAP
>>     NAME bremer
>>     SIZE 800 800
>>     UNITS feet
>>     SHAPEPATH '/pub/maps/bremerIA'
>>     FONTSET "/pub/www/fonts/fonts.txt"
>>
>>     # full extent
>>     EXTENT 5166680.718750 3687027.837500 5306080.031250 3802972.662500
>>     # testing
>>     #EXTENT 5191357.283967 3726454.400032 5205566.339522 3738272.725606
>>
>>     PROJECTION
>>         "init=epsg:3417"
>>     END
>>
> [...]
>>     WEB
>>         IMAGEPATH '/tmp/'
>>         IMAGEURL '/tmp/'
>>         METADATA
>>             'wms_title'           'bremer'
>>             'wms_onlineresource' 
>> 'http://my.host.com/cgi-bin/mapserv?map=wms.map&'
>>             'wms_srs'             'EPSG:3417'
>>         END
>>     END
>>
>>
> 
> [...]
> 
>>     LAYER
>>         NAME annotate_pin
>>         TYPE line
>>         STATUS on
>> # if I comment the SIZEUNITS out it only changes the label size
>>         SIZEUNITS feet
>>         CLASS
>>             NAME "HIGHLIGHT"
>>             STYLE
>>                 COLOR 0 255 0
>>                 OUTLINECOLOR 0 255 0
>>                 WIDTH 3
>>             END
>>             LABEL
>>                 TYPE truetype
>>                 FONT "Vera"
>>                 SIZE 10
>>                 COLOR 0 0 0
>>                 BACKGROUNDCOLOR 255 255 255
>>                 ANGLE follow
>>                 POSITION auto
>>                 PARTIALS false
>>                 MINDISTANCE 95000
>>             END
>>         END
>>     END
>> END
>>
>>
> 
> 
> The mapfile looks fine. I'm unsing MINDISTANCE the same way for
> controlling road labels.
> 
> One other thing you can try is to play with BUFFER for the labels.
> 
> Which version of MapServer are you using? I know along with 5.4 there
> where some enhancements for labeling.
> 
> One last thought: Do you have this problem just with the layer
> "annotate_pin"? Does the labeling of other layers work as you expect?
> 
> lars

I'm using 5.4.1, perl mapscript, via OpenLayers vai WMS.  (Jeez, I hope that conveys meaning, because it could really easily be complete gibberish :-) )

> One last thought: Do you have this problem just with the layer
> "annotate_pin"? Does the labeling of other layers work as you expect?

Hum... good question.  I'll try it Monday when I get back to work.  Thanks for the help on this.

-Andy
 


More information about the mapserver-users mailing list