Ticket #2312 (closed feature: fixed)

Opened 4 years ago

Last modified 4 years ago

Add label offset to styles

Reported by: tazle Owned by: ahocevar
Priority: minor Milestone: 2.9 Release
Component: Style Version: 2.8
Keywords: Cc: tuure.laurinolli@…
State: Complete

Description

Currently it's not possible to specify label offset for styles. This is problematic when visualizing point features, since the text is drawn on the point, and will usually overlap any geraphical visualization on the point itself.

Looking at the code of the three renderers, adding offset should be simple. Just read the X and Y offset from the symbolizer, and add to the calculated screen coordinates.

I'm willing to write a sample implementation if there is no opposition to such feature in principle.

Attachments

labelOffset.patch Download (1.9 KB) - added by madair 4 years ago.
labelOffset2.patch Download (3.9 KB) - added by jlacroix 4 years ago.
new patch using stylemap option and with an example

Change History

Changed 4 years ago by tazle

  • cc tuure.laurinolli@… added

Changed 4 years ago by madair

  • keywords foss4g09 added

partial solution in #1083

Changed 4 years ago by madair

Changed 4 years ago by jlacroix

new patch using stylemap option and with an example

Changed 4 years ago by jlacroix

  • state changed from Needs Discussion to Review

The first patch was using a layer option. After some discussion we agreed to use a StyleMap option instead. labelOffset2.patch also include an example of the functionality.

Marking for review

Changed 4 years ago by ahocevar

  • keywords foss4g09 removed
  • status changed from new to closed
  • state changed from Review to Complete
  • resolution set to fixed

(In [9755]) added labelXOffset and labelYOffset symbolizer properties. Thanks madair for the original patch, and thanks jlacroix for turning it into symbolizer properties so nicely. p=jlacroix, r=me (fixes #2312)

Note: See TracTickets for help on using tickets.