[mapguide-trac] #258: cut-off labels problem

MapGuide Open Source trac_mapguide at osgeo.org
Wed Sep 12 00:05:26 EDT 2007


#258: cut-off labels problem
---------------------------------+------------------------------------------
   Reporter:  traianstanev       |       Owner:  traianstanev
       Type:  defect             |      Status:  new         
   Priority:  medium             |   Milestone:              
  Component:  Rendering Service  |     Version:              
   Severity:  minor              |    Keywords:              
External_id:                     |  
---------------------------------+------------------------------------------
 Here is a description by Martin Miller who submitted the patch:

 For polygons that span at least 3 tiles in either the horizontal or
 vertical direction, the code attempts to cover them with labels by placing
 them in regular intervals, one label each1.5 tiles in both the X and Y
 directions.

 An offset is applied in the X direction to every second row of labels (I
 guess to enhance the appearance of the spacing).
 However, before placing the labels a check is made to "reject labels that
 are far outside the current tile and also make sure the point is inside
 the polygon". When a label falls on a tile border, that label position may
 be an odd number in the sequence of tested labels for one tile, but an
 even number in the sequence of tested labels for the neighboring tile,
 resulting in the offset being applied only to one of them and thus one
 part of the label being shifted by the offset from the other part. When a
 number of tiles are displayed together (as is usually the case), it looks
 like the labels that fall on the (invisible) tile boundary are cut off.

 I have applied and tested a simple fix - disabling the offset of every
 second row of labels.

 Comment out line 264:
   offset = !offset;
 in LabelRendererLocal::ProcessLabelGroup() in file
 Common\Stylization\LabelRendererLocal.cpp

 Note that this is just a simple fix to disable the alternating X-offset.
 If we do need the 'enhanced spacing' - which applies the offset to every
 other row of labels, the code will need to be enhanced to ensure that the
 offset is the same for each part of an actual placement of the label.

-- 
Ticket URL: <http://trac.osgeo.org/mapguide/ticket/258>
MapGuide Open Source <http://mapguide.osgeo.org/>
MapGuide Open Source Internals


More information about the mapguide-trac mailing list