Add offsetX and offsetY properties to ol.style.Text

This commit is contained in:
Frederic Junod
2014-03-11 14:06:51 +01:00
parent 6cadc2b9ab
commit 4a893f7837
4 changed files with 80 additions and 11 deletions
+28
View File
@@ -57,6 +57,18 @@ ol.style.Text = function(opt_options) {
* @type {ol.style.Stroke}
*/
this.stroke_ = goog.isDef(options.stroke) ? options.stroke : null;
/**
* @private
* @type {number}
*/
this.offsetX_ = goog.isDef(options.offsetX) ? options.offsetX : 0;
/**
* @private
* @type {number}
*/
this.offsetY_ = goog.isDef(options.offsetY) ? options.offsetY : 0;
};
@@ -68,6 +80,22 @@ ol.style.Text.prototype.getFont = function() {
};
/**
* @return {number} Horizontal text offset.
*/
ol.style.Text.prototype.getOffsetX = function() {
return this.offsetX_;
};
/**
* @return {number} Vertical text offset.
*/
ol.style.Text.prototype.getOffsetY = function() {
return this.offsetY_;
};
/**
* @return {ol.style.Fill} Fill style.
*/