Ticket #2769 (closed defect: fixed)
QUERYMAP hilite color isn't applied when using a color from a data source
| Reported by: | aboudreault | Owned by: | aboudreault |
|---|---|---|---|
| Priority: | normal | Milestone: | 5.4 release |
| Component: | MapServer C Library | Version: | unspecified |
| Severity: | normal | Keywords: | |
| Cc: | dmorissette, sdlime |
Description
Even if we set a QUERYMAP section with a hilite color, the color will not be applied when msDrawQueryLayer() is called if using a color from a data source. However, this works properly if we just set a RGB color directly in the mapfile. You can reproduce this easily with PHP/MapScript by calling the queryByRect() function on a layer and draw the query with the drawQuery() function. Here's an example of a layer setting (the color came from a DBF file) :
STYLE
OUTLINECOLOR [outline_color]
COLOR [color]
SIZE 6
END
LABEL
TYPE TRUETYPE
FONT "Arial"
ANGLE AUTO
SIZE 12
POSITION AUTO
OUTLINECOLOR [outline_color]
COLOR [color]
END
The problem is in the mapdraw.c file. The msDrawShape() function that call the msBindLayerToShape() function and it override the color that has been set by the msDrawQueryLayer() function. This can be fixed by simply add a parameter to the msDrawShape() function (and msBindLayerToShape()) that means to tell the msBindLayerToShape() function if the color/outline color of the shape must be "binded" with the data source.

