Merge pull request #140 from aabt/outline

Add label outline to SVG and Canvas renderers
This commit is contained in:
Antoine Abt
2012-01-17 04:45:50 -08:00
6 changed files with 63 additions and 13 deletions

View File

@@ -415,6 +415,12 @@ OpenLayers.Renderer.Elements = OpenLayers.Class(OpenLayers.Renderer, {
*/
LABEL_ID_SUFFIX: "_label",
/**
* Constant: LABEL_OUTLINE_SUFFIX
* {String}
*/
LABEL_OUTLINE_SUFFIX: "_outline",
/**
* Constructor: OpenLayers.Renderer.Elements
*
@@ -879,6 +885,10 @@ OpenLayers.Renderer.Elements = OpenLayers.Class(OpenLayers.Renderer, {
if (label) {
this.textRoot.removeChild(label);
}
var outline = document.getElementById(featureId + this.LABEL_OUTLINE_SUFFIX);
if (outline) {
this.textRoot.removeChild(outline);
}
},
/**