[OpenLayers-Dev] Text placement of features in vector layer

Ringdahl Niklas Niklas.Ringdahl at sweco.se
Tue Oct 27 05:32:22 EDT 2009


Yes! That is exactly what I thought was missing from the label design. :-) I will see if I am able to use the trunk version though, maybe I'll have to wait for the next release. 

Thanks a lot Roald!
- Niklas
 

-----Ursprungligt meddelande-----
Från: Roald de Wit [mailto:roald.dewit at lisasoft.com] 
Skickat: den 26 oktober 2009 22:29
Till: Ringdahl Niklas
Kopia: OpenLayers Dev
Ämne: Re: [OpenLayers-Dev] Text placement of features in vector layer

Hi,

Is this something that might help you? It got into trunk just a few days ago.

#2312: Add label offset to styles
http://trac.openlayers.org/ticket/2312

Regards, Roald

Ringdahl Niklas wrote:
> Hi list.
>
> I would like to have more control on the label placement, using features with labels on a vector layer. 
>
> I have several features added to a vector layer, rendering in SVG. I use the style attribute "label" to set a label text for the point, and the "labelAlign" attribute to set the alignment. But I don't feel that the "labelAlign" property is doing what I want, I would like more control of where my label ends up. So I looked into the SVG specification and the DOM elements created by OpenLayers for my features and labels and found the "dx" and "dy" attributes, which don't seem to be used in OpenLayers renderers. Is this a design decision or is it just an area which noone have looked into?
>
> What I would like to do is to be able to set the SVG specific properties, like "dx" and "dy" on the tspan element, to fine tune the placement of the labels. Are there any more possibilities to control this than using the "labelAlign" today? 
>
> If there is some kind of documentation of the label handling out there that I haven't found, I would be happy to be pointed in the right direction.
>
> Thanks!
> - Niklas
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev
>   




More information about the Dev mailing list