[OpenLayers-Users] feature with graphic and text

Andreas Hocevar ahocevar at opengeo.org
Tue Jun 5 00:52:57 PDT 2012


Currently labels in OpenLayers are always rendered on top of all
features - there is no API way to control their order or to make them
appear below features.

You cannot set the css class of the text, but you can use the
following properties to control the appearance of the labels:

 * fontColor - {String} The font color for the label, to be provided like CSS.
 * fontOpacity - {Number} Opacity (0-1) for the label
 * fontFamily - {String} The font family for the label, to be provided
like in CSS.
 * fontSize - {String} The font size for the label, to be provided like in CSS.
 * fontStyle - {String} The font style for the label, to be provided
like in CSS.
 * fontWeight - {String} The font weight for the label, to be provided
like in CSS.

Andreas.

On Sun, Jun 3, 2012 at 2:47 AM, blaze <baze985 at gmail.com> wrote:
> Hi all,
>
> Im using a feature which is a point with external graphic and a label(text)
>
> When I add more of this features to the map the texts are not
> overlaping(when to features are close the external graphics are overlaped
> but the label always stay on the top of all)
>
> I tried playing around with the xIndexes but there is no zIndex for the
> label only for external and background graphics
>
> Anyone having idea on this?!
>
>
> Also one other question, is there a way to set a css class name for the
> label?
> I saw in the dom the label is represented by a normal text element hold in a
> vroot perent element which itself is a child from the vector holding the
> feature.
>
> Blaze
>
> p.s there is a image provided for the overlaping!
> http://osgeo-org.1560.n6.nabble.com/file/n4978768/exp.png
>
> --
> View this message in context: http://osgeo-org.1560.n6.nabble.com/feature-with-graphic-and-text-tp4978768.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users



-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.


More information about the Users mailing list