Opened 15 years ago

Closed 13 years ago

#2924 closed enhancement (fixed)

Add binding support for SHADOWSIZE (patch file attached)

Reported by: karll Owned by: jmckenna
Priority: normal Milestone: 6.0 release
Component: Documentation - MapServer Version: svn-trunk (development)
Severity: normal Keywords:
Cc: dmorissette, tbonfort

Description

Attached is a patch to provide binding support for SHADOWSIZE. With this patch, both the X and Y components can be individually bound to a variable or hardcoded, as in:

    SHADOWSIZE 2 2
    SHADOWSIZE [shadowsizeX] 2
    SHADOWSIZE 2 [shadowsizeY]
    SHADOWSIZE [shadowsize] [shadowsize]

Two new binding styles were added: MS_STYLE_BINDING_SHADOWSIZEX and MS_STYLE_BINDING_SHADOWSIZEY.

The rationale in adding two bindings instead of one binding to contain both values is that, unlike a color, where three values specify one color, the shadow X and shadow Y sizes are distinct and each have an independent effect on the shadow placement. (The other choice would be to have only one binding, which also would have worked.)

Supporting two bindings on the same line necessitated a slight change in maplexer.l to make the MS_BINDING pattern stop at the first right bracket instead of the last one. In testing, this change had no impact on some big existing mapfiles I have (and it makes sense that it wouldn't, as any map file that tried to declare two bindings on one line like [foo] [bar] would get one binding of foo] [bar instead.)

The patch includes the necessary modification to writeLabel to write the SHADOWSIZE line. Mimicking the previous behavior, if neither shadow size is bound and the X and Y components are 1, the SHADOWSIZE line is not emitted.

Attachments (1)

mapserver.patch (5.9 KB ) - added by karll 15 years ago.
svn diff of mapserver.h, maplexer.l, mapfile.c, and maputil.c

Download all attachments as: .zip

Change History (5)

by karll, 15 years ago

Attachment: mapserver.patch added

svn diff of mapserver.h, maplexer.l, mapfile.c, and maputil.c

comment:1 by dmorissette, 15 years ago

Cc: dmorissette added
Milestone: 6.0 release

comment:2 by sdlime, 15 years ago

Cc: tbonfort added
Status: newassigned

Gonna hold of on this for 6.0 for a bit. Considering removing the SHADOW... parameters for a series of styles. If that happened you'd get all the style binding. Might need to bind the OFFSET parameter though since that's how you'd achieve a shadow...

Steve

comment:3 by sdlime, 13 years ago

Component: MapServer C LibraryMapServer Documentation
Owner: changed from sdlime to jmckenna
Status: assignednew

Shadowsize lives on since it's a text property not a marker or bbox property (where styles kick in). So, this binding has been enabled in r11064. Better late than never. Moving to documentation component.

Steve

comment:4 by tbonfort, 13 years ago

Resolution: fixed
Status: newclosed

doc committed in r11523.

Note: See TracTickets for help on using tickets.