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

Function generateLegendTemplate

maptemplate.c:2954–3476  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2952}
2953
2954char *generateLegendTemplate(mapservObj *mapserv)
2955{
2956 FILE *stream;
2957 char *file = NULL;
2958 int length;
2959 char *pszResult = NULL;
2960 char *legGroupHtml = NULL;
2961 char *legLayerHtml = NULL;
2962 char *legClassHtml = NULL;
2963 char *legLayerHtmlCopy = NULL;
2964 char *legClassHtmlCopy = NULL;
2965 char *legGroupHtmlCopy = NULL;
2966
2967 char *legHeaderHtml = NULL;
2968 char *legFooterHtml = NULL;
2969
2970 char *pszPrefix = NULL;
2971 char *pszMapFname = NULL;
2972
2973 struct stat tmpStat;
2974
2975 char *pszOrderMetadata = NULL;
2976 char *pszOrder = NULL;
2977
2978 int i,j,k;
2979 char **papszGroups = NULL;
2980 int nGroupNames = 0;
2981
2982 int nLegendOrder = 0;
2983 char *pszOrderValue;
2984
2985 hashTableObj *groupArgs = NULL;
2986 hashTableObj *layerArgs = NULL;
2987 hashTableObj *classArgs = NULL;
2988
2989 ms_regex_t re; /* compiled regular expression to be matched */
2990
2991 int *panCurrentDrawingOrder = NULL;
2992 char szPath[MS_MAXPATHLEN];
2993
2994 if(ms_regcomp(&re, MS_TEMPLATE_EXPR, MS_REG_EXTENDED|MS_REG_NOSUB) != 0) {
2995 msSetError(MS_IOERR, "Error regcomp.", "generateLegendTemplate()");
2996 return NULL;
2997 }
2998
2999 if(ms_regexec(&re, mapserv->map->legend.template, 0, NULL, 0) != 0) { /* no match */
3000 msSetError(MS_IOERR, "Invalid template file name.", "generateLegendTemplate()");
3001 ms_regfree(&re);
3002 return NULL;
3003 }
3004 ms_regfree(&re);
3005
3006/* -------------------------------------------------------------------- */
3007/* Save the current drawing order. The drawing order is reset */
3008/* at the end of the function. */
3009/* -------------------------------------------------------------------- */
3010 if(mapserv && mapserv->map && mapserv->map->numlayers > 0)
3011 {

Callers 3

mainFunction · 0.85
processLineFunction · 0.85
msProcessLegendTemplateFunction · 0.85

Calls 15

msSetErrorFunction · 0.85
msSmallMallocFunction · 0.85
strcasecmpFunction · 0.85
msStringConcatenateFunction · 0.85
msBuildPathFunction · 0.85
msValidateContextsFunction · 0.85
getInlineTagFunction · 0.85
getTagArgsFunction · 0.85
msAdjustExtentFunction · 0.85
msCalculateScaleFunction · 0.85
msLookupHashTableFunction · 0.85
sortLayerByMetadataFunction · 0.85

Tested by

no test coverage detected