Skip to content

Commit

Permalink
Merge pull request openlayers#201 from tonio/labeldefault
Browse files Browse the repository at this point in the history
re-add default labelAlign
  • Loading branch information
tonio committed Feb 6, 2012
2 parents e3ab08b + 0d27dc8 commit 4b971a1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/OpenLayers/Renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ OpenLayers.Renderer.defaultSymbolizer = {
strokeWidth: 2,
fillOpacity: 1,
strokeOpacity: 1,
pointRadius: 0
pointRadius: 0,
labelAlign: 'cm'
};

2 changes: 1 addition & 1 deletion lib/OpenLayers/Renderer/SVG.js
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ OpenLayers.Renderer.SVG = OpenLayers.Class(OpenLayers.Renderer.Elements, {
} else {
label.setAttributeNS(null, "pointer-events", "none");
}
var align = style.labelAlign;
var align = style.labelAlign || OpenLayers.Renderer.defaultSymbolizer.labelAlign;
label.setAttributeNS(null, "text-anchor",
OpenLayers.Renderer.SVG.LABEL_ALIGN[align[0]] || "middle");

Expand Down
2 changes: 1 addition & 1 deletion lib/OpenLayers/Renderer/SVG2.js
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ OpenLayers.Renderer.SVG2 = OpenLayers.Class(OpenLayers.Renderer.NG, {
} else {
text.setAttributeNS(null, "pointer-events", "none");
}
var align = style.labelAlign;
var align = style.labelAlign || OpenLayers.Renderer.defaultSymbolizer.labelAlign;
text.setAttributeNS(null, "text-anchor",
OpenLayers.Renderer.SVG2.LABEL_ALIGN[align[0]] || "middle");

Expand Down

0 comments on commit 4b971a1

Please sign in to comment.