Don't display a popup or register events on a Text layer that doesn't have both title and description. Fixes #471.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@2820 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Schuyler Erle
2007-03-19 20:52:17 +00:00
parent e266f430ca
commit 40a7cd881c
3 changed files with 27 additions and 2 deletions

View File

@@ -126,7 +126,9 @@ OpenLayers.Layer.Text.prototype =
var feature = new OpenLayers.Feature(this, location, data);
this.features.push(feature);
var marker = feature.createMarker();
marker.events.register('click', feature, this.markerClick);
if ((title != null) && (description != null)) {
marker.events.register('click', feature, this.markerClick);
}
this.addMarker(marker);
}
}