[OpenLayers-Users] [mapserver-users] Multiple LabelItems using Mapserver 5.2 and Openlayers

Tiemens, Gerben Gerben.Tiemens at grontmij.nl
Fri Oct 31 12:56:41 EDT 2008


This is can be due to the fact that a label will be printed on a maptile and the polygon or line is on both maptiles.  The mapserver will adjust the placement of your label to fit on your tile due to your "partials = false" and position = auto

Setting openlayers in untiled, or using tilecache with metatiles, will solve your problem.

Greetings
Gerben


________________________________
Van: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] Namens Karl Suiter
Verzonden: Friday, October 31, 2008 5:06 PM
Aan: mapserver-users at lists.osgeo.org; users at openlayers.org
Onderwerp: [mapserver-users] Multiple LabelItems using Mapserver 5.2 and Openlayers

Hello All,

  I'm using Mapserver 5.2 and Openlayers 2.6 as my map interface.  When called using Openlayers, Mapserver renders two LabelItems when the layer to be labels is of type "polygon".  I've sort of fixed this issue by including PROCESSING "LABEL_NO_CLIP=1" in the Layer definition.

  So, for the most part, it works OK.  But on some generated maps, I still see one Layer that still renders two Labels.

  I then noticed that if I tweaked the OpenLayers "minScale" value when defining a new map (see below), I could get suppression of the second label.

   var map = new OpenLayers.Map( 'map', {controls: [], maxExtent: bounds, restrictedExtent: bounds, projection:"none", minScale: 10000, units: "m" } );  // change the minScale to 15 to suppress the 2nd label

  I would like to remove the minScale variable from the Openlayers map definition, but that pesky second LabelItem keeps coming back.

  Has anyone seen/fixed this problem?  Should I create a bug ticket.  FYI - I am cross-posting to the OpenLayers listserve to see if anyone there has experienced this problem.

  Here is my Layer definition I've been working with:

  LAYER
    NAME CR01
    STATUS OFF
    DATA cr.shp
    TYPE POLYGON
    CLASSITEM "FIPS_ADMIN"
    LABELITEM "ADMIN_NAME"
    PROCESSING "LABEL_NO_CLIP=1"
    CLASS
        NAME "FIPS_ADMIN"
        EXPRESSION "CR01"
        COLOR 226 166 166 # E2A6A6
        OUTLINECOLOR 32 32 32
          LABEL
            COLOR 0 0 0
            TYPE TRUETYPE
            FONT verdana
            SIZE 10
            ANTIALIAS TRUE
            POSITION AUTO
            PARTIALS FALSE
            MINDISTANCE 300
            BUFFER 4
          END # end of label
      END
  END


Thanks!

Karl Suiter



<< Please read our E-mail Disclaimer at the Grontmij Corporate website >>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20081031/7ca26cb4/attachment.html


More information about the Users mailing list