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:
@@ -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 =
|
||||
}
|
||||
|
||||
}
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user