MCPcopy Index your code
hub / github.com/MapServer/MapServer / ParseTextLinePlacement

Function ParseTextLinePlacement

mapogcsld.c:3163–3200  ·  view source on GitHub ↗

/ ParseTextLinePlacement */ / Lineplacement node fro the text symbolizer. */ /

Source from the content-addressed store, hash-verified

3161/* Lineplacement node fro the text symbolizer. */
3162/************************************************************************/
3163int ParseTextLinePlacement(CPLXMLNode *psRoot, classObj *psClass)
3164{
3165 CPLXMLNode *psOffset = NULL, *psAligned=NULL;
3166
3167 if (!psRoot || !psClass)
3168 return MS_FAILURE;
3169
3170 /*if there is a line placement, we will assume that the
3171 best setting for mapserver would be for the text to follow
3172 the line #2806*/
3173 psClass->label.anglemode = MS_FOLLOW;
3174
3175 /*sld 1.1.0 has a parameter IsAligned. default value is true*/
3176 psAligned = CPLGetXMLNode(psRoot, "IsAligned");
3177 if (psAligned && psAligned->psChild && psAligned->psChild->pszValue &&
3178 strcasecmp(psAligned->psChild->pszValue, "false") == 0)
3179 {
3180 psClass->label.anglemode = MS_NONE;
3181 }
3182 psOffset = CPLGetXMLNode(psRoot, "PerpendicularOffset");
3183 if (psOffset && psOffset->psChild && psOffset->psChild->pszValue)
3184 {
3185 psClass->label.offsetx = atoi(psOffset->psChild->pszValue);
3186 psClass->label.offsety = atoi(psOffset->psChild->pszValue);
3187
3188 /*if there is a PerpendicularOffset, we will assume that the
3189 best setting for mapserver would be to use angle=0 and the
3190 the offset #2806*/
3191 /* since sld 1.1.0 introduces the IsAligned parameter, only
3192 set the angles if the parameter is not set*/
3193 if (!psAligned)
3194 {
3195 psClass->label.anglemode = MS_NONE;
3196 }
3197 }
3198
3199 return MS_SUCCESS;
3200}
3201
3202
3203/************************************************************************/

Callers 1

msSLDParseTextParamsFunction · 0.85

Calls 1

strcasecmpFunction · 0.85

Tested by

no test coverage detected