[mapguide-commits] r8361 - in branches/2.6/MgDev: . Common/Stylization
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Sat Sep 27 00:11:20 PDT 2014
Author: jng
Date: 2014-09-27 00:11:20 -0700 (Sat, 27 Sep 2014)
New Revision: 8361
Modified:
branches/2.6/MgDev/
branches/2.6/MgDev/Common/Stylization/LabelRendererLocal.cpp
Log:
Merged revision(s) 8359 from trunk/MgDev:
#2484: Base layers with labels do not render correctly. Submit on behalf of Andy Zhang.
http://trac.osgeo.org/mapguide/ticket/2484. When a point feature source is used as a base layer, and a feature label is applied, the features do not render correctly. The labels are not shown at all, and most of the features are not shown either.
It is because Mg server uses LabelRendererLocal to render labels of base layers. The last parameter 'path' of method
void LabelRendererLocal::ProcessLabelGroup(SE_LabelInfo* labels,
int nlabels,
RS_OverpostType type,
bool exclude,
LineBuffer* path)
is NULL when it is a point feature. We need to check before using it.
........
Property changes on: branches/2.6/MgDev
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/2.4/MgDev:6749-6756,6777-6783,6785-6787,6789,6791-6794,6796-6801,6954-6962,6986-7006
/sandbox/jng/createruntimemap:7486-7555
/sandbox/rfc94:5099-5163
/trunk/MgDev:8209-8210,8230,8313
+ /branches/2.4/MgDev:6749-6756,6777-6783,6785-6787,6789,6791-6794,6796-6801,6954-6962,6986-7006
/sandbox/jng/createruntimemap:7486-7555
/sandbox/rfc94:5099-5163
/trunk/MgDev:8209-8210,8230,8313,8359
Modified: branches/2.6/MgDev/Common/Stylization/LabelRendererLocal.cpp
===================================================================
--- branches/2.6/MgDev/Common/Stylization/LabelRendererLocal.cpp 2014-09-26 06:29:34 UTC (rev 8360)
+++ branches/2.6/MgDev/Common/Stylization/LabelRendererLocal.cpp 2014-09-27 07:11:20 UTC (rev 8361)
@@ -351,7 +351,8 @@
}
// remember the feature bounds for the label group
- m_labelGroups.back().m_feature_bounds = path->bounds();
+ // the path is NULL when it is a point feature, set m_feature_bounds to an invalid RS_Bounds.
+ m_labelGroups.back().m_feature_bounds = path ? path->bounds() : RS_Bounds(DBL_MAX, DBL_MAX, -DBL_MAX, -DBL_MAX);
EndOverpostGroup();
}
@@ -629,25 +630,28 @@
int tMaxY = (int)floor((maxY - tileMinY) / tileHgt);
// check if the leftmost tile can "see" the group
- double reqMaxX = tileMinX + (double)(tMinX + 1) * tileWid + offset; // right edge of the tile's request extent
- if (group.m_feature_bounds.minx > reqMaxX) // feature lies to the right of this edge
- continue;
+ // m_feature_bounds is invalid for point feature
+ if (group.m_feature_bounds.IsValid())
+ {
+ double reqMaxX = tileMinX + (double)(tMinX + 1) * tileWid + offset; // right edge of the tile's request extent
+ if (group.m_feature_bounds.minx > reqMaxX) // feature lies to the right of this edge
+ continue;
- // check if the rightmost tile can "see" the group
- double reqMinX = tileMinX + (double)(tMaxX ) * tileWid - offset; // left edge of the tile's request extent
- if (group.m_feature_bounds.maxx < reqMinX) // feature lies to the left of this edge
- continue;
+ // check if the rightmost tile can "see" the group
+ double reqMinX = tileMinX + (double)(tMaxX ) * tileWid - offset; // left edge of the tile's request extent
+ if (group.m_feature_bounds.maxx < reqMinX) // feature lies to the left of this edge
+ continue;
- // check if the bottommost tile can "see" the group
- double reqMaxY = tileMinY + (double)(tMinY + 1) * tileHgt + offset; // top edge of tile's request extent
- if (group.m_feature_bounds.miny > reqMaxY) // feature lies above this edge
- continue;
+ // check if the bottommost tile can "see" the group
+ double reqMaxY = tileMinY + (double)(tMinY + 1) * tileHgt + offset; // top edge of tile's request extent
+ if (group.m_feature_bounds.miny > reqMaxY) // feature lies above this edge
+ continue;
- // check if the topmost tile can "see" the group
- double reqMinY = tileMinY + (double)(tMaxY ) * tileHgt - offset; // bottom edge of tile's request extent
- if (group.m_feature_bounds.maxy < reqMinY) // feature lies below this edge
- continue;
-
+ // check if the topmost tile can "see" the group
+ double reqMinY = tileMinY + (double)(tMaxY ) * tileHgt - offset; // bottom edge of tile's request extent
+ if (group.m_feature_bounds.maxy < reqMinY) // feature lies below this edge
+ continue;
+ }
//-------------------------------------------------------
// check more involved cases
//-------------------------------------------------------
@@ -1091,8 +1095,9 @@
pGroup->m_exclude,
pGroup->m_type != RS_OverpostType_All);
- // only in the case of a simple label do we check the overpost type
- if (pGroup->m_algo == laSimple)
+ // in the case of a simple label do we check the overpost type
+ // we also need to check the overpost type for point feature even if it is a SE symbol
+ if (pGroup->m_algo == laSimple || pGroup->m_algo == laSESymbol)
{
if (res && (pGroup->m_type == RS_OverpostType_FirstFit))
break;
More information about the mapguide-commits
mailing list