only set popup content if values are defined

git-svn-id: http://svn.openlayers.org/trunk/openlayers@455 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-05-29 18:20:41 +00:00
parent e2782f1ad5
commit 8a21a1dba4

View File

@@ -9,6 +9,7 @@ OpenLayers.Layer.Text.prototype =
/** store url of text file
* @type str */
location:null,
/**
* @constructor
*
@@ -74,7 +75,6 @@ OpenLayers.Layer.Text.prototype =
}
if (set) {
var data = new Object();
if (url != null) {
data.icon = new OpenLayers.Icon(url,
iconSize,
@@ -90,7 +90,9 @@ OpenLayers.Layer.Text.prototype =
}
}
data['popupContentHTML'] = '<h2>'+title+'</h2><p>'+description+'</p>';
if ((title != null) && (description != null)) {
data['popupContentHTML'] = '<h2>'+title+'</h2><p>'+description+'</p>';
}
var feature = new OpenLayers.Feature(this, location, data);
var marker = feature.createMarker();
marker.events.register('click', feature, this.markerClick);