From 8a21a1dba4391b12e93ede0754c93c78ec982e42 Mon Sep 17 00:00:00 2001 From: euzuro Date: Mon, 29 May 2006 18:20:41 +0000 Subject: [PATCH] only set popup content if values are defined git-svn-id: http://svn.openlayers.org/trunk/openlayers@455 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Layer/Text.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/OpenLayers/Layer/Text.js b/lib/OpenLayers/Layer/Text.js index fada5b4883..e655275a72 100644 --- a/lib/OpenLayers/Layer/Text.js +++ b/lib/OpenLayers/Layer/Text.js @@ -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'] = '

'+title+'

'+description+'

'; + if ((title != null) && (description != null)) { + data['popupContentHTML'] = '

'+title+'

'+description+'

'; + } var feature = new OpenLayers.Feature(this, location, data); var marker = feature.createMarker(); marker.events.register('click', feature, this.markerClick);