We are guarnteed that all TextLiteral properties are defined (see #770)

Instead of using the browser defaults, we use `ol.style.TextDefaults`.
This commit is contained in:
Tim Schaub
2013-06-21 09:53:28 -06:00
parent c7da7e4c2e
commit cab983f826
2 changed files with 5 additions and 20 deletions

View File

@@ -272,22 +272,12 @@ ol.renderer.canvas.VectorRenderer.prototype.renderPointFeatures_ =
ol.renderer.canvas.VectorRenderer.prototype.renderText_ =
function(features, text, texts) {
var context = this.context_,
fontArray = [],
color = text.color,
vecs, vec;
if (color) {
context.fillStyle = color;
}
if (goog.isDef(text.fontSize)) {
fontArray.push(text.fontSize + 'px');
}
if (goog.isDef(text.fontFamily)) {
fontArray.push(text.fontFamily);
}
if (fontArray.length) {
context.font = fontArray.join(' ');
if (context.fillStyle !== text.color) {
context.fillStyle = text.color;
}
context.font = text.fontSize + 'px ' + text.fontFamily;
context.globalAlpha = text.opacity;
// TODO: make alignments configurable