Basic support for canvas only (patch from trac #3503)
This commit is contained in:
@@ -527,7 +527,9 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
|
||||
drawText: function(location, style) {
|
||||
style = OpenLayers.Util.extend({
|
||||
fontColor: "#000000",
|
||||
labelAlign: "cm"
|
||||
labelAlign: "cm",
|
||||
labelOutlineColor: "white",
|
||||
labelOutlineWidth: 3
|
||||
}, style);
|
||||
var pt = this.getLocalXY(location);
|
||||
|
||||
@@ -560,6 +562,13 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
|
||||
this.canvas.measureText('xx').width;
|
||||
pt[1] += lineHeight*vfactor*(numRows-1);
|
||||
for (var i = 0; i < numRows; i++) {
|
||||
if (style.labelOutlineWidth) {
|
||||
this.canvas.save();
|
||||
this.canvas.strokeStyle = style.labelOutlineColor;
|
||||
this.canvas.lineWidth = style.labelOutlineWidth;
|
||||
this.canvas.strokeText(labelRows[i], pt[0], pt[1] + (lineHeight*i));
|
||||
this.canvas.restore();
|
||||
}
|
||||
this.canvas.fillText(labelRows[i], pt[0], pt[1] + (lineHeight*i));
|
||||
}
|
||||
} else if (this.canvas.mozDrawText) {
|
||||
|
||||
Reference in New Issue
Block a user