Rename style.graphicTitle to style.title (the former is now deprecated)

This commit is contained in:
Frederic Junod
2012-05-15 12:46:41 +02:00
parent d01f57d3e6
commit 8268616ec8
5 changed files with 17 additions and 12 deletions
+3 -2
View File
@@ -241,8 +241,9 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
drawExternalGraphic: function(geometry, style, featureId) {
var img = new Image();
if (style.graphicTitle) {
img.title = style.graphicTitle;
var title = style.title || style.graphicTitle;
if (title) {
img.title = title;
}
var width = style.graphicWidth || style.graphicHeight;
+5 -4
View File
@@ -240,16 +240,17 @@ OpenLayers.Renderer.SVG = OpenLayers.Class(OpenLayers.Renderer.Elements, {
style = style || node._style;
options = options || node._options;
if (style.graphicTitle) {
node.setAttributeNS(null, "title", style.graphicTitle);
var title = style.title || style.graphicTitle;
if (title) {
node.setAttributeNS(null, "title", title);
//Standards-conformant SVG
// Prevent duplicate nodes. See issue https://github.com/openlayers/openlayers/issues/92
var titleNode = node.getElementsByTagName("title");
if (titleNode.length > 0) {
titleNode[0].firstChild.textContent = style.graphicTitle;
titleNode[0].firstChild.textContent = title;
} else {
var label = this.nodeFactory(null, "title");
label.textContent = style.graphicTitle;
label.textContent = title;
node.appendChild(label);
}
}
+3 -2
View File
@@ -207,8 +207,9 @@ OpenLayers.Renderer.VML = OpenLayers.Class(OpenLayers.Renderer.Elements, {
options = options || node._options;
var fillColor = style.fillColor;
if (style.graphicTitle) {
node.title=style.graphicTitle;
var title = style.title || style.graphicTitle;
if (title) {
node.title = title;
}
if (node._geometryClass === "OpenLayers.Geometry.Point") {