Permalink
Browse files

Add Gap/InitialGap to SLD GraphicStroke

  • Loading branch information...
tbonfort committed Dec 8, 2014
1 parent 20f4c13 commit a61610736bc63ab9cb79d04829d2319b506ef8bd
Showing with 18 additions and 1 deletion.
  1. +18 −1 mapogcsld.c
View
@@ -1506,7 +1506,7 @@ int msSLDParseGraphicFillOrStroke(CPLXMLNode *psRoot,
char *pszDashValue,
styleObj *psStyle, mapObj *map)
{
CPLXMLNode *psCssParam, *psGraphic, *psExternalGraphic, *psMark, *psSize;
CPLXMLNode *psCssParam, *psGraphic, *psExternalGraphic, *psMark, *psSize, *psGap, *psInitialGap;
CPLXMLNode *psWellKnownName, *psStroke, *psFill;
CPLXMLNode *psDisplacement=NULL, *psDisplacementX=NULL, *psDisplacementY=NULL;
CPLXMLNode *psOpacity=NULL, *psRotation=NULL;
@@ -1729,6 +1729,14 @@ int msSLDParseGraphicFillOrStroke(CPLXMLNode *psRoot,
}
msFree(pszSymbolName);
}
psGap = CPLGetXMLNode(psRoot, "Gap");
if (psGap && psGap->psChild && psGap->psChild->pszValue) {
psStyle->gap = atof(psGap->psChild->pszValue);
}
psInitialGap = CPLGetXMLNode(psRoot, "InitialGap");
if (psInitialGap && psInitialGap->psChild && psInitialGap->psChild->pszValue) {
psStyle->initialgap = atof(psInitialGap->psChild->pszValue);
}
return MS_SUCCESS;
}
@@ -3533,6 +3541,15 @@ char *msSLDGenerateLineSLD(styleObj *psStyle, layerObj *psLayer, int nVersion)
pszSLD = msStringConcatenate(pszSLD, pszGraphicSLD);
if(nVersion >= OWS_1_1_0) {
if(psStyle->gap > 0) {
snprintf(szTmp, sizeof(szTmp), "<%sGap>%f</%sGap>\n", sNameSpace,psStyle->gap,sNameSpace);
}
if(psStyle->initialgap > 0) {
snprintf(szTmp, sizeof(szTmp), "<%sInitialGap>%f</%sInitialGap>\n", sNameSpace,psStyle->initialgap,sNameSpace);
}
}
snprintf(szTmp, sizeof(szTmp), "</%sGraphicStroke>\n", sNameSpace);
pszSLD = msStringConcatenate(pszSLD, szTmp);

0 comments on commit a616107

Please sign in to comment.