Opened 19 years ago
Closed 18 years ago
#1495 closed defect (fixed)
Support for classObj.text using mapscript
Reported by: | szekerest | Owned by: | sdlime |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | MapScript-SWIG | Version: | 4.8 |
Severity: | normal | Keywords: | |
Cc: |
Description
The current version 4.6.1 does not really support classObj.text, however it would provide convenient way to display labels base on multiple fields. It would be easy to bring into effect this, since getExpression and setExpression do almost the same. (see class.i) To support expressionObj would be more complicated. Tamas Szekeres
Change History (5)
comment:2 by , 18 years ago
Status: | new → assigned |
---|---|
Version: | 4.6 → 4.8 |
Will commit this over the weekend and in time for 4.8. Steve
comment:3 by , 18 years ago
I'd really like to add this as getText/setText. setText exists but has an unecessary argument (a *layerObj), so you can set a class text attribute now. I've got a query on the developer list asking for permission to fix that. I've added the get method you sent as getText... It looks like this in CVS: /* Should be deprecated! Completely bogus layer argument. SG. */ int setText(layerObj *layer, char *text) { if (!text || strlen(text) == 0) { freeExpression(&self->text); return MS_SUCCESS; } else return msLoadExpressionString(&self->text, text); } %newobject getText; char *getText() { char exprstring[256]; switch(self->text.type) { case(MS_REGEX): snprintf(exprstring, 255, "/%s/", self->text.string); return strdup(exprstring); case(MS_STRING): snprintf(exprstring, 255, "\"%s\"", self->text.string); return strdup(exprstring); case(MS_EXPRESSION): snprintf(exprstring, 255, "(%s)", self->text.string); return strdup(exprstring); } return NULL; } Steve
Note:
See TracTickets
for help on using tickets.