diff --git a/examples/style-rules.js b/examples/style-rules.js
index b41f720a5a..de8839a7b7 100644
--- a/examples/style-rules.js
+++ b/examples/style-rules.js
@@ -56,7 +56,7 @@ var style = new ol.style.Style({rules: [
}),
new ol.style.Text({
color: '#bada55',
- name: new ol.Expression('label'),
+ text: new ol.Expression('label'),
fontFamily: 'Calibri,sans-serif',
fontSize: 14
})
diff --git a/src/objectliterals.jsdoc b/src/objectliterals.jsdoc
index f149bca03e..ad0878ce80 100644
--- a/src/objectliterals.jsdoc
+++ b/src/objectliterals.jsdoc
@@ -578,7 +578,7 @@
* @property {string|ol.Expression|undefined} color Color.
* @property {string|ol.Expression|undefined} fontFamily Font family.
* @property {number|ol.Expression|undefined} fontSize Font size in pixels.
- * @property {string|ol.Expression} name Name (i.e. text content) of the label.
+ * @property {string|ol.Expression} text Text for the label.
* @property {number|ol.Expression|undefined} opacity Opacity (0-1).
*/
diff --git a/src/ol/layer/vectorlayer.js b/src/ol/layer/vectorlayer.js
index 42f56eca70..f662b44ca8 100644
--- a/src/ol/layer/vectorlayer.js
+++ b/src/ol/layer/vectorlayer.js
@@ -318,7 +318,7 @@ ol.layer.Vector.prototype.groupFeaturesBySymbolizerLiteral =
item = featuresBySymbolizer[uniqueLiterals[key]];
item[0].push(feature);
if (literal instanceof ol.style.TextLiteral) {
- item[2].push(literals[j].name);
+ item[2].push(literals[j].text);
}
}
}
diff --git a/src/ol/renderer/canvas/canvasvectorrenderer.js b/src/ol/renderer/canvas/canvasvectorrenderer.js
index 09edbf643d..482b409be0 100644
--- a/src/ol/renderer/canvas/canvasvectorrenderer.js
+++ b/src/ol/renderer/canvas/canvasvectorrenderer.js
@@ -266,11 +266,11 @@ ol.renderer.canvas.VectorRenderer.prototype.renderPointFeatures_ =
/**
* @param {Array.
} features Array of features.
* @param {ol.style.TextLiteral} text Text symbolizer.
- * @param {Array} names Label text for each feature.
+ * @param {Array} texts Label text for each feature.
* @private
*/
ol.renderer.canvas.VectorRenderer.prototype.renderLabels_ =
- function(features, text, names) {
+ function(features, text, texts) {
var context = this.context_,
fontArray = [],
color = text.color,
@@ -298,7 +298,7 @@ ol.renderer.canvas.VectorRenderer.prototype.renderLabels_ =
for (var j = 0, jj = vecs.length; j < jj; ++j) {
vec = vecs[j];
goog.vec.Mat4.multVec3(this.transform_, vec, vec);
- context.fillText(names[i], vec[0], vec[1]);
+ context.fillText(texts[i], vec[0], vec[1]);
}
}
diff --git a/src/ol/style/text.js b/src/ol/style/text.js
index 4a260f395a..bf0be505b4 100644
--- a/src/ol/style/text.js
+++ b/src/ol/style/text.js
@@ -12,7 +12,7 @@ goog.require('ol.style.SymbolizerLiteral');
* @typedef {{color: (string|undefined),
* fontFamily: (string|undefined),
* fontSize: number,
- * name: string,
+ * text: string,
* opacity: number}}
*/
ol.style.TextLiteralOptions;
@@ -43,9 +43,9 @@ ol.style.TextLiteral = function(options) {
/** @type {number} */
this.fontSize = options.fontSize;
- goog.asserts.assertString(options.name, 'name must be a string');
+ goog.asserts.assertString(options.text, 'text must be a string');
/** @type {string} */
- this.name = options.name;
+ this.text = options.text;
goog.asserts.assertNumber(options.opacity, 'opacity must be a number');
/** @type {number} */
@@ -105,8 +105,8 @@ ol.style.Text = function(options) {
* @type {ol.Expression}
* @private
*/
- this.name_ = (options.name instanceof ol.Expression) ?
- options.name : new ol.ExpressionLiteral(options.name);
+ this.text_ = (options.text instanceof ol.Expression) ?
+ options.text : new ol.ExpressionLiteral(options.text);
/**
* @type {ol.Expression}
@@ -145,8 +145,8 @@ ol.style.Text.prototype.createLiteral = function(opt_feature) {
var fontSize = this.fontSize_.evaluate(feature, attrs);
goog.asserts.assertNumber(fontSize, 'fontSize must be a number');
- var name = this.name_.evaluate(feature, attrs);
- goog.asserts.assertString(name, 'name must be a string');
+ var text = this.text_.evaluate(feature, attrs);
+ goog.asserts.assertString(text, 'text must be a string');
var opacity = this.opacity_.evaluate(feature, attrs);
goog.asserts.assertNumber(opacity, 'opacity must be a number');
@@ -155,7 +155,7 @@ ol.style.Text.prototype.createLiteral = function(opt_feature) {
color: color,
fontFamily: fontFamily,
fontSize: fontSize,
- name: name,
+ text: text,
opacity: opacity
});
};
@@ -166,6 +166,6 @@ ol.style.Text.prototype.createLiteral = function(opt_feature) {
*/
ol.style.TextDefaults = new ol.style.TextLiteral({
fontSize: 10,
- name: '',
+ text: '',
opacity: 1
});