[OpenLayers-Users] Vector text labels with offsets?

Stephen Woodbridge woodbri at swoodbridge.com
Sat Mar 13 21:13:09 EST 2010


Thank you for pointing that out to me.
That is exactly what I needed.

ATB,
   -Steve

Arnd Wippermann wrote:
> Hi,
> 
> see
> 
> http://trac.openlayers.org/changeset/9755
> http://openlayers.org/dev/examples/vector-features-with-text.html
> 
> Arnd 
> 
> -----Ursprüngliche Nachricht-----
> Von: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Im
> Auftrag von Stephen Woodbridge
> Gesendet: Freitag, 12. März 2010 23:31
> An: openlayers user list
> Betreff: [OpenLayers-Users] Vector text labels with offsets?
> 
> Hi,
> 
> Is it possible to give and offset to the text label position?
> 
> I have point features display by 25x25 pixel image. and I would like to
> place a text label centered and above each image. I have tried:
> 
>              styleMap = new OpenLayers.StyleMap({
>                  "default": new OpenLayers.Style({
>                      label: "${name}",
>                      fontColor: "black",
>                      fontSize: "10px",
>                      fontFamily: "Arial",
>                      labelAlign: "cb",
>                      fillOpacity: 1,
>                      pointRadius: 15
>                  }),
>                  ...
> 
> and playing with labelAlign, but the label still passes through the image.
> It would be really great if you could do something like:
> 
>                      labelOffset: new OpenLayers.Pixel(0,-10),
> 
> and have it shift the label position in Y by -10 pixels.
> 
> I looked through the code, but I'm not seeing a way to do that. Does anyone
> else think this would be useful? Is there a patch for this by any chance?
> 
> -Steve
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
> 




More information about the Users mailing list