duplicating constants from Renderer.SVG and fixing API docs. Thanks jorix for the pointer. Non-functional change.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@11700 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -42,7 +42,7 @@ OpenLayers.Renderer.SVG2 = OpenLayers.Class(OpenLayers.Renderer.NG, {
|
|||||||
labelNodeType: "g",
|
labelNodeType: "g",
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor: OpenLayers.Renderer.SVG
|
* Constructor: OpenLayers.Renderer.SVG2
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* containerID - {String}
|
* containerID - {String}
|
||||||
@@ -615,14 +615,14 @@ OpenLayers.Renderer.SVG2 = OpenLayers.Class(OpenLayers.Renderer.NG, {
|
|||||||
}
|
}
|
||||||
var align = style.labelAlign || "cm";
|
var align = style.labelAlign || "cm";
|
||||||
text.setAttributeNS(null, "text-anchor",
|
text.setAttributeNS(null, "text-anchor",
|
||||||
OpenLayers.Renderer.SVG.LABEL_ALIGN[align[0]] || "middle");
|
OpenLayers.Renderer.SVG2.LABEL_ALIGN[align[0]] || "middle");
|
||||||
|
|
||||||
if (OpenLayers.IS_GECKO === true) {
|
if (OpenLayers.IS_GECKO === true) {
|
||||||
text.setAttributeNS(null, "dominant-baseline",
|
text.setAttributeNS(null, "dominant-baseline",
|
||||||
OpenLayers.Renderer.SVG.LABEL_ALIGN[align[1]] || "central");
|
OpenLayers.Renderer.SVG2.LABEL_ALIGN[align[1]] || "central");
|
||||||
} else {
|
} else {
|
||||||
tspan.setAttributeNS(null, "baseline-shift",
|
tspan.setAttributeNS(null, "baseline-shift",
|
||||||
OpenLayers.Renderer.SVG.LABEL_VSHIFT[align[1]] || "-35%");
|
OpenLayers.Renderer.SVG2.LABEL_VSHIFT[align[1]] || "-35%");
|
||||||
}
|
}
|
||||||
|
|
||||||
tspan.textContent = style.label;
|
tspan.textContent = style.label;
|
||||||
@@ -758,6 +758,31 @@ OpenLayers.Renderer.SVG2 = OpenLayers.Class(OpenLayers.Renderer.NG, {
|
|||||||
CLASS_NAME: "OpenLayers.Renderer.SVG2"
|
CLASS_NAME: "OpenLayers.Renderer.SVG2"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constant: OpenLayers.Renderer.SVG2.LABEL_ALIGN
|
||||||
|
* {Object}
|
||||||
|
*/
|
||||||
|
OpenLayers.Renderer.SVG2.LABEL_ALIGN = {
|
||||||
|
"l": "start",
|
||||||
|
"r": "end",
|
||||||
|
"b": "bottom",
|
||||||
|
"t": "hanging"
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constant: OpenLayers.Renderer.SVG2.LABEL_VSHIFT
|
||||||
|
* {Object}
|
||||||
|
*/
|
||||||
|
OpenLayers.Renderer.SVG2.LABEL_VSHIFT = {
|
||||||
|
// according to
|
||||||
|
// http://www.w3.org/Graphics/SVG/Test/20061213/htmlObjectHarness/full-text-align-02-b.html
|
||||||
|
// a baseline-shift of -70% shifts the text exactly from the
|
||||||
|
// bottom to the top of the baseline, so -35% moves the text to
|
||||||
|
// the center of the baseline.
|
||||||
|
"t": "-70%",
|
||||||
|
"b": "0"
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function: OpenLayers.Renderer.SVG2.preventDefault
|
* Function: OpenLayers.Renderer.SVG2.preventDefault
|
||||||
* Used to prevent default events (especially opening images in a new tab on
|
* Used to prevent default events (especially opening images in a new tab on
|
||||||
|
|||||||
Reference in New Issue
Block a user