Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I would like to add halos on my labels on an Openlayers map.

I have tried adding the following to my code but no halos display.

labelHaloColor: "#FFFFFF",
labelHaloWidth: "2",

I got that from here:

http://trac.osgeo.org/openlayers/ticket/2965

Do I need to use a newer version of OpenLayers to get this working? I am currently using the dev version.

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

The ticket's status is in "Needs Discussion", they are still working on this and the only way you can use this feature would be to install the patch. However, reading the last post you can see there are still bugs in it and they are "working on it". (in quotes because it's a minor priority and you could be waiting for a while.)

Alternatively, depending on the length of the content you put in there, you might be able to use a background graphic like such:

enter image description here

strokeColor: "#00FF00",
strokeOpacity: 0.7,
strokeWidth: 3,
fillColor: "#FF5500",
fillOpacity: 0.7,
pointRadius: 12,
pointerEvents: "visiblePainted",
//Supported values include “circle”, “square”, “star”, “x”, “cross”, and “triangle”.
graphicName: "circle",
label: "${order}",
fontColor: "#000000",
fontSize: "16px",
fontFamily: "Courier New, monospace",
fontWeight: "bold",
//Valid values for horizontal alignment: “l”=left, “c”=center, “r”=right.  
//Valid values for vertical alignment: “t”=top, “m”=middle, “b”=bottom.  
//Example values: “lt”, “cm”, “rb”
labelAlign: "cm",
labelXOffset: "0",
labelYOffset: "0"
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.