RFC 14 Implementation Question

Steve Lime Steve.Lime at DNR.STATE.MN.US
Fri Apr 14 00:16:37 EDT 2006


Um, one last thing. Starting the position enumeration at, say, 20 means we have to do something  when writing mapfile. Recall that the enumerations have a companion arrat of strings that form a simple lookup table. Those will be out of sync. I'm wondering if we might do something like in map.h:

#define MS_POSITIONS_BASE_VALUE 20
enum MS_POSITIONS {MS_UL=MS_POSITIONS_INIT_VALUE, MS_LR, MS_UR, MS_LL, MS_CR, MS_CL, MS_UC, MS_LC, MS_CC, MS_AUTO, MS_XY, MS_FOLLOW};

So then in the mapfile writing code we'd offset the stored position by MS_POSITIONS_BASE_VALUE:

  fprintf(stream, "  %sPOSITION %s\n", tab, msPositions[label->position-MS_POSITIONS_BASE_VALUE]);

and so on for any parameters that use the positions enumeration.

Perhaps there's a better way though so I'm open to suggestions.

Steve



More information about the mapserver-dev mailing list