Ticket #2769 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

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.

Attachments

bug2769.patch Download (7.7 KB) - added by aboudreault 5 years ago.

Change History

Changed 5 years ago by aboudreault

Daniel, can you review the patch please ? I'm wondering if one of the conditions that i added in the maputil.c file is needed (the one for MS_LABEL_BINDING_COLOR style binding).

Changed 5 years ago by aboudreault

Changed 5 years ago by aboudreault

  • status changed from new to closed
  • resolution set to fixed

Fixed in r7922

Do you think this should be backported to 5.2 ?

Changed 5 years ago by aboudreault

The patch has been backported in 5.2.

Note: See TracTickets for help on using tickets.