OpenLayers OpenLayers

Ticket #2312 (closed feature: fixed)

Opened 5 months ago

Last modified 5 months ago

Add label offset to styles

Reported by: tazle Assigned to: ahocevar
Priority: minor Milestone: 2.9 Release
Component: Style Version: 2.8
Keywords: Cc: tuure.laurinolli@indagon.com
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 (1.9 kB) - added by madair on 10/23/09 22:53:48.
labelOffset2.patch (3.9 kB) - added by jlacroix on 10/24/09 00:37:59.
new patch using stylemap option and with an example

Change History

10/19/09 08:20:33 changed by tazle

  • cc set to tuure.laurinolli@indagon.com.

10/23/09 00:29:42 changed by madair

  • keywords set to foss4g09.

partial solution in #1083

10/23/09 22:53:48 changed by madair

  • attachment labelOffset.patch added.

10/24/09 00:37:59 changed by jlacroix

  • attachment labelOffset2.patch added.

new patch using stylemap option and with an example

10/24/09 00:39:49 changed 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

10/24/09 04:41:37 changed by ahocevar

  • keywords deleted.
  • 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)